cancel
Showing results for 
Search instead for 
Did you mean: 

DbHandle Update SQL Query not working

tejasjani
Advisor
Advisor
0 Kudos

Hi Experts,

I am trying to update a collection's field from a script to a certain value using SQL query with the code below :

Code:

----------------------------------------------------------------------------------

if(supp_regi.equals("N"))

{

temp_email = email_from.replaceAll("[^\\p{Alpha}\\p{Digit}]+","");

dbHandle = session.getDbHandle();

dbHandle.beginTransaction();

temp_r = "R";

mySQL = "UPDATE FCI_DYN_$2147483246 SET Z_SUPP_NAME = 'AK' where Z_SUPP_SC= 'myemailgmailcom'";

dbHandle.executeUpdate(mySQL);

dbHandle.endTransaction();

}

----------------------------------------------------------------------------------

I want this code to update field Z_SUPP_NAME with value AK in extension collection table (FCI_DYN_$2147483246) for the entry where field Z_SUPP_SC's value is myemailgmailcom (this will be a unique entry as per the business scenario_).

This query does not give any error in log but still does not update the required field.

Any helpful inputs please?

Thanks

Tejas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can you put some logging into the code so we can output what is being captured and what is not.

Something like this:

logInfo(MySQL, temp_r);

Also if you could manage to capture the status of the execute Update and the field you're trying to update that would prove very helpful in debugging this.

Thanks,

tejasjani
Advisor
Advisor
0 Kudos

Resolved.

The field that I need to SET, I needed to pass as where clause parameter too.

Answers (0)