I have the following code in xbasic. Field 1 updates with out a problem
Field 2 gives an error message. I've spent 3 days on this now and need another set of eyes.
Field 2 gives an error message. I've spent 3 days on this now and need another set of eyes.
Code:
if table.isopen("[PathAlias.ADB_Path]\used_inventory") a_tbl = table.get("[PathAlias.ADB_Path]\used_inventory") else a_tbl = table.open("[PathAlias.ADB_Path]\used_inventory") meopen=.T. end if DIM a5_operation_order as C a5_operation_order = "" query.order = a5_operation_order DIM a5_operation_filter as C a5_operation_filter = ".T." query.filter = a5_operation_filter query.options = "I" query.description = "Temporary Query" i_indx = a_tbl.query_create("N") update.fields = 2 update.field1 = "CURRENTLOCATION" update.expr1 = "if(Stock_number>\"\",if(sql_lookup(\"{A5API=MySQL,Server='xx.xx.xx.xx',Port='3306',UserName='xxxx',Password=':xxxx',Database='autocross'}\",\"vehicle_history\",\"Out_date is NULL AND Stock_Number ='\"+Stock_Number+\"'\",\"Current_Location\")>\"\",sql_lookup(\"{A5API=MySQL,Server='xx.xx.xx.xx',Port='3306',UserName='xxxx',Password=':xxxx',Database='autocross'}\",\"vehicle_history\",\"Out_date is NULL AND Stock_Number ='\"+Stock_Number+\"'\",\"Current_Location\"),Store_Location),\"\")" update.field2 = "CURRENT_LOCATION_DATE" update.expr2 = "if(Stock_number>\"\",if(sql_lookup(\"{A5API=MySQL,Server='xx.xx.xx.xx',Port='3306',UserName='xxxx',Password=':xxxx',Database='autocross'}\",\"vehicle_history\",\"Out_date is NULL AND Stock_Number ='\"+Stock_Number+\"'\",\"Current_Location\")>\"\",sql_lookup(\"{A5API=MySQL,Server='xx.xx.xx.xx',Port='3306',UserName='xxxx',Password=':xxxx',Database='autocross'}\",\"vehicle_history\",\"Out_date is NULL AND Stock_Number ='\"+Stock_Number+\"'\",\"Stock_Date\"), Original_Stock_Date),Original_Stock_date)" a_tbl.update()
Comment