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

Re: Odd error on Select statement - answer pointed out



Siri,
  Of course! Duh on my part! You ever have one of those days where the
totally obvious is staring you in the face (gee, it must be a Monday.)
Thanks for your response. Now I'm embarrassed at my stupidity. Well, I guess
we all have those kind of days once in a while, eh? Thanks again.

Cheers,
Glenn

-----Original Message-----
From: Flocke, Siri [mailto:siri@ukans.edu]
Sent: Monday, June 05, 2000 3:50 PM
To: 'sqr-users@list.iex.net'
Cc: 'Glenn.Ackerson@UNCO.EDU'
Subject: RE: Odd error on Select statement


Glenn,

I would guess that you need to prefix your selected columns with the table
alias that you chose, ie

> begin-SELECT on-error=SQL-Error
> SG.SETID
> SG.SAL_ADMIN_PLAN
> SG.GRADE
> SG.EFFDT
> SG.EFF_STATUS
> SG.DESCR
> SG.DESCRSHORT
> SG.SALARY_MATRIX_CD
> SG.RATING_SCALE
> etc.
> FROM PS_SAL_GRADE_TBL SG
> etc.

Hope this helps.

--Siri

Siri J Flocke
Senior Programmer Analyst
The University of Kansas
Computing Services
Lawrence, KS 66045-1546
(785) 864-0246 (ph) ----- (785) 864-0485 (fax)
siri@ukans.edu ----- www.ukans.edu/home/siri




-----Original Message-----
From: Ackerson, Glenn [mailto:Glenn.Ackerson@UNCO.EDU]
Sent: Monday, June 05, 2000 4:44 PM
To: SQR-USERS@list.iex.net
Subject: FW: Odd error on Select statement


> Hi all,
>   I'm having a very odd and frustrating problem with some very basic code
> in an SQR I'm working with and hoped that someone might be able to shed
> light on why this error condition is occurring. As with many SQR's I've
> written before, I have some code that is imbedded within a Select
> statement that is coming back with the error message "(SQR 4407)
> Referenced variables not defined:", followed by the variables within the
> table I'm attempting to process. The SQR interpreter is almost acting as
> if the code is somehow corrupted, but I can't figure out why. Since the
> code is short, I've included it below. What's odd is that I've used this
> same convention in numerous other programs and even within this program
> itself. If any of you can enlighten me as to the cause, I would be most
> grateful. Thanks in advance! On a P.S. note, would you mind CC'ing any
> response to my e-mail address directly? I get messages in Digest Mode, and
> would love to go home having this figured out - it's got me tearing my
> hair out (and I don't have much hair left to tear out!)
>
> Regards,
> Glenn Ackerson
> **************************************************
> Glenn Ackerson
> Information Technology Professional III
> Internet Address: Glenn.Ackerson@Unco.edu
> University of Northern Colorado
> Information Technology
> Carter Hall                  Greeley, CO  80639
>
> The Code follows:
>
> !***********************************************************************
> !***********************************************************************
> ! Procedure : Select-Sal-Grade-Row
> ! Purpose   : Perform a select to see if a row already exists with the
> !           : grade code associated with the jobcode just processed.
> !***********************************************************************
> !***********************************************************************
> begin-procedure Select-Sal-Grade-Row
>
>   let $SQL-STATEMENT = 'SELECT PS_SAL_GRADE_TBL'
>
> begin-SELECT on-error=SQL-Error
> SETID
> SAL_ADMIN_PLAN
> GRADE
> EFFDT
> EFF_STATUS
> DESCR
> DESCRSHORT
> SALARY_MATRIX_CD
> RATING_SCALE
> CURRENCY_CD
> MIN_RT_HOURLY
> MID_RT_HOURLY
> MAX_RT_HOURLY
> MIN_RT_MONTHLY
> MID_RT_MONTHLY
> MAX_RT_MONTHLY
> MIN_RT_ANNUAL
> MID_RT_ANNUAL
> MAX_RT_ANNUAL
> STEP_INCREM_TYPE
> STEP_INCREM_ACCUM
>
>   let $Sal-Grade-Found = 'Y'
>   display ' '
>   display 'Minimum Monthly Salary from file: ' noline
>   display #Min-Monthly-Sal
>   if #Min-Monthly-Sal <> &SG.MIN_RT_MONTHLY
>     display 'Monthly Salary in Input file different than table value...'
>     display 'Minimum Monthly Salary in Sal-Grade-Table: ' noline
>     display &SG.MIN_RT_MONTHLY
>   end-if
>
> FROM PS_SAL_GRADE_TBL SG
> WHERE SG.GRADE = $NewGrade
>   AND SG.EFFDT =
>       (SELECT MAX(EFFDT)
>        FROM   PS_SAL_GRADE_TBL
>        WHERE  GRADE = $NewGrade)
> end-SELECT
> end-procedure
>
>
> And the error message:
>
> (SQR 4407) Referenced variables not defined:
>
>   &sg.min_rt_monthly
>   &sg.min_rt_monthly
>
> Errors were found in the program file.
>
> SQR: Program Aborting.