PDA

View Full Version : update query don't work



Khalifa
28th January 2016, 09:11
I have a problem withe the query :


MyActionQuery->prepare("UPDATE Ahmed.creditor SET crebalance = '"+AmeelNewbal+"' where CRECODE = '"+ZoalCode+"'");


it gave me the error :

D:\KhalidQtAppllns\Applications\IsamSales\LOVdialo g.cpp:121: error: invalid operands of types 'const char [41]' and 'double' to binary 'operator+'

MyActionQuery->prepare("UPDATE Ahmed.creditor SET crebalance = '"+AmeelNewbal+"' where CRECODE = '"+ZoalCode+"'");
^
crebalance is a table field of type number, AmeelNewbal is a double variable, ZoalCode is a variable of type char and crecode is a primary key of type char

I'm connecting with Oracle 11g

Can any one help me about it ...!!!!

Thank You in advance ...

Lesiok
28th January 2016, 10:02
1. This have nothing with SQL - this is a problem with string operator + (as compiler said).
2. Please read about QSqlQuery::prepare and use placeholders.