By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,586 Members | 2,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,586 IT Pros & Developers. It's quick & easy.

Insert using RRN?

P: 1
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
Share this Question
Share on Google+
1 Reply


P: 12
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.