Toad World® Forums

Syncronization issue with quotes in character string


#1

Hello. I am evaluating Toad Data Point 4.3.0.718 (64 bit). I experimented with creating a script that would synchronize some CLOB data across servers.

The resulting script looks like this:

`INSERT INTO “SOME_SCHEMA”.“SOME_TABLE” (“KEY”, “CLOB_FIELD”)
VALUES (‘key_value’, empty_clob());

DECLARE
lobcol CLOB ;
line varchar2(4000);
BEGIN
UPDATE “SOME_SCHEMA”.“SOME_TABLE” SET “CLOB_FIELD” = empty_clob()
WHERE “KEY” = ‘key_value’ returning CLOB_FIELD into lobcol;
dbms_lob.open (lobcol, dbms_lob.lob_readwrite);
line := ‘This clob data contains the user’s text.’;
dbms_lob.write (lobcol, length(line), 1, line);
dbms_lob.close (lobcol);
END;`

Notice the line := statement includes a quote in the value (user’s). It should be double-quoted or else it won’t work when I run the script on the target server.

Instead, I get this error: “ORA-01756: quoted string not properly terminated”

I’ve looked through the forum and the options but couldn’t find any way to make this work.

Is there a way to get the synchronization wizard to prepare the script with double-quotes?

Thank you .


#2

I try use q’[…]’ and it is works.

INSERT INTO “SOME_SCHEMA”.“SOME_TABLE” (“COLUMN_1”)
VALUES (q’[This clob data contains the user’s text.]’);


#3

Thanks Petr.

It worked for me to change the line := statement to

line := q'[This clob data contains the user's text.]';

So is it possible to get the synchronization wizard to do this automatically?

Or do I need to massage the script after it’s generated?


#4

It is impossible add to synchronization wizard for now.

I created task (QAT-13164) for change in synchronization wizard.