Sitelist is the name of the table.
I use sql commands, the code is in the first post - see below:
UPDATE site_listing SET lic_paid=True,acc=11423,siteno=1423,sitename='Nanaimo',usrint_lic_qty=1,email='nanaimoministorage@shaw.ca',address='2180 S. WELLINGTON ROAD',address1='UNIT 10',city='Nanaimo',countrycode='',phone='250-755-4098',postcode='V9X1V8',state='BC',country='CA',start_date='2025-07-05 17:44:38',exp_date='2025-08-10 00:00:00',install_date='2007-02-11 00:00:00',last_purch_date='2025-07-05 17:44:38',multi_site='N',multi_cid_license='N',controller_sn='384436342D32303131FFFFFFFFFFFFFF',bios_sn_mac='8D64-2011',bios_sn_hd='d8:3a:dd:5f:bd:99',controller_id=150,active='Y',website='www.nanaimoministorage.com',last_license_created='2025-07-05 17:44:38',update_now=True WHERE ( site_listing.siteno = '1423' );
Note the code above was generated by my code plus the use of smartSQL. If I run that sql code outside of xojo it works perfectly. Its only when Xojo executes it that it fails
This is the code that executes:
db.SQLExecute("BEGIN TRANSACTION")
db.SQLexecute(osql.SQL)
dbErrorNo = db.ErrorCode
dbMessage =db.ErrorMessage
If (db.Error= False) then
db.commit
If db.error = True Then
Dim L As New clsLogging
Dim F() As String = Array("EXCEPTION", CurrentMethodName + " " + db.ErrorMessage, "SQL Err" )
L.AddFields F
L.LogFileAppend("", 10)
End If
else
db.RollBack
Dim L As New clsLogging
Dim F() As String = array("EXCEPTION", CurrentMethodName + " " + dbMessage, "SQL Err" )
L.AddFields F
L.LogFileAppend("", 10)
end if
There are no db errors. I’m wondering if there is some disconnect in the xojo postgresql plugin?
Edit If I run this in Xojo replacing db.SQLexecute(osql.SQL) with
db.SQLExecute("UPDATE site_listing SET … which is the same code that works outside of Xojo, it does in fact work.
** So, I think the problem may be in the oSQL** However, that same oSQL object is what created the SQL code i have been showing - which does in fact work…
db.SQLExecute("BEGIN TRANSACTION")
db.SQLExecute("UPDATE site_listing SET lic_paid=True,acc=11423,siteno=1423,sitename='Nanaimo',usrint_lic_qty=1,email='nanaimoministorage@shaw.ca',address='2180 S. WELLINGTON ROAD',address1='UNIT 10',city='Nanaimo',countrycode='',phone='250-755-4098',postcode='V9X1V8',state='BC',country='CA',start_date='2025-07-05 17:44:38',exp_date='2025-08-10 00:00:00',install_date='2007-02-11 00:00:00',last_purch_date='2025-07-05 17:44:38',multi_site='N',multi_cid_license='N',controller_sn='384436342D32303131FFFFFFFFFFFFFF',bios_sn_mac='8D64-2011',bios_sn_hd='d8:3a:dd:5f:bd:99',controller_id=150,active='Y',website='www.nanaimoministorage.com',last_license_created='2025-07-05 17:44:38',update_now=True WHERE ( site_listing.siteno = '1423' );")
//db.SQLexecute(osql.SQL)
.
.
.
Tim