Anyone manage to make "revExecuteSQL" working?

This is the place to discuss the LiveCode Hosting service.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
legarsdordinateur
Posts: 3
Joined: Sat May 28, 2022 1:25 pm

Anyone manage to make "revExecuteSQL" working?

Post by legarsdordinateur » Mon Jun 16, 2025 5:03 pm

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?

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: Anyone manage to make "revExecuteSQL" working?

Post by SparkOut » Mon Jun 16, 2025 5:28 pm

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'.

legarsdordinateur
Posts: 3
Joined: Sat May 28, 2022 1:25 pm

Re: Anyone manage to make "revExecuteSQL" working?

Post by legarsdordinateur » Mon Jun 16, 2025 7:15 pm

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.

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: Anyone manage to make "revExecuteSQL" working?

Post by SparkOut » Mon Jun 16, 2025 7:32 pm

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.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Anyone manage to make "revExecuteSQL" working?

Post by Klaus » Mon Jun 16, 2025 7:35 pm

Bonsoir legarsdordinateur,

1. welcome to the forum! :-)

2. "revExecuteSQL" is a COMMAND, not a function!
Sometimes a look into the dictionary is really helpful. 8)

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

legarsdordinateur
Posts: 3
Joined: Sat May 28, 2022 1:25 pm

Re: Anyone manage to make "revExecuteSQL" working?

Post by legarsdordinateur » Mon Jun 16, 2025 10:32 pm

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. :wink:

Thank you, Klaus, SparkOut and all!

Post Reply