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

[sqr-users] Dynamicly selecting columns



Hallo Sqr gurus,

I have some questions about the following:

I have a file layout containing several records. In my sqr I want to select
dynamicly which records are involved and which records form the File Layout.
I have read in the sqr documentation that it is possible to dynamicly select
one column, but my record defenition consist of several fields. I can't get
it work for more fields. Look at the following code:

begin-procedure get-records

  let $comma = ','

begin-select
FLDSEGNAME

   let $segname = &FLDSEGNAME
   
   let $recname = 'PS_' || $segname
 
   do get-fields
 
FROM PSFLDSEGDEFN
WHERE FLDDEFNNAME = 'PERSON_STG'
end-select

end-procedure !get-records

begin-procedure get-fields

begin-select
FLDFIELDNAME
   let $fieldname = rtrim(ltrim(&FLDFIELDNAME,' '),' ')


   string  $column $fieldname $comma by  '' into  $column

     do select-data

from psfldfielddefn
where flddefnname = 'MVD_PERSON_STG'
and fldsegname = $segname
order by fldseqno
end-select

end-procedure !get-fields


begin-procedure select-data
begin-select

[$column]

from [$TABLE.FLDSEGNAME]
where blabla

end-select
end-procedure

Can anybody help me with this.

Regards,
Redouan


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users