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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiline inserts

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hello,

i am writing a perl script that genrates an update statement and call sqlplus and updates. i am having a problem. wehn i try to update something that has more than one line sql plus hangs up. for example:


update emp
set description = 'Lance Choad
is a very
good worker'
where name='Choad';



this will send to sqlplus:


update emp
set description = 'Lance Choad


is there any way to make it so it'll read and update the entire block of text includign the newlines?

Thanks a lot,

Lance Choad


 
Add chr(10):

update emp
set description = 'Lance Choad ' || chr(10) ||
'is a very ' || chr(10) ||
'good worker'
where name='Choad'
/

New line character is also a string terminator, so you can not create a multiline string literal in "natural" manner just by adding quotes to multiline text.

BTW, why do you use sql*plus instead of oraperl?
 
I've enver heard of oraperl, so that's why I'm using sqlplus. But, I'll look into oraperl.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top