Raik Thalheim wrote :

>Environment:MAXDB Version 7.00.8

>Hi,
>
>i want to execute an SQL-statement generated by
>an sub-dbproc (see the example code please).
>I can call the CREATE_KST_LEISTUNG dbproc
>but the SQL-statement does not executed by the caller dbproc.
>
>Where is my mistake?
>
>Thank you,
>Raik Thalheim
>
>
>
>/*##################################################################*/
>CREATE DBPROC CREATE_KST_LEISTUNG(IN int_Test Integer) AS
>VAR
>SQL_KST_PRO_LST  VARCHAR(8000);
>
>
>    call GET_STRING(:SQL_KST_PRO_LST);
>    execute SQL_KST_PRO_LST;
>
>
>
>/*##################################################################*/
>CREATE DBPROC GET_STRING(OUT SQL  VARCHAR(8000))AS
>       SET SQL   = 'INSERT INTO .......
>                   SELECT ... FROM "TEMP"."TABLE" ';
>/*##################################################################*/

Actually I can't see anything wrong. But how did you verify that the statement
has not been executed ? Maybe the statement execution just returned an error.
I recommend to check the sqlcode after the statement execution : 

CREATE DBPROC CREATE_KST_LEISTUNG(IN int_Test Integer) AS
VAR
SQL_KST_PRO_LST  VARCHAR(8000);

    call GET_STRING(:SQL_KST_PRO_LST);
    execute SQL_KST_PRO_LST;
    if $rc <> 0 then stop (-31001, "unexpected error " || chr($rc));


Best Regards,
Thomas














    


-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to