How to call a procedure in SQL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to call a procedure in SQL

Gary Chen-5
Hi,

I am going to call a stored procedure from SQL code, but I get the
following warning message.
"dynamic parameter or variable required as INOUT or OUT argument".


My test SQL script is :

DECLARE strStatus  VARCHAR(512);
CALL InsertEmailAccount('[hidden email]','123456','note 1',strStatus);
CALL strStatus;


The stored procedure InsertEmailAccount() is created successfully.
Its signature is:
CREATE PROCEDURE InsertEmailAccount(IN strEmailAddr VARCHAR(256), IN
strPassword VARCHAR(64), IN strNote VARCHAR(512), INOUT strStatus
VARCHAR(512))



I googled the web for a demo on how to call stored procedures, but get
nothing useful.

Can anyone help on this?
Many thanks.

Gary

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|

Re: How to call a procedure in SQL

Fred Toussi-2
Your example works with the latest version 2.2.8

I used this definition for the procedure:

CREATE PROCEDURE InsertEmailAccount(IN strEmailAddr VARCHAR(256), IN
strPassword VARCHAR(64), IN strNote VARCHAR(512), INOUT strStatus
VARCHAR(512)) CONTAINS SQL
BEGIN ATOMIC
SET strStatus = 'test string';
END


On Mon, Mar 26, 2012, at 20:06, Gary Chen wrote:

> Hi,
>
> I am going to call a stored procedure from SQL code, but I get the
> following warning message.
> "dynamic parameter or variable required as INOUT or OUT argument".
>
>
> My test SQL script is :
>
> DECLARE strStatus  VARCHAR(512);
> CALL InsertEmailAccount('[hidden email]','123456','note 1',strStatus);
> CALL strStatus;
>
>
> The stored procedure InsertEmailAccount() is created successfully.
> Its signature is:
> CREATE PROCEDURE InsertEmailAccount(IN strEmailAddr VARCHAR(256), IN
> strPassword VARCHAR(64), IN strNote VARCHAR(512), INOUT strStatus
> VARCHAR(512))
>
>
>
> I googled the web for a demo on how to call stored procedures, but get
> nothing useful.
>
> Can anyone help on this?
> Many thanks.
>
> Gary
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Hsqldb-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user