September 25, 2007, 03:09 AM
<Navin>Question in TABLE HEADERS
Hi all,
Is that possible to get a sql column as a table header in a report
****************************************
SQL SQLORA
SELECT 'ABC' A , 'DEF' B FROM DUAL;
TABLE FILE SQLOUT
PRINT
A AS B
END
**********************************
My output should be like ,
DEF
ABC
not like
B
ABC
Thanks
Naveen.
WF 7.1.6
September 25, 2007, 10:44 AM
TexasStingrayNavin, If B is always the same you could do something like this
SQL SQLORA
SELECT 'ABC' A , 'DEF' B FROM DUAL;
TABLE FILE SQLOUT
PRINT
A
B
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &A.xx. &B.xx.
-* Fill in the xx's with the correct field length.
TABLE FILE HOLD1
PRINT A AS '&B'
END
This will only work if the title of B does not change. And a bigger concern is not you have to process the result set twice. A better option is just to do the SQL and -READ against 1 recordset and then plug in your sql and table file SQLOUT and set the as to &B. Just some words for thought seeing how no one else responded to your question.