[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Syntax question - how do you continue to the next line on a l oad lookup where clause?



> Hopefully this is an easy syntax question:
<snip>
>     where='EFFDT = (SELECT MAX(A_ED.EFFDT) FROM PS_SUBCUST_Q1_TBL A_ED
WHERE
>       SETID = A_ED.SETID AND SUBCUST_QUAL1 = A_ED.SUBCUST_QUAL1 AND
>       A_ED.EFFDT <= SYSDATE) AND SETID = ''CIS00'''

Whew.  I couldn't trust myself to get that right every time.  I'd be lazy
and code this:
where [$where]

Of course, I'd still have to do the work somewhere.  I'd probably say
something like this further
up in the code, before the main SELECT:
 let $where = 'EFFDT = (SELECT MAX(A_ED.EFFDT) FROM PS_SUBCUST_Q1_TBL A_ED
WHERE '
 let $where = $where || 'SETID = A_ED.SETID AND SUBCUST_QUAL1 =
A_ED.SUBCUST_QUAL1 AND '
 let $where = $where || 'A_ED.EFFDT <= SYSDATE) AND SETID = ' || '''' ||
'CIS00' || ''''

I'm sure this crude example can be surpassed in beauty and style, but it
works and gets me home by 1630hrs.

-Chris