Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output from a variable table

Status
Not open for further replies.

grinder182533

Programmer
Oct 11, 2006
2
0
0
GB
I have a table defined as follows :

F1 key 3 chars
F2 numb 1 number
F3 text 10 chars

So I could have data as follows :
AAA1aaaaaaaaa1
BBB1bbbbbbbbb1
BBB2bbbbbbbbb2
CCC1ccccccccc1
DDD1ddddddddd1
DDD2ddddddddd2
DDD3ddddddddd3

I need to write a SyBase script to output as follows :-
AAA
1
aaaaaaaaa1
{page throw}
BBB
1
bbbbbbbbb1
2
bbbbbbbbb2
{page throw}
CCC
1
ccccccccc1
{page throw}
DDD
1
ddddddddd1
2
ddddddddd2
3
ddddddddd3
{page throw}
{end of file}

I have only done simple selects up till now.

Any help greatly appreciated
Many thanks
 

Try something like:
Code:
SELECT SUBSTR(data,1,3)||CHR(10)
     ||SUBSTR(data,4,1)||CHR(10)
     ||SUBSTR(data(5)||CHR(10)
     ||'{page throw}'||CHR(10)
  FROM MyTable;
SELECT '{end of file}';

[3eyes]


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top