I am working in LiveCode and am using V4REV 8.3.3.
I have been using the SQLDiff tool in Visual Studio to create SQL statements that will allow me to migrate my database from one version to the next. I have been reading the files into a variable and calling VDatabase_SqlExecute() to run the SQL statements. This has been working fine; however, I ran across a situation today that does not work.
If the SQL statements passed to VDatabase_SqlExecute() include the creation of both functions and procedures (that reference those functions), the call fails. The error reported is 0x9050E - Error in function name "<function name>".
If the SQL for creating the functions is processed first (without the SQL for the procedures), that executes successfully. Then, the SQL for creating the procedures can be run successfully.
I have attached a zip file that contains the necessary items to recreate this issue. The files are as follows:
Test Valentina.livecodescript - contains the routine to run the test.
Valentina Test.sql - contains the SQL generated by SQL Diff (includes both functions and procedures)
Valentina Test 2.sql - includes only the SQL for creating the functions
Valentina Test 3.sql - includes only the SQL for creating the procedures
V4REV_Log_20180630_165707.log - is the log file created when I ran the test.
When the code is run, the attempt to execute the SQL statements in Valentina Test.sql will fail. Then, executing the SQL statements in Valentina Test 2.sql and Valentina 3.sql will succeed.