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

Re: Load Lookup



Hi Ed

It Worked Plus sign , great help.

Thankyou so much

Sanjay P



> ----------
> From:         Ed Kelly[SMTP:ed_kelly@HOTMAIL.COM]
> Sent:         Thursday, May 11, 2000 10:25 AM
> To:   SQR-USERS@list.iex.net
> Subject:      Re: Load Lookup
>
> The problem is probaby in the way that you are trying to retrieve the
> successive columns.  Unfortunately, you did not show your code example for
> that.  If you want the return value to include data from more than one
> column, you will have to concatenate those columns together.  You must use
> your Database's concatenation symbol.  Sybase and SQL Server use the PLUS
> sign (+) for the concatenation symbol.  DB/2, Oracle, Informix and SQLBase
> use two vertical bars or piping symbols (||).
>
> Example:
>     RETURN_VALUE='ET.DESCR + ET.DESCRSHORT'    ! Sybase/SQL Server
> or
>     RETURN_VALUE='ET.DESCR || ET.DESCRSHORT'   ! All Other databases
>
> Hope this helps.
> Ed Kelly
>
> I have load lookup defined as below. It works fine
> > > if I have to get a
> > > return_value of single column,
> > > But if I have more than one column it errors out.
> > >
> > > Any suggestions for improvement
> > >
> > > LOAD LOOKUP CODE
> > >
> > > LET $LOAD_WHERE = 'ET.EFFDT <='
> > > LET $LOAD_WHERE = $LOAD_WHERE ||''''|| $AsOfDate ||
> > > '''' ||' AND
> > >                               ET.EFFDT  = (SELECT
> > > MAX(EFFDT)
> > >                                              FROM
> > > PS_EARNINGS_TBL'
> > >                                             || '
> > > WHERE  ERNCD  = ET.ERNCD
> > >                                               AND
> > > EFFDT <= '
> > > LET $LOAD_WHERE = $LOAD_WHERE ||''''|| $AsOfDate ||
> > > ''')'
> > >
> > > load-lookup name=EAR_NAME
> > >             rows=500
> > >             table='PS_EARNINGS_TBL ET'
> > >             key=ET.ERNCD
> > >             return_value=ET.DESCR
> > >             where=$LOAD_where
> > >
> > >
> > > ERROR MESSAGES ********
> > >
> > > (SQR 1303) Error in SQL (perhaps missing &name after
> > > expression):
> > > select distinct ET.ERNCD, ET.DESCR ,ET.DESCRSHORT
> > > from PS_EARNINGS_TBL ET
> > > where ET.EFFDT <='2000-04-30' AND ET.EFFDT  =
> > > (SELECT MAX(EFFDT) FROM
> > > PS_EARNINGS_TBL WHERE  ERNCD  = ET.ERNCD AND  EFFDT
> > > <= '2000-04-30')
> > > (SQR 1304) Check SELECT columns, expressions and
> > > 'where' clause for syntax.
> > >
> > > SQR: Program Aborting.
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>