×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

DSQL in Stored Procedure

DSQL in Stored Procedure

DSQL in Stored Procedure

(OP)
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

RE: DSQL in Stored Procedure

What frontend do you use ?

RE: DSQL in Stored Procedure

"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
http://www.upscene.com

RE: DSQL in Stored Procedure

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.

RE: DSQL in Stored Procedure

Sure, and in MS SQL you can do this as well, however, this is an InterBase forum

Martijn Tonies
Database Workbench - the developer tool for InterBase and Firebird
http://www.upscene.com

RE: DSQL in Stored Procedure

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.

RE: DSQL in Stored Procedure

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
http://www.upscene.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close