Page 1 of 1
Anyone manage to make "revExecuteSQL" working?
Posted: Mon Jun 16, 2025 5:03 pm
by legarsdordinateur
Anyone manage to make "revExecuteSQL" work without error?
I tried all possible combinations and keep getting:
"
row 61, col 5: Function: error in function handler (revExecuteSQL)
row 61, col 5: put: error in expression"
Whether with an "array" or a "list", the command always returns an error.
Code: Select all
put revExecuteSQL(tConnID, tSQL, tMatrice) into tResult
or
Code: Select all
put revExecuteSQL(tConnID, tSQL, "tNom", "tPrenom", "tCourriel", "tTelephone", "tBiographie", "tDemarche", "tMediums") into tResult
Any suggestions?
Re: Anyone manage to make "revExecuteSQL" working?
Posted: Mon Jun 16, 2025 5:28 pm
by SparkOut
When you're using "put... into..." the engine is expecting an expression to be resolved, eg values, or a function. "put" is a command. Whereas revExecuteSQL is also a command, so it doesn't parse to have two commands following each other in the same statement.
Try leaving out the "put... into..." parts and just have the statement as "revExecuteSQL...."
The result of that command will automatically be placed in 'the result'.
Re: Anyone manage to make "revExecuteSQL" working?
Posted: Mon Jun 16, 2025 7:15 pm
by legarsdordinateur
First, thank you for the tips.
No luck, here is the new error:
row 70, col 1: External handler: exception (revdberr)
row 70, col 1: Handler: can't find handler (revExecuteSQL)
But this time, I can't find the meaning for "revdberr".
I've been having trouble with this for 2 days.
By the way, an equivalent PHP script works very well.
I do appreciate your suggestions.
Re: Anyone manage to make "revExecuteSQL" working?
Posted: Mon Jun 16, 2025 7:32 pm
by SparkOut
Is this running in the IDE or a standalone? If standalone, you'll need to ensure the database external is found and accessible for the engine.
revdbErr means there's an error generated by the LiveCode database library.
It's not really clear what's going wrong without seeing your code specifically making the SQL query.
Re: Anyone manage to make "revExecuteSQL" working?
Posted: Mon Jun 16, 2025 7:35 pm
by Klaus
Bonsoir legarsdordinateur,
1. welcome to the forum!
2. "revExecuteSQL" is a COMMAND, not a function!
Sometimes a look into the dictionary is really helpful.
So this should work:
Code: Select all
...
revExecuteSQL tConnID, tSQL, "tNom", "tPrenom", "tCourriel", "tTelephone", "tBiographie", "tDemarche", "tMediums"
put the result into result_of_ revExecuteSQL
...
Best
Klaus
Re: Anyone manage to make "revExecuteSQL" working?
Posted: Mon Jun 16, 2025 10:32 pm
by legarsdordinateur
Alleluia! It works now!
There is nothing worse than getting stuck on a detail that ultimately appears insurmountable to you.
Let's finally move on to the next step, hoping not to get stuck.
Thank you, Klaus, SparkOut and all!