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

Re: Questions



The beauty of SQR is that you don't have to directly handle a cursor.  The
Begin-Select takes care of the cursor.  You nest Begin-Selects by inserting
a Do <procedure name>.  In the next procedure you have another
Begin-Select. Assuming that the previous day's value and the previous two
day's value are selectable from the database, you just pass those values to
another variable and print them. Here's a brief example of how to get the
data.

Begin-Procedure Get-First-Value
Begin-Select
Value
     let $First_value = &Value
     Do Get-Second-Value
     Do Get-Third-Value
     Do Print-Values
from table
where date = today
End-Select
End-Procedure Get-First-Value

Begin-Procedure Get-Second-Value
Begin-Select
Value
     let $Second_value = &Value
from table
where date = yesterday
End-Select
End-Procedure Get-Second-Value

Begin-Procedure Get-Third-Value
Begin-Select
Value
     let $Third_value = &Value

from table
where date = day before yesterday
End-Select
End-Procedure Get-Third-Value

Hope this helps