2008/12/21 Daniel Espinosa
<esodan gmail com>
Hi all
I'm working in gda_insert_row_into_table but have some troubles:
I'm creating the SQL usin GdaSqlStatement structs, with success but strings are renderer with out quotes ("") can any help me to know how can I do this to work.
I'm adding a GdaSqlExpr to values GList in the GdaSqlStatementInsert, when render the GdaSqlStatement I get:
INTO test (q, number, a) VALUES (NEW TEXT, 1000, NUEVO NOMBRE)
it is an invalid SQL, how can I get quoted strings. This must be
INTO test (q, number, a) VALUES ('NEW TEXT', 1000, 'NUEVO NOMBRE')
for a PostgreSQL database.
It's up to you to add quotes where they are needed (because the GdaSqlStatement is just a tree representation of an SQL statement). Anyway, what you should do is use GdaSqlParamSpec (which are variables or parameters), this will have the following benefits:
* avoid you the job of adding quotes when needed
* avoid any SQL injection problems