Subject | Re: [firebird-support] Newlines etc. in string literals |
---|---|
Author | Paul Vinkenoog |
Post date | 2003-08-07T12:19:32Z |
Hi Malte,
you escape ' (single quote) by doubling it.
Inserting newlines etc. in the script itself is ugly and ridiculous,
but it's the only way.
Pascal you can embed special characters in a string like this:
'This string contains'#13#10'a CRLF sequence.'
But in SQL, you can't :-(
Greetings,
Paul Vinkenoog
> I've been trying in vain to find a way to insert a string containingLike you've discovered, there aren't any escape sequences, except that
> newlines into a varchar field with a plain SQL script (it's
> generated, can't use parameters here).
you escape ' (single quote) by doubling it.
Inserting newlines etc. in the script itself is ugly and ridiculous,
but it's the only way.
> I have to admit that I've always disliked how SQL uses it's ownSQL is more Pascal-ish in this respect. With one big difference: in
> conventions instead of those well known from C, shell etc. when it
> comes to special characters ('' instead of \', % instead of *, _
> instead of ?), but oh well...
Pascal you can embed special characters in a string like this:
'This string contains'#13#10'a CRLF sequence.'
But in SQL, you can't :-(
Greetings,
Paul Vinkenoog