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.

Another point:

I have the Idea to make this functions to use a GdaBatch object, in order to
allow any one to add more SQL commands to it (may be calling Gda Easy
functions multiple times) and then execute then at once.

If all agree I can change this functions:

gboolean gda_prepare_insert_row_into_table (Gda Connection *cnc, GdaBatch
*batch, const gchar *table, GdaSet *last_inserted_row, GError *error, ...);

If batch is NULL this function execute the insert command, if not, add the
result of calculate the corresponding GdaStatement to GdaBatch without
execute it.

gboolean gda_execute_batch (GdaConnection *cnc, GdaBatch *batch, GError
*error);

As a convenience function of the gda_connection_batch_execute.

This coul apply for the rest of Gda Easy functions to implement.

Comments?


2008/12/18 Vivien Malerba <[email protected]>

>
>
> 2008/12/18 Daniel Espinosa <[email protected]>
>
> After see at gda-easy.c/.h files I found that gda_insert_row_into_table y
>> gda_insert_row_into_table_from_string aren't implemented, then I plant to
>> hack on them, but found that this funtions doesn't allow to get back the
>> values inserted for the new row like in
>>
>> gda_connection_statement_execute 
>> <http://library.gnome.org/devel/libgda/3.99/GdaConnection.html#gda-connection-statement-execute>
>>
>> does using its *last_inserted_row* paramenter, then I propouse to make an
>> API break in order to add an *last_inserted* parameter for both functions:
>>
>> gboolean 
>> <http://library.gnome.org/devel/glib/stable/glib-Basic-Types.html#gboolean>  
>>           gda_insert_row_into_table           (GdaConnection 
>> <http://library.gnome.org/devel/libgda/3.99/GdaConnection.html> *cnc,
>>
>>
>>                                                          const gchar 
>> <http://library.gnome.org/devel/glib/stable/glib-Basic-Types.html#gchar> 
>> *table_name,
>>                                                          GdaSet 
>> **last_inserted_row,
>>
>>
>>                                                          GError 
>> <http://library.gnome.org/devel/glib/stable/glib-Error-Reporting.html#GError>
>>  **error,
>>                                                          ...);
>>
>>
>> gboolean 
>> <http://library.gnome.org/devel/glib/stable/glib-Basic-Types.html#gboolean>  
>>           gda_insert_row_into_table_from_string
>>                                                         (GdaConnection 
>> <http://library.gnome.org/devel/libgda/3.99/GdaConnection.html> *cnc,
>>
>>
>>                                                          const gchar 
>> <http://library.gnome.org/devel/glib/stable/glib-Basic-Types.html#gchar> 
>> *table_name,
>>                                                          GdaSet 
>> **last_inserted_row
>>
>>
>>                                                          GError 
>> <http://library.gnome.org/devel/glib/stable/glib-Error-Reporting.html#GError>
>>  **error,
>>                                                          ...);
>>
>> Ok,  go for it!
>
> Tell me when you have a patch!
>
> Vivien
>
>


-- 
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (en trámite, pero para los cuates:
LIBRE)
_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list

Reply via email to