Code: Select all
Return SqlPrepareAndExecute(hSql,
"create or replace
function DoNothing
return varchar2
is
begin
-- The cat's apostrophe
-- will cause the following lines
-- to have carriage return
return 'nothing';
end;"
)
Code: Select all
nspsend: 00 00 00 00 FE 40 63 72 |.....@cr|
nspsend: 65 61 74 65 20 6F 72 20 |eate.or.|
nspsend: 72 65 70 6C 61 63 65 20 |replace.|
nspsend: 0A 66 75 6E 63 74 69 6F |.functio|
nspsend: 6E 20 44 6F 4E 6F 74 68 |n.DoNoth|
nspsend: 69 6E 67 20 0A 09 72 65 |ing...re|
nspsend: 74 75 72 6E 20 76 61 72 |turn.var|
nspsend: 63 68 61 72 32 20 20 0A |char2...|
nspsend: 69 73 20 09 20 0A 40 62 |is....@b|
nspsend: 65 67 69 6E 20 20 0A 2D |egin...-|
nspsend: 2D 20 54 68 65 20 63 61 |-.The.ca|
nspsend: 74 27 73 20 61 70 6F 73 |t's.apos|
nspsend: 74 72 6F 70 68 65 0D 0A |trophe..|
nspsend: 2D 2D 20 77 69 6C 6C 20 |--.will.|
nspsend: 63 61 75 73 65 20 74 68 |cause.th|
nspsend: 65 20 66 6F 6C 6C 6F 77 |e.follow|
nspsend: 69 6E 67 20 6C 69 6E 3A |ing.lin:|
nspsend: 65 73 0D 0A 2D 2D 20 74 |es..--.t|
nspsend: 6F 20 68 61 76 65 20 63 |o.have.c|
nspsend: 61 72 72 69 61 67 65 20 |arriage.|
nspsend: 72 65 74 75 72 6E 0D 0A |return..|
nspsend: 09 72 65 74 75 72 6E 20 |.return.|
nspsend: 27 6E 6F 74 68 69 6E 67 |'nothing|
nspsend: 27 3B 20 0D 0A 65 6E 64 |';...end|
Compare this with the following code (also TD 6.3 sp1) which generates a valid Oracle function because I have replaced the apostrophe in the comment with a space. Please note that the TD sqlnet router has stripped out all carriage returns.
Code: Select all
Return SqlPrepareAndExecute(hSql,
"create or replace
function DoNothing
return varchar2
is
begin
-- The cat s apostrophe
-- will cause the following lines
-- to have carriage return
return 'nothing';
end;"
)
Code: Select all
nspsend: 00 00 00 00 FE 40 63 72 |.....@cr|
nspsend: 65 61 74 65 20 6F 72 20 |eate.or.|
nspsend: 72 65 70 6C 61 63 65 20 |replace.|
nspsend: 0A 66 75 6E 63 74 69 6F |.functio|
nspsend: 6E 20 44 6F 4E 6F 74 68 |n.DoNoth|
nspsend: 69 6E 67 20 0A 09 72 65 |ing...re|
nspsend: 74 75 72 6E 20 76 61 72 |turn.var|
nspsend: 63 68 61 72 32 20 20 0A |char2...|
nspsend: 69 73 20 09 20 0A 40 62 |is....@b|
nspsend: 65 67 69 6E 20 20 0A 2D |egin...-|
nspsend: 2D 20 54 68 65 20 63 61 |-.The.ca|
nspsend: 74 20 73 20 61 70 6F 73 |t.s.apos|
nspsend: 74 72 6F 70 68 65 20 0A |trophe..|
nspsend: 2D 2D 20 77 69 6C 6C 20 |--.will.|
nspsend: 63 61 75 73 65 20 74 68 |cause.th|
nspsend: 65 20 66 6F 6C 6C 6F 77 |e.follow|
nspsend: 69 6E 67 20 6C 69 6E 3A |ing.lin:|
nspsend: 65 73 20 0A 2D 2D 20 74 |es..--.t|
nspsend: 6F 20 68 61 76 65 20 63 |o.have.c|
nspsend: 61 72 72 69 61 67 65 20 |arriage.|
nspsend: 72 65 74 75 72 6E 20 0A |return..|
nspsend: 09 72 65 74 75 72 6E 20 |.return.|
nspsend: 27 6E 6F 74 68 69 6E 67 |'nothing|
nspsend: 27 3B 20 20 0A 65 6E 64 |';...end|
Darren