Re: [Q] Pro*C/Dynamic SQL, can the WHERE clause be dynamic?

From: Bruce Arbuckle <brucea_at_atlas.com>
Date: Tue, 24 Jan 1995 18:12:08 GMT
Message-ID: <1995Jan24.181208.12220_at_atlas.com>


In article <dedgar.58.0014FD66_at_fearless.csi.nb.ca> dedgar_at_fearless.csi.nb.ca (Dale Edgar) writes:
>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.
>

Yes it is and I have done it. You can get some examples out of the PRO*C Supplement, page 3-23, Dynamic SQl method three. Suggest you read the samples for methods 1 thru 4.
If you need more infor, e-mail me or post.
>Many Thanks in Advance
>Dale Edgar
>Cybersmith Inc.
>dedgar_at_csi.nb.ca
>
>

-- 
Bruce Arbuckle                                    EMAIL: brucea_at_adcmail.atlas.com
                                                  
Received on Tue Jan 24 1995 - 19:12:08 CET

Original text of this message