Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Help
1_at_1.com wrote:
> Hello!
>
> I am using 8.0.6 Oracle server and would like to insert data into a
> field, the problem is that there are SQL like parameters in the data I
> need to update and it throws everything off. How can I block it out?
>
> For example -
>
> TABLE = A
>
> COLS = 1 2 3
>
> Proposed SQL statement =
>
> insert into A
> values ('DOG' , '50' , '[0000-
> {AFFIL PUT thing,'444'; otherthing,'555';
> =pleasehelp,'Thanks''
> }AFFIL
> ]'
>
Split the string:
insert into A
values ('DOG', '50', '[0000-' || chr(13) || '{AFFIL PUT thing, ''444'';otherthing,''555'';' || chr(13) || '=pleasehelp, ''''Thanks''''' || chr(13)|| '}AFFIL' || chr(13) || ']');
You can't put linefeed directly into string literal, so you need chr(13)
instead. I don't remember if
linefeed has ascii value 13. Be careful though, the ascii value is valid
for ascii charset and its
supersets only. You also need to suplicate any quote you need inside of a
string literal.
>
> How can I add the data into COL 3 without SQL/Oracle thinking some of
> the data is an extension of the query?
>
> Thanks!
Received on Fri Feb 23 2001 - 22:27:38 CST