Subject | Re: [firebird-support] Dynamic Query in Firebird |
---|---|
Author | Martijn Tonies |
Post date | 2007-05-23T06:48:57Z |
Hello Tomy,
EXECUTE STATEMENT is how you do it.
But, if you do a SELECT, it needs something to return values to. You cannot
"just select" and expect the results to go "somewhere".
Show us your exact procedure.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> How to create a stored procedure that receive sql query as input parameterand return values based on its input?
>= ''John'''
> The skeleton for the stored procedure is:
>
> create procedure spDynamicQuery(sqlQuery varchar(1024))
> as
> begin
> -- execute statement :sqlQuery here
> end
>
> example of sqlQuery: 'select users.username from users where users.userid
>type in EXECUTE STATEMENT).
> I've tried many approaches but there's an error message (Wrong request
EXECUTE STATEMENT is how you do it.
But, if you do a SELECT, it needs something to return values to. You cannot
"just select" and expect the results to go "somewhere".
Show us your exact procedure.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com