Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: parameters in query

Re: parameters in query

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 7 Apr 2005 09:53:01 -0800
Message-ID: <4255656d@news.victoria.tc.ca>


Tom (mail_at_yahoo.com) wrote:
: problem is more complex
: we have aplication in delphi but without code, dont' ask why it's too long.
: In edit box i write query, in another input and pick type of variable.
: After execution on screen we have listing of requestes data depending on
: input variables. So aplication works only with bind variables (database
: level)...
: and delphi aplication reqognize only this syntax:
: select * from order where id_order in (:d_order)
: "&" is unknown!!!

If that is exactly the syntax the delphi requires then you cannot look up a list - but it seems odd that the delphi app would use an IN with a bind variable.

Perhaps you really mean that you can use _any_ select statement, but _only_ with bind variables.

One possible technique...

You can enter you values as a single string (e.g. ":1:2:3:") and then use a string function (untested code, rtm to validate syntax)

        select * from order where INSTR(:orders,':'||id_order||':')

The bind variable :orders is a _string_ with all the numbers embedded in it. In pl/sql that would be written as

        orders := ':1:2:3:';

Depending how the data must be input, you might need to fiddle with the bind value in the select

        instr( ':' || ltrim(rtrim(to_char(:orders))) || ':' , ...)

which might all better be done as a function in the database

        select * from order where I_WANT_THIS_ONE(id_order,:orders);

$0.02

--

This space not for rent.
Received on Thu Apr 07 2005 - 12:53:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US