Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SqlPerformScript bug: Not doing anything if script starts with "BEGIN;" and ends with "END;"
Re: SqlPerformScript bug: Not doing anything if script starts with "BEGIN;" and ends with "END;" [message #60211 is a reply to message #60208] Fri, 13 October 2023 11:02 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
Well, the problem is that SqlPerformScript is primary dedicated to DDL and must support creation of triggers:

https://www.sqlite.org/lang_createtrigger.html

Unfortunately, with most SQLs, you have to send trigger body as single statement (that probably includes Sqlite3 as well). Thus we need to detect BEGIN/END and supress sending after ';' until END is reached, then send the whole thing at once. That is the reason for the 'level' variable.

I am not sure how to solve your problem frankly. I would be happy with 'do not use SqlPerformScript for transactions' note in docs, but if you have any suggestions... But I do not want to overcomplicate SqlPerformScript by e.g. detecting whether the BEGIN is function body or start of transactions, that would be hardly manageable, which means chances are slim...

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: Sqlite encryption
Next Topic: PostgreSql does not handle BOOL correctly
Goto Forum:
  


Current Time: Sun Jun 02 06:55:15 CEST 2024

Total time taken to generate the page: 0.01060 seconds