[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Global VS parameter list
- Subject: RE: [sqr-users] Global VS parameter list
- From: "Alexander, Steve" <Steven.Alexander@sanjoseca.gov>
- Date: Fri, 30 Apr 2004 12:44:26 -0700
- Delivery-date: Fri, 30 Apr 2004 14:47:13 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
When you have a procedure with parameters, it is a "local" procedure. If
you want to use variables from other parts of the program, you have to put
an underscore in their second position: Global variable $xyz is available
as $_xyz. Global database column &abc is available as &_abc. As James
says, you don't have to do this for arrays because arrays are never local.
Therefore you don't have to distinguish between an array that just exists
within one procedure (because there's no such thing) and an array which is
accessible everywhere (because they all are).
-----Original Message-----
From: James Womeldorf [mailto:jwomeldo@fastenal.com]
Sent: Friday, April 30, 2004 12:22 PM
To: 'This list is for discussion about the SQR database reporting
languagef rom Hyperion Solutions.'
Subject: RE: [sqr-users] Global VS parameter list
Hi Nicholas,
All arrays in SQR are global by nature and are referred to in exactly the
same way regardless of whether you are accessing them from a global or local
procedure, so that should work for you.
Jim Womeldorf
-----Original Message-----
From: Chu, Nicholas [mailto:Nicholas.Chu@RedPrairie.com]
Sent: Friday, April 30, 2004 2:06 PM
To: 'sqr-users@sqrug.org'
Subject: [sqr-users] Global VS parameter list
> Hi,
>
> I am supposed to modify an SQR report by adding a procedure to it.
> When I add my procedure I passed in a couple of parameters and 1 as return
> parameter.
> Within that procedure I am also referencing some field variables that I
> retrieved earlier.
>
> However it errored out and complained that the &xxxxx variables that I'm
> referencing are not declared.
> Later I found out that I have to put those variables that I want to use in
> the parameter list of the procedure to make it work.
>
> For example:
>
> begin-report
> let $aa = 'A'
> let $bb = 'B'
> do sel
> do main($aa,$bb)
> end-report
>
> begin-procedure sel
> begin-select
> 'TESTING' &dummy
> from dual
> end-select
> end-procedure
>
> begin-procedure main($in_aa,$in_bb)
> print $in_aa (1,1)
> print $in_bb (+1,1)
> print &dummy (+1,1)
> end-procedure
>
>
>
> When you run it:
>
>
>
> SQR V6.1.4
> Copyright (C) Brio Technology 1994-2000. All Worldwide Rights Reserved.
>
> (SQR 4407) Referenced variables not defined:
>
> &dummy (local)
>
> Errors were found in the program file.
>
>
>
>
> This is the version that runs:
>
> begin-report
> let $aa = 'A'
> let $bb = 'B'
> do sel($dummy)
> do main($aa,$bb,$dummy)
> end-report
>
> begin-procedure sel(:$ret_dummy)
> begin-select
> 'TESTING' &dummy
> from dual
> end-select
>
> let $ret_dummy = &dummy
> end-procedure
>
> begin-procedure main($in_aa,$in_bb,$in_dummy)
> print $in_aa (1,1)
> print $in_bb (+1,1)
> print $in_dummy (+1,1)
> end-procedure
>
>
>
>
>
> Is there any way to get around?
>
> What if I have an array to reference? Can I pass it in as a parameter
> list?
>
>
> Many thanks!!
> Nicholas
_______________________________________________
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
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users