• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Informix not escape column and table name

#1
Hi all,
Is there any way to avoid escaping column and table names in Informix driver?
For example, if I make an insert call with this params:

PHP Code:
$values = array(
 
 "field_1" => "value_1",
 
"field_2" => "value_2"
);

$this->db->insert("my_table"$values);

//It produces
//INSERT INTO "my_table" ("field_1", "field_2") VALUES ("value_1", "value_2") 

But Informix ODBC driver throw a fatal error like this
PHP Code:
[Informix][Informix ODBC Driver][Informix]A syntax error has occurred
Because INFORMIX column and table names must set without quotes. Right statement should be:
PHP Code:
INSERT INTO my_table (field_1field_2VALUES ("value_1""value_2"

Note: I've tried to set
PHP Code:
$this->_escape_char ''
in the __construct() of
Code:
/system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
But this hack don't add quotes to values, so it's not useful.

Thanks in advance.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.