Subject Re: [firebird-support] Newlines etc. in string literals
Author Paul Vinkenoog
Hi Malte,

> I've been trying in vain to find a way to insert a string containing
> newlines into a varchar field with a plain SQL script (it's
> generated, can't use parameters here).

Like you've discovered, there aren't any escape sequences, except that
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 own
> 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...

SQL is more Pascal-ish in this respect. With one big difference: in
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 :-(

Paul Vinkenoog