Hi.
I’m using ROOT (ROOT 5.34.34) classes to work with our PostgreSQL database.
My table includes ‘timestamp’ column with possible NULL values.
But when I set NULL value for this column by TSQLStatement::SetNull function in order to create new row, ROOT gives me an error:
Error in TPgSQLStatement::Process: Code: 7 Msg: ERROR: invalid input syntax for type timestamp: ""
The small sample cut of my code is below to clear this situation:
TSQLStatement* stmt = mySQLServer->Statement("insert into my_table(my_date) values ($1)");
stmt->NextIteration();
stmt->SetDatime(0, myDate); // tried with and without this line
stmt->SetNull(0);
stmt->Process();
Does SetNull(Int_t) function work incorrect for ‘datetime’ columns?