Home » U++ Library support » U++ SQL » PostgreSQL example does not save data to database
PostgreSQL example does not save data to database [message #20572] |
Tue, 24 March 2009 05:04  |
rtmex
Messages: 9 Registered: March 2009 Location: Puebla, MEXICO
|
Promising Member |
|
|
Hi, I recreate the PostgreSQL example, just with another table
It works ok, but the data is not saved to the PostgreSQL table when I check it with pgAdmin III.
The table in the database has more fields but I'm just using 3 fields in my code, just to test.
This is my InsertTestData function
bool prueba_Postgres::InsertTestData()
{
Sql sql(m_session);
sql.ClearError();
sql.Begin();
sql * Delete(estacion);
sql * Insert(estacion)
(cve_estacion, 1)
(nombre_estacion, "ESTACION 1")
(siglas, "SIGLAS 1")
;
sql * Insert(estacion)
(cve_estacion, 2)
(nombre_estacion, "RADIO ORO")
(siglas, "XH-ORO")
;
sql * Insert(estacion)
(cve_estacion, 3)
(nombre_estacion, "ESTACION 3")
(siglas, "SIGLAS 3")
;
if(!OkCommit(m_session, "Unable to insert test data."))
return false;
return true;
}
This is my .sch file
TABLE_ (estacion)
INT_ (cve_estacion) PRIMARY_KEY
STRING_ (nombre_estacion, 30) INDEX
STRING_ (siglas, 10)
END_TABLE
Tha SqlArray show the data but the data is not saved to the table in the database
What could by the problem?
Thanks in advance
|
|
|
Goto Forum:
Current Time: Sat Apr 26 18:13:31 CEST 2025
Total time taken to generate the page: 0.02747 seconds
|