Re: Date function in PERFORM
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
In article <95152.16003032JMX3X@CMUVM.CSV.CMICH.EDU> AMR E MALIK <32JMX3X@CMUVM.CSV.CMICH.EDU> writes:
>Date: Thu, 1 Jun 1995 16:00:30 EDT
>From: AMR E MALIK <32JMX3X@CMUVM.CSV.CMICH.EDU>
>Subject: Date function in PERFORM
>Hi all!!
>I'm trying to setup a form which should have the ability to capture the
>name of the person who is currently adding/updating the form. We have
>RS/6000 AIX 3.2.4 and Informix SE 5.0. The SQL lets me use the "user"
>function, but when I put it in the "instructions" section it gives
>error saying that "user" is not a field in the table?? I have a column
>in the "member" table which would record the value returned by the "user"
>function. any pointers?
>I know the "today" function works in perform, but "user" doesn't seem to
>I would really appreciate it if someone could give me any pointers on this
>thanks,
>-AMR
>the piece of code giving error:
>instructions
>on editadd editupdate of member
> let f_usr1 = user
>.
>...
>end {** of instructions section **}
>** f_usr1 is the field name and member is the table, f_usr1 points to
>member.lastuser field in the "attributes" section.
Initialize the f_usr1 to "#UPDATED#" (or null or any other special keyword).
Call the sperform from a 4gl progam following by an update statement to update
the lastuser column.
Example
In the form:
...
on editadd editupdate of member
let f_usr1 = "#UPDATED#"
...
In the 4gl program
...
run "sperform <formname>"
update member set lastuser = user
where lastuser = "#UPDATED#"
...
However last time when I used the above method, I am working in a control
environment, the end user have no access to the unix prompt and hence they
cannot run the form directly. It might no applicable to your environment.