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

Re: Select ALL



Here is a proc I use to build a column list, modify it for your purposes:

begin-procedure Build-Columns($recname, :#fldcount, :$Col_List)
let $Col_List = ' '

begin-select
A.FIELDNAME &a.fieldname,
A.SUBRECORD &a.subrecord,
A.FIELDNUM &a.fieldnum,
B.FIELDTYPE &a.fieldtype,
B.LENGTH &a.length,
B.DECIMALPOS &a.decimalpos

    let $Col_List = $Col_List || &a.FIELDNAME || ' ,'
    if &a.subrecord = 'Y'
        let $subrecfound = &a.subrecord
    end-if
    let #rowcnt = &a.fieldnum
    put &a.fieldnum $recname &a.fieldname &a.fieldtype &a.decimalpos
$Key_Found into STAGE_RECORD_LAYOUT(#rowcnt)

FROM
PSRECFIELD A,
PSDBFIELD B

WHERE
A.RECNAME = $recname and
B.FIELDNAME = A.FIELDNAME
end-select

let #fldcount = &a.fieldnum
let $Col_List = rtrim($Col_List, ',')
SHOW ' $Col_List : ' $Col_List

end-procedure Build-Columns


Allen Cunningham
Sonoma State University
allen.cunningham@sonoma.edu



-----Original Message-----
From: Discussion of SQR, Brio Software's database reporting language
[mailto:SQR-USERS@list.iex.net]On Behalf Of Brickl, Maria
Sent: Wednesday, March 27, 2002 12:34 PM
To: SQR-USERS@list.iex.net
Subject: Select ALL


Is there any way in SQR to select all fields in a table rather than listing
each field out on it's own line in the BEGIN-SELECT statement?

Also does anyone know if you can insert spaces for values for a bunch of
fields that are right next to each other. Right now I enter Let <fieldname>
= ' ' for about 20 different fields that are all in order. So my code gets
very long.

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Maria K Brickl
Information Systems Programmer/Analyst
University of Wisconsin Colleges
780 Regent St, PO Box 8680, Madison, WI  53708-8680
Phone: 608.265.2677 / Fax: 608.265.5770
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*