Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSQL in Stored Procedure

Status
Not open for further replies.

sdin

Programmer
Sep 18, 2003
1
US
any one have any idea about how we can use DSQL in stored procedure.

Explanation:
I mean in front end if user select something from combnos or text field then accoerding to that we built a where clause of query i.e. the number of fields varies in where clause and we built a string and then use that string in catenation with our query.

My question is how we can dynamicly create different numbers of field for where clause in stored procedure.(note: we can send argument values but not strquery or strwhere as a string to sp)

I want to use where clause in sp. but when i create a where clause in sp or pass it to sp from front end, then the where clause will be of the type varchar(..)
and how we can use it.

e.g. select * from client where strwher will give error

or in cursor
For strquery into :client_id,:client_nm...... is also error
 
"My question is how we can dynamicly create different numbers of field for where clause in stored procedure"

You cannot. Stored procedures - in InterBase - are fixed upon "compile time" - that is, the CREATE PROCEDURE or ALTER PROCEDURE statement.


Martijn Tonies
Database Workbench - the developer tool for InterBase and Firebird
 
In Firebird 1.5 I can...

EXECUTE STATEMENT {STRING}

This command is available in stored procedures. The command string can be built in SP based on parameters.
 
I don't know, I thought is possible, Firebird is an Interbase clone, isn't it? I was sure that this command is available in a newer version of Interbase too. Sorry for eventual misleading.
So the only solution is to build the SQL statement at client side, I think.
 
Firebird is an InterBase clone - that's right. But they are growing more apart every day ... With Firebird, you always get to know the latest of what is available and what is done, with InterBase, we have to wait until a release... :)

Anyways, it becomes harder to migrate to Firebird if you're using IB specific things, simply because these two engines will become two different engines in the near future.


Martijn Tonies
Database Workbench - the developer tool for InterBase and Firebird
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top