467,202 Members | 1,014 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,202 developers. It's quick & easy.

Insert using RRN?

Is there any way to insert a record as the first record in an existing table, insert using RRN =1? What I'm building are several files to be used by Excel from an iSeries using DB2. I want to add the column headings after I've built the data as I will know the headings based on the system catalog syscolumns for the files I have built. I'm using Views that I build on the fly and all that is wroking fine I just need to figure out how to add the headings at row one so the resulting csv file will he helpful to the staff. Thanks in advance!
Aug 23 '07 #1
  • viewed: 3882
Share:
1 Reply
Is there any way to insert a record as the first record in an existing table, insert using RRN =1? What I'm building are several files to be used by Excel from an iSeries using DB2. I want to add the column headings after I've built the data as I will know the headings based on the system catalog syscolumns for the files I have built. I'm using Views that I build on the fly and all that is wroking fine I just need to figure out how to add the headings at row one so the resulting csv file will he helpful to the staff. Thanks in advance!
The short answer is no. There is no implicit order to rows selected from a DB2 table. You can determine the order in which rows are returned either by an ORDER BY or GROUP BY clause. If you don't care what order your rows are returned in, then you could start your view with a select column_names from SYSIBM.SYSDUMMY1 and connect it to your existing view with a UNION ALL. If your results do need to be returned in a predetermined order, then you could use a similar technique but modify the headings such that they would show up first. You might try a leading space in the column headings. Hope this helps.

Fritz
Aug 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Mark P | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
3 posts views Thread by MP | last post: by
3 posts views Thread by mahajanvit@gmail.com | last post: by
5 posts views Thread by =?Utf-8?B?bXBhaW5l?= | last post: by
2 posts views Thread by =?Utf-8?B?UGhpbGlw?= | last post: by
7 posts views Thread by anu b | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.