Subject Re: [firebird-support] Saving text containing hyphens
Author Paul Vinkenoog
Hello Rolf,

> I'm trying to save a sql statement in a VARCHAR column. The
> statement looks something like
> SELECT * FROM ATABLE WHERE ADATE = '18.10.2003';
> How do I save this statement using an INSERT statement?

insert into stmttable ( stmtfield )
values ( 'SELECT * FROM ATABLE WHERE ADATE = ''18.10.2003'';' );

Everytime you specify a string constant in an sql statement, you
must double all the single quotes that are part of the string,
because a "single single quote" will be interpreted as the
end-of-string marker.

By the way, a hyphen is this: - (Bindestrich). Hyphens can be
left as they are in a string constant.


Hope this helps,
Paul Vinkenoog