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

[sqr-users] Re: New-report data and report name do not match



On Wed, Dec 14, 2005 at 11:05:25AM -0500, Nathan Stratton Treadway wrote:
> I'm attaching a demo program that shows how the SAVE= variable is not
> updated until *after* the BEFORE= procedure, at least for the first
> record coming out of the database.

Here are the attachments...


                                                Nathan
----------------------------------------------------------------------------
Nathan Stratton Treadway  -  nathanst@ontko.com  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239
! onbreak_example.sqr
! quick demo to show how &table_name and $table_name_save are 
! populated when using ON-BREAK.
! 
! (The program will work in Oracle when run against the database created 
! by the "loadall.sqr" program that comes with SQR in the "samples" 
! directory.)

begin-report
begin-select
table_name () on-break print=never save=$table_name_save 
                       before=before_table_name after=after_table_name
column_name

   print '  within:' (+1,1)
   print &column_name (,15)
   print &table_name (,35)
   print $table_name_save (,50)

from user_tab_columns
  ! pick three tables with just a few columns for the purposes of this demo
where table_name in ('APPTS','CASH_RECEIPTS', 'DEPT')
end-select
end-report

begin-procedure before_table_name
print 'before:' (+2,1)
print &table_name (,35)
print $table_name_save (,50)
end-procedure

begin-procedure after_table_name
print 'after:' (+1,1)
print &table_name (,35)
print $table_name_save (,50)
end-procedure

begin-heading 1
print 'Where' (1,1)
print 'Column' (,15)
print '&table_name' (,35)
print '$table_name_save' (,50)
end-heading
Where         Column              &table_name    $table_name_save


before:                           APPTS
  within:     APPT_NUM            APPTS          APPTS
  within:     EMPNO               APPTS          APPTS
  within:     APPT_TIME           APPTS          APPTS
  within:     APPT_DATE           APPTS          APPTS
  within:     APPOINTMENT         APPTS          APPTS
after:                            CASH_RECEIPTS  APPTS

before:                           CASH_RECEIPTS  CASH_RECEIPTS
  within:     CUST_NUM            CASH_RECEIPTS  CASH_RECEIPTS
  within:     ORDER_NUM           CASH_RECEIPTS  CASH_RECEIPTS
  within:     DATE_RECEIVED       CASH_RECEIPTS  CASH_RECEIPTS
  within:     AMOUNT_RECEIVED     CASH_RECEIPTS  CASH_RECEIPTS
after:                            DEPT           CASH_RECEIPTS

before:                           DEPT           DEPT
  within:     DEPTNO              DEPT           DEPT
  within:     DNAME               DEPT           DEPT
  within:     LOC                 DEPT           DEPT
after:                            DEPT           DEPT

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users