|
6#
楼主 |
发表于 2005-4-21 18:47:46
|
只看该作者
SQL语句做为参数值时,单引号如何处理
VuGenerator返回的错误如下:
Action.c(11): lrd_stmt: ERROR, return-code=LRDE2009. select * from t_unicode where f1_sb=''1''
Script:
Action()
{
lrd_init(&InitInfo, DBTypeVersion);
lrd_open_context(&Ctx1, LRD_DBTYPE_ODBC, 0, 0, 0);
lrd_db_option(Ctx1, OT_ODBC_OV_ODBC3, 0, 0);
lrd_open_connection(&Con1, LRD_DBTYPE_ODBC, "", lr_decrypt("42678372e"), "", lr_decrypt("4267837238214a2bdd4968d63f4d05e92b5c89a60a4d7807"
"b148d7ac575daec6e06d4ce6f5b54ca08936e9cc7a815abba11abbc8b8a2"
"b3c54560df952ba9f776b505db7107904e2b44ce5b10"), Ctx1, 1, 0);
lrd_open_cursor(&Csr1, Con1, 0);
lrd_stmt(Csr1, "{NewParam}", -1, 1, 0 /*None*/, 0);
lrd_bind_cols(Csr1, BCInfo_D3, 0);
lrd_fetch(Csr1, 0, 1, 0, PrintRow2, 0);
/*Note: no rows returned by above lrd_fetch*/
lrd_result_set(Csr1, 0, 0, 0);
lrd_close_cursor(&Csr1, 0);
lrd_close_connection(&Con1, 0, 0);
lrd_close_context(&Ctx1, 0, 0);
return 0;
}
参数:
select * from t_unicode where f1_sb='1' |
|