jsaravana
asked on
Using stored procedure return value in batch file
Hi,
The below procedure returns the count of rows in a table. I need to call this Sprocedure from batch file. I need to use the value returned from the procedure in the batch file.
CREATE PROCEDURE get_count()
LANGUAGE SQL
P1:BEGIN ATOMIC
DECLARE CNT INTEGER;
select count(*) into CNT from administrator.test_title;
RETURN CNT;
END P1
@
Please give a solution for this. Thanks!.
The below procedure returns the count of rows in a table. I need to call this Sprocedure from batch file. I need to use the value returned from the procedure in the batch file.
CREATE PROCEDURE get_count()
LANGUAGE SQL
P1:BEGIN ATOMIC
DECLARE CNT INTEGER;
select count(*) into CNT from administrator.test_title;
RETURN CNT;
END P1
@
Please give a solution for this. Thanks!.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks..
Both the logic was helpful for me to find the count. I wanted to call the stored procedure from windows batch file so grep would not have worked. As returning is not possible I stored the count of rows in a file. Then used 'find' and 'fc' command of batch.
Both the logic was helpful for me to find the count. I wanted to call the stored procedure from windows batch file so grep would not have worked. As returning is not possible I stored the count of rows in a file. Then used 'find' and 'fc' command of batch.
Ahh...
Windows batch scripting was tagged. We all missed that part.
Apologies,
Kent
Windows batch scripting was tagged. We all missed that part.
Apologies,
Kent
ASKER
Could anybody please address this post.