Lexical references [message #8000] |
Mon, 21 July 2003 15:53 |
George B
Messages: 28 Registered: November 2002
|
Junior Member |
|
|
I have a lexical reference in my select statement as
&AND_APPL_IDN
In my Before Report trigger this lexical reference is shown as follows:
If (:P_APPL_IDN is not NULL)
then
:AND_APPL_IDN := 'a.applicant_idn = ' || TO_CHAR(:P_APPL_IDN);
else
:AND_APPL_IDN := 'a.applicant_idn LIKE' || '''%''';
End IF;
where :P_APPL_IDN is the parameter to accept a single entry for the applicant id and a.applicant_idn is the database column.
Question: I want to be able to accept a single entry and also mulitple entries in the parameter :P_APPL_IDN (no limit and delimted by commas). Is it possible to avoid quotes (') when entering data?
eg: 123 (applicant_idn)
eg: 321,658,9178,61102,568472(different applicant_idns)
Thank you for any advise....
|
|
|
Re: Lexical references [message #8025 is a reply to message #8000] |
Tue, 22 July 2003 10:54 |
Ali
Messages: 88 Registered: March 2000
|
Member |
|
|
i think use ' in before report trigger like
If (:P_APPL_IDN is not NULL)
then
:AND_APPL_IDN := 'a.applicant_idn = ' ||''''|| TO_CHAR(:P_APPL_IDN)||'''';
else
:AND_APPL_IDN := 'a.applicant_idn LIKE' || '''%''';
End IF;
i m not sure but anyway try this out.
|
|
|
Re: Lexical references [message #8026 is a reply to message #8025] |
Tue, 22 July 2003 12:45 |
George B
Messages: 28 Registered: November 2002
|
Junior Member |
|
|
It will only work with one entry. Once I have mulitple entries separated by commas, or multiple entries delimted by commas and enclosed in quotes, I get a compile error "too many declarations in TO_CHAR to match this call"
Remember that a user can either have just one entry or multiple entries for applicant_idn
|
|
|