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

Re: [sqr-users] (SQR 1303) Error in SQL (perhaps missing &name afterexpression)



Hmm.  First suggestion, make sure the "From" starts in the first column with
no spaces/tabs before it.

On Fri, Mar 21, 2008 at 6:57 PM, Marina Piatibratov <marinal@rogers.com>
wrote:

>  Hello,
>
> I ran into the following problem:
> The sqr fails with:
> (SQR 1303) Error in SQL (perhaps missing &name after expression):
> select USERENV('SESSIONID')  From DUAL
> (SQR 1304) Check SELECT columns, expressions and 'where' clause for
> syntax.
>     on
> begin-select
> USERENV('SESSIONID')  &SESSION_ID
>  From DUAL
> end-select
>
> I created test.sqr (see code below) using the fragments from the
> original sqr and asked the users to run it on their side. It failed with
> the same error (see 1.err - for users below) . In my test env it
> completes okay (see 1.err and 1.lis below). Just to note that original
> sqr is running fine in production, the problem happens in the users
> staging db and sqr code has not changed.
>
> Environment is the same (both for users and mine):
> SQR version 4.0.3
> Oracle 9.2.0.4.0
> Windows Server 2003 Standard edition Version 5.2
>
> The command line:
> D:\app\bin\sqr7w test.sqr  <user>/<pswrd>@<server> -s -e1.err -f1.lis ''
> '' '' 'EST' ' 0'
>
> The test.sqr code:
> begin-report
> print 'Test beginning work' (+1,1)
> do  Input
> print 'Test work completed' (+1,1)
> end-report
> !-------------------------------------------------------------------------
> begin-procedure Input
>       input $SORT_ORDER       ' Enter Sort Order '
>       input $p_eng_request__t ' Enter Request  Number '
>       input $p_sequence_no    ' Enter Sequence Number '
>       move  $p_sequence_no    to #p_sequence_no
> let $tmp = 'Sort Order     : '||$sort_order
> print $tmp (+1,1)
> let $tmp = 'Request Number : '||$p_eng_request__t
> print $tmp (+1,1)
> let $tmp = 'Sequence Number: '||to_char(#p_sequence_no)
> print $tmp (+1,1)
>
> begin-select
> USERENV('SESSIONID')  &SESSION_ID
>  From DUAL
> end-select
>
> begin-select
> to_char(AUTO_ALLOC_PROCESS_TYPE) &auto_alloc_process_type
> from STOCK_PARAM
> end-select
>
> let $tmp = 'AUTO_ALLOC_PROCESS_TYPE='||&auto_alloc_process_type
> print $tmp (+1,1)
> end-procedure Input
>
> ==================
>
> Results at the users side (failed with error):
> 1.err :
> (SQR 1303) Error in SQL (perhaps missing &name after expression):
> select USERENV('SESSIONID')  From DUAL
> (SQR 1304) Check SELECT columns, expressions and 'where' clause for
> syntax.
>
> SQR: Program Aborting.
>
> Cursor Status:
>
>  Cursor #1:
>   SQL = select USERENV('SESSIONID')  From DUAL
>  Compiles = 1
>  Executes = 0
>  Rows     = 0
>
>  From SQL Plus from user's db:
> SQL> select USERENV('SESSIONID') from dual;
>
> USERENV('SESSIONID')
> --------------------
>               27731
>
> Results in my test env:
> ================
> 1.err:
> Cursor Status:
>
>  Cursor #1:
>   SQL = select USERENV('SESSIONID')  From DUAL
>  Compiles = 1
>  Executes = 1
>  Rows     = 1
>
>  Cursor #2:
>   SQL = select to_char(AUTO_ALLOC_PROCESS_TYPE)  from STOCK_PARAM
>  Compiles = 1
>  Executes = 1
>  Rows     = 1
>
> 1.lis:
> Test beginning work
> Sort Order     :
> Request Number :
> Sequence Number: 0
> AUTO_ALLOC_PROCESS_TYPE=2
> Test work completed
>
> ====================
> Thanks for your help
> --Marina
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
>



-- 
-----------------------------------------------------------------------
Donald Mellen | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
donm@ontko.com | "In the beginning, there was nothing, which exploded"
(Terry Pratchett)

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