Welcome Guest, Not a member yet? Register   Sign In
db2 and apostrophe
#1
Smile 

I´m using Query builder to insert data on DB2 datatable.  The problem is that sometimes data cames with an apostrophe, and the escape character used by insert function is "\", but db2 needs another apostrophe like scape character. Is there any way to solve this using query builder insert?

thanks, Shy
Reply
#2

Which driver are you using?
Also, what is the erroneous query and how do you produce it?
Reply
#3

thanks for answer!!
1. im using pdo
2. the function that i executed is:
$this->db->insert(table, $array); //this array has a value with an apostrophe
And when it try to insert in db throw this error:
ERROR - 25-01-2017 09:27:24 --> Query error: S?bolo \ no v?ido. S?bolos v?idos: ) ,. (SQLPrepare[-104] at /patched-php-src-5.3.6/php-5.3.6/ext/pdo_ibm/ibm_driver.c:140) - Invalid query: INSERT INTO "table" ("col1", "col2", "col3") VALUES ('value1', 'value2', 'exa\' mple ')
Reply




Theme © iAndrew 2016 - Forum software by © MyBB