Re: [Q] Pro*C/Dynamic SQL, can the WHERE clause be dynamic?
Date: Thu, 19 Jan 1995 18:47:31 GMT
Message-ID: <D2o1J7.25A_at_inter.NL.net>
Dale Edgar (dedgar_at_fearless.csi.nb.ca) wrote:
: Hi All
: Can the WHERE clause be dynamic in Pro*C (method 3 or 4?).
: What I'd like to do is be able to code up a routine able to process runtime
: created WHERE statements like:
: SELECT :empno, :empname FROM emp WHERE empname = :stringvar;
: and something like
: SELECT :empno, :empname FROM emp WHERE SOUNDEX(empname) = SOUNDEX(:stringvar);
: The select-list items are always the same, its the construction of the WHERE
: part of the statement that will vary according to the users inputs.
: Is this do-able or does one hard code a bunch of regular Pro*C SQL querys
: for the job.
: Many Thanks in Advance
: Dale Edgar
: Cybersmith Inc.
: dedgar_at_csi.nb.ca
Hello,
This can be solved, see the "Pro*C supplement to the Oracle Precompilers Guide" . In Chapter 5 they talk about Implementing Dynamic SQL method 4. I used this method to implement the dynamic queries.
Greetings,
Ronnie Received on Thu Jan 19 1995 - 19:47:31 CET