Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Can I run stored procedures from a SQL Script?
Wed, Jun 1 2011 4:51 AMPermanent Link

Adam Brett

Orixa Systems

I can write a stored procedure & run it from delphi using the stored procedure component & setting the params in the same way I would set them for a query.

I expect to also be able to run a procedure within an EDB script using notation something like this:

SCRIPT
BEGIN
 EXECUTE IMMEDIATE
   ' RepairTable(''Customer'') ';
END

for a DB where I have a procedure called RepairTable with a VARCHAR param.

I guess I am missing a number of steps in the script ... probably I have to declare a variable at the start of the script? or something ... but I can't find any examples of how to do this in the HELP, so I am really thrashing around.

Can anyone post an example of how to set up a script to call a StoredProc, set its params & then run it?

Thanks!
Wed, Jun 1 2011 6:52 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


Look up CALL in the OLH

Roy Lambert [Team Elevate]
Fri, Jun 3 2011 12:21 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< I expect to also be able to run a procedure within an EDB script using
notation something like this: >>

This is what you would use:


SCRIPT
BEGIN
 CALL RepairTable('Customer');
END

Procedure and function calls in EDB's SQL/PSM are bound during compilation
time, meaning they do not require an EXECUTE IMMEDIATE or escapement.  Only
DML and DDL statements are executed dynamically.

--
Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jun 6 2011 1:56 PMPermanent Link

Adam Brett

Orixa Systems

D'Oh.

... I did try EXECUTE, RUN & several other options ... didn't think of calling. I don't use the phone much I suppose.
Image