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

Re: [sqr-users] Dynamic sql field problem on UNIX server



Hello,
See if the following sample code:
input $Order_By   'Enter Y - Empl Name Order, N - Employer,Empl Name
Order '
Evaluate $Order_by
    when= 'Y'
    let $Order_by ='order by c.name'
    break
    when='N'
    let $Order_By = 'order by d.address1,c.name'
    break
   End-evaluate

Select section will be as follows:
where a.class_nbr = #ClassNbr           
    AND b.item_amt >0
[$order_by]

Hope this helps
Prasanna

"Bambach, Tom" wrote:
> 
> I am running SQR v4.3.4 for PeopleSoft v7.0 (ORACLE) and v7.5 (ORACLE and
> MS)...
> 
> When my code looks like below, it works fine in all
> environments:
> 
> begin-select
> 
> X.BUSINESS_UNIT                     &Xbusiness_unit
> X.VOUCHER_ID                        &Xvoucher_id
> X.DUE_DT                            &Xdue_dt=date
> X.SCHEDULED_PAY_DT                  &Xscheduled_pay_dt=date
> X.REMIT_VENDOR                      &Xremit_vendor
> V.INVOICE_ID                        &Vinvoice_id
> V.INVOICE_DT                        &Vinvoice_dt=date
> V1.WTHD_SW                          &V1wthd_sw
> 
>  let $Xbusiness_unit = &Xbusiness_unit
>  let $Xvoucher_id = &Xvoucher_id
>  let $Xdue_dt = &Xdue_dt
>  let $Xscheduled_pay_dt = &Xscheduled_pay_dt
>  let $Xremit_vendor = &Xremit_vendor
>  let $Vinvoice_id = &Vinvoice_id
>  let $Vinvoice_dt = &Vinvoice_dt
>  let $V1wthd_sw = &V1wthd_sw
> 
>  let #upd_ctr = #upd_ctr + 1
>  if $V1wthd_sw = 'Y'
>   let #upd_ctr_wthd = #upd_ctr_wthd + 1
>  end-if
>  if $run_mode = 'U'
>   if $V1wthd_sw = 'Y'
>    do update-tables-wthd
>   else
>    do update-tables
>   end-if
>  end-if
> 
>  do write-file
> 
> FROM PS_PYMNT_VCHR_XREF X, PS_VOUCHER V, PS_VENDOR V1
> WHERE X.BUSINESS_UNIT NOT IN ('GNTCC','GNTCU')
>  AND X.PYMNT_SELCT_STATUS IN ('D','N','R')
>  AND X.PYMNT_MESSAGE NOT LIKE 'GCC%'
>  AND X.BUSINESS_UNIT=V.BUSINESS_UNIT
>  AND X.VOUCHER_ID=V.VOUCHER_ID
>  AND V.INVOICE_DT<$pet_dt_plus1
>  AND V.OPRID='INTRFC'
>  AND X.REMIT_SETID=V1.SETID
>  AND X.REMIT_VENDOR=V1.VENDOR_ID
> 
> end-select
> 
> ===========================================================
> 
> But if I use dynamic field definition
> 
> if $db_name <> 'EPPROD'
>  !all databases except EPPROD are v7.5
>  let $wthdx = 'V1.WTHD_SW '
> else
>  !EPPROD is v7.0
>  let $wthdx = 'V1.M1099_SW '
> end-if
> 
> then use it in the above select
> [$wthdx]                            &V1wthd_sw=char
> 
> instead of
> V1.WTHD_SW                          &V1wthd_sw
> 
> When I run on the Server (UNIX), I get the following
> error message:
> 
> prcs_sqr[271]: 19632 Memory fault(coredump)
> prcs_sqr: ------------------- Error -------------------
> prcs_sqr: Command failure
> prcs_sqr: SQR Command Terminated abnormally
> prcs_sqr: Return code : 139
> prcs_sqr: ------------------- Error -------------------
> 
> However, if I run on the client with the [$wthdx]...   code
> (either from a PeopleSoft panel or directly on the desktop),
> it works fine...
> 
> What's going on?
> 
> Thanks.
> 
> Tom Bambach
> 
> _______________________________________________
> 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