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

Re: [sqr-users] Error message for a beginner



Also, you do not need to declare the variable &A.MERCHANDISE_AMT as SQR creates 
this automatically.  You could code this as:

Begin-Procedure Test
Begin-Select
A.MERCHANDISE_AMT

   Let #TOTAL = #TOTAL +  &A.MERCHANDISE_AMT

FROM SALES A
WHERE A.BUSINESS_UNIT = $BUSINESS_UNIT
AND   A.PO_ID         = $PO_ID
End-Select
End-Procedure




******************************
Larry Roux
Syracuse University
lroux@syr.edu
*******************************

>>> ceprn@hotmail.com 02/24/03 12:27PM >>>
Yes, you forgot a # sign on your variable, but more importantly, you broke 
the caldinal rule that in a select paragraph only valid sql can be in column 
1:

Begin-Procedure Test
Begin-Select
A.MERCHANDISE_AMT &A.MERCHANDISE_AMT
Let #TOTAL = TOTAL +  &A.MERCHANDISE_AMT
FROM SALES A
WHERE A.BUSINESS_UNIT = $BUSINESS_UNIT
  AND A.PO_ID = $PO_ID

End-Select
Begin-Procedure Test

should be

Begin-Procedure Test

Begin-Select

A.MERCHANDISE_AMT &A.MERCHANDISE_AMT

   Let #TOTAL = #TOTAL +  &A.MERCHANDISE_AMT

FROM SALES A
WHERE A.BUSINESS_UNIT = $BUSINESS_UNIT
AND   A.PO_ID         = $PO_ID

End-Select

Begin-Procedure Test

clark 'the dragon' willis
dragon enterprises consulting **available**


PSA: Salary <> Slavery.  If you earn a salary, your employer is renting your 
services for 40 hours a week, not purchasing your soul.  Your time is the 
only real finite asset that you have, and once used it can never be 
recovered, so don't waste it by giving it away.

"Time is the coin of your life. It is the only coin you
have, and only you can determine how it will be spent.
Be careful lest you let other people spend it for you."

Carl Sandburg
(1878 - 1967)


First, assuming you copied your code right out of the sqr, you need to
change:

Let #TOTAL = TOTAL +  &A.MERCHANDISE_AMT

to

Let #TOTAL = #TOTAL +  &A.MERCHANDISE_AMT

and always remember that you can never use the same &variable_name in the 
same sqr.  Even if you try to use it in 2 different procedures.  According 
to the error message you got, I think this is your problem.





I'm learning SQR and was trying to mess around with the syxtax.  These two 
following procedures worked:

Begin-Procedure Test($BUSINESS_UNIT, $PO_ID, :#TOTAL)
begin-select
A.MERCHANDISE_AMT        &A.MERCHANDISE_AMT
    Let #TOTAL = #TOTAL + &A.MERCHANDISE_AMT

FROM SALES A

WHERE A.BUSINESS_UNIT = $BUSINESS_UNIT
       AND A.PO_ID = $PO_ID

end-select


Begin-Procedure Sub-Totals
Do TEST(&A.BUSINESS_UNIT, &A.PO_ID, #TOTAL)
End-Procedure Sub-Totals

***********************************************

And the two below are my version and don't work, in fact, the message was 
popped right after the first procedure.  I would very much for all the help 
I can get.  Thanks.

Begin-Procedure Test
Begin-Select
A.MERCHANDISE_AMT &A.MERCHANDISE_AMT
Let #TOTAL = TOTAL +  &A.MERCHANDISE_AMT
FROM SALES A
WHERE A.BUSINESS_UNIT = $BUSINESS_UNIT
  AND A.PO_ID = $PO_ID

End-Select
Begin-Procedure Test


Begin-Procedure Sub-Totals
Do TEST(&A.BUSINESS_UNIT, &A.PO_ID, #TOTAL)
End-Procedure Sub-Totals
**********************

Error on line 369:
    (SQR 3719) Columns names and expressions must be unique or be given
unique
pseudonyms (&name).
A.MERCHANDISE_AMT &A.MERCHANDISE_AMT

Errors were found in the program file.

SQR for PeopleSoft: Program Aborting.


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users





_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users