amr2027
29th November 2013, 21:11
Hello All.
I'm working on Qt 4.8-Postgresql application,I'm Using the following code to delete a database record the code works perfect, but if there is a data related to that table in another table an error 23503 raised till now everything is ok. Now if I delete the data related in the other table and execute the same code again to delete the same record an error 42601 raised indicating syntax error at or near "("
LINE 1: EXECUTE (77831, '30'). What could be the reason.
QSqlQuery query ;
query.prepare("DELETE FROM purchasing.invoice WHERE OID=:Oid AND invoice_id=:invoice_id ") ;
query.bindValue(":Oid" , Oid);
query.bindValue(":invoice_id" , ui->invoice_id->text() );
query.exec();
Thank you in advance for your help.
I'm working on Qt 4.8-Postgresql application,I'm Using the following code to delete a database record the code works perfect, but if there is a data related to that table in another table an error 23503 raised till now everything is ok. Now if I delete the data related in the other table and execute the same code again to delete the same record an error 42601 raised indicating syntax error at or near "("
LINE 1: EXECUTE (77831, '30'). What could be the reason.
QSqlQuery query ;
query.prepare("DELETE FROM purchasing.invoice WHERE OID=:Oid AND invoice_id=:invoice_id ") ;
query.bindValue(":Oid" , Oid);
query.bindValue(":invoice_id" , ui->invoice_id->text() );
query.exec();
Thank you in advance for your help.