[python-sybase] Problems invoking stored procedures

hopfgartner hopfgartner at rolmail.net
Mon, 25 Nov 2002 12:18:47 +0100


This is a multi-part MIME message

--_===26911079====rolmail.net===_
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit

Hello,

since we are suning SQL Server 2000 the whole day I'm
working on some tools that should help us to:

1) get quickly all objects as text files in DDL, that can
be processed by CVS

2) export the database schme to DIA.

3) eventually help porting the objects to SQL:1999 or
PostgreSQL

Many things work now, but when I try to run a stored
procedure, sp_helpconstraint, I get a lot of problems.

The system I'm working on is:

Server:
    Windows 2000 SP2
    SQL Server 2000 SP2

Client:
    Debian testing
    Python 2.1.2 and Python 2.3 pre-packages
    sybase-3.6pre1

The problem is included in the 2 attachments. They contain
2 different invokations of the the stored procedure.

The first test gives me:

bonobo@bonobo:~/devel/dbweaver$ python spTest.py
[('DEFAULT on column alrm_time', 'DF_Alarme_Time', '(n/a)',
'(n/a)', '(n/a)', '(n/a)', '(getdate())'), ('PRIMARY KEY
(non-clustered)', 'PK_Alarme', '(n/a)', '(n/a)', '(n/a)',
'(n/a)', 'alrm_id')]
Traceback (most recent call last):
  File "spTest.py", line 8, in ?
    curs.close()
  File "/usr/lib/python2.1/site-packages/Sybase.py", line
350, in close
    self._close()
  File "/usr/lib/python2.1/site-packages/Sybase.py", line
262, in _close
    status = self._cmd.ct_cancel(CS_CANCEL_ALL)
  File "/usr/lib/python2.1/site-packages/Sybase.py", line
145, in _servermsg_cb
    raise DatabaseError(_fmt_server(msg))
Sybase.DatabaseError: State 1, Procedure sp_helpconstraint,
Line 276
 Msg 15470, State 1, Procedure sp_helpconstraint, Line 287
No foreign keys reference this table.

The second gives simply:

bonobo@bonobo:~/devel/dbweaver$ python spTest2.py
Segmentation fault


Could somebody help me?

Thank you very much for your attention.

Peter Hopfgartner

--_===26911079====rolmail.net===_
Content-Type: application/octet-stream
Content-Disposition: attachment;
 filename="spTest.py"
Content-Transfer-Encoding: base64

aW1wb3J0IFN5YmFzZQoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgIHNjb25uID0g
U3liYXNlLmNvbm5lY3QoJzE3Mi4xNi4zMC43NScsICdpdm9rb21tJywgJ2l2b2tvbW0nLCAn
bGFnZXIwMV9zYXAnKQogICAgY3VycyA9IHNjb25uLmN1cnNvcigpCiAgICBjdXJzLmNhbGxw
cm9jKCdzcF9oZWxwY29uc3RyYWludCBhbGFybWUsIFwnbm9tc2dcJycpCiAgICBwcmludCBj
dXJzLmZldGNoYWxsKCkKICAgIGN1cnMuY2xvc2UoKQo=

--_===26911079====rolmail.net===_
Content-Type: application/octet-stream
Content-Disposition: attachment;
 filename="spTest2.py"
Content-Transfer-Encoding: base64

aW1wb3J0IFN5YmFzZQoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgIHNjb25uID0g
U3liYXNlLmNvbm5lY3QoJzE3Mi4xNi4zMC43NScsICdpdm9rb21tJywgJ2l2b2tvbW0nLCAn
bGFnZXIwMV9zYXAnKQogICAgY3VycyA9IHNjb25uLmN1cnNvcigpCiAgICBjdXJzLmNhbGxw
cm9jKCdzcF9oZWxwY29uc3RyYWludCcsICgnYWxhcm1lJywgJ1wnbm9tc2dcJycpKQogICAg
cHJpbnQgY3Vycy5mZXRjaGFsbCgpCiAgICBjdXJzLmNsb3NlKCkK

--_===26911079====rolmail.net===_--