I am running it as part of a prep stmt
// sql
String custsql;
custsql = "IF NOT EXISTS (select mobile_number FROM tblCustomer WHERE mobile_number = 'nParam' AND op_id = 'opParam' ) BEGIN INSERT INTO tblCustomer (mobile_number, op_id) VALUES (nParam,opParam) END";
String transsql;
transsql = "INSERT INTO tblTransaction (mobile_number, service_id, text_trigger, sms_sent, sms_received) VALUES (?,?,?,?,?)";
custps = con.prepareStatement(custsql);
custstmt = con.createStatement();
transps = con.prepareStatement(transsql);
transstmt = con.createStatement();
// inserting records
if(proceed) {
custps.setString(1, nParam);
custps.setString(2, opParam);
custps.executeUpdate();
transps.setString(1, nParam);
transps.setString(2, osidParam);
transps.setString(3, tParam);
transps.setString(4, sentParam);
transps.setString(5, receivedParam);
transps.executeUpdate();
Many thanks
Yes I have tried that also.
No joy there.
I'm using a prepared statement in a Java servlet.
I think it is something to do with the insertion of nParam and opParam vraiables. I'm not sure the sytnax is correct.
Cheers
Chris