471,853 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

kinterbase and stored procedure

Hallo everybody using kinterbase,

I' relative new to DB and python, so forgive if the
questions is stupide.

I'm trying to write the declaration of a SP to the server in
the way:

SPSETUP = \
"SET TERM !!;
" CREATE PROCEDURE MYPROC
AS ..."

cursor = kinterbasdb.connect(...)
cursor.excute(SPSETUP)

But it seems that anything has problems with "SET TERM !!"
expression . If I use the DB SQL console, everything seems
to be OK (the proc is setup)

''' kinterbasdb.ProgrammingError : (-104,
'isc_dsql_execute_immediate: Dynamic SQL Error. SQL error
code = -104. Token unknown - line 1, char 4. TERM. ') '''
Any help is very welcome ...

Regards
Alexander
Jul 18 '05 #1
2 1884
cursor = kinterbasdb.connect(...)
cursor.excute(SPSETUP)

But it seems that anything has problems with "SET TERM !!" expression
. If I use the DB SQL console, everything seems to be OK (the proc is
setup)


Yes, that is true. The "SET TERM" command is not really a command that
is processed by the backend.
Please note that the terminator is used to separate commands. However,
you will (normally) execute only one
command at a time with "cursor.execute". So you should create your
procedure without the "SET TERM".
InterBase will surely know that this is only one command. You can try to
run the "SET TERM" command
in a separate "cursor.execute", but probably that is not needed. I had
the same problem with Oracle triggers
before - you must not place the ending "/" character when createing
Oracle triggers from your own program.

Please let me know if it helps.
Best,

Laci 2.0
Jul 18 '05 #2
Gandalf schrieb:
cursor = kinterbasdb.connect(...)
cursor.excute(SPSETUP)

But it seems that anything has problems with "SET TERM !!" expression
. If I use the DB SQL console, everything seems to be OK (the proc is
setup)

Yes, that is true. The "SET TERM" command is not really a command that
is processed by the backend.
Please note that the terminator is used to separate commands. However,
you will (normally) execute only one
command at a time with "cursor.execute". So you should create your
procedure without the "SET TERM".
InterBase will surely know that this is only one command. You can try to
run the "SET TERM" command
in a separate "cursor.execute", but probably that is not needed. I had
the same problem with Oracle triggers
before - you must not place the ending "/" character when createing
Oracle triggers from your own program.

Please let me know if it helps.


Thanks a lot, that is the solution.
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Thomasb | last post: by
2 posts views Thread by Dino L. | last post: by
3 posts views Thread by kd | last post: by
2 posts views Thread by jed | last post: by
reply views Thread by SOI_0152 | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.