OOPS! CORRECTION!
SELECT 'INSERT INTO TEST2 VALUES (' || '''' || text1 || ''')' || ';' || CHR(10) || 'COMMIT;'
FROM TEST2;
OR
SELECT 'INSERT INTO TEST2 VALUES (' || '''' || text1 || ''');' || CHR(10) || 'COMMIT;'
FROM TEST2;
-----Original Message-----
From: Edwards Ed
[mailto:db2udbdba-ezmlmshield-x60633611.[Email address protected]
Sent: Tuesday, May 30, 2006 11:52 AM
To: LazyDBA Discussion
Subject: RE: DB2 Code - Output a Semicolon
To All,
I am running DB2 version 8.2 on a Windows XP pc. Check out the code below.
SELECT 'INSERT INTO TEST2 VALUES (' || '''' || text1 || ''')' || ';' || CHR(10) || 'COMMIT';
FROM TEST2;
OR
SELECT 'INSERT INTO TEST2 VALUES (' || '''' || text1 || ''');' || CHR(10) || 'COMMIT';
FROM TEST2;
-----Original Message-----
From: Edwards Ed
[mailto:db2udbdba-ezmlmshield-x29705935.[Email address protected]
Sent: Tuesday, May 30, 2006 11:38 AM
To: LazyDBA Discussion
Subject: RE: DB2 Code - Output a Semicolon
To All,
This is the final answer.
select 'insert into test2 values (' || '''' || text1 || ''');' from test2;
Jagdish S. Rawat, thanks for the info!
Have a great Day!
-----Original Message-----
From: Edwards Ed
[mailto:db2udbdba-ezmlmshield-x95922812.[Email address protected]
Sent: Tuesday, May 30, 2006 9:38 AM
To: LazyDBA Discussion
Subject: DB2 Code - Output a Semicolon
To All,
How do you output a semicolon (;) in DB2 in the following code below (see select statement below)? Thanks.
create table test2 (text1 varchar(10));
insert into test2 values(',,,,,,');
commit;
insert into test2 values('aaaaa');
commit;
insert into test2 values('AAAAA');
commit;
insert into test2 values('AAbb');
commit;
insert into test2 values('bbAA');
commit;
insert into test2 values('12345');
commit;
insert into test2 values('1');
commit;
select 'insert into test2 values (' || '''' || text1 || ''')'
from test2;
Please take a few minutes to provide feedback on the quality of service you received. The Department of Education values your feedback as a customer. Commissioner John L. Winn is committed to continuously assessing and improving the level and quality of services provided to you by Department staff. Simply use the link below. Thank you in advance for completing the survey.
http://data.fldoe.org/cs/default.cfm?staff=Ed.[Email address protected]
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page