Imbedding Special Characters in SQL
Posted in 1997
I wonder if anyone can offer some advice. We are creating an application in Visual C++
wihich runs in Windows 3.1\\95 and will be adapted to use Informix 7.0 throught ODBC
(Openlink drivers). We are using the ODBC API, not ESQL.
At present, we are having a heck of a time imbedding cr/lf characters into the quoted
string that is passed to SQLExecDirect().
Consider the following table:
create table mytable (
number integer primary,
name char(20),
comments varchar(20,50)
)
We wish to do the following (in effect):
/////////////////////////////////////////////////
// insert a name with a cr/lf
SQLExecDirect(hstmt,"insert into my.mytable (name) values ("George\\n\\rSmith");
does anyone know of a straightforward technique for doing this? Please reply to
kb6hk@gte.net as well.
..my thanks in advance.