Hi,
Im experimenting with databases in Ventuz, most of the stuff I tried works fine, but theres one major problem:
I cant use variables in a query.
In the example scene you guys created a variable "@Clubs" and used that in the query.
When i try to add another variable with a @-prefix i get this error
Without @-prefix the variable is just ignored.
Is this a bug in the Script Editor to not allow @ for SQL or am I doing something wrong?
Greets
Schub
Hello Ventuzians!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
How to use Variables in MySQL queries?
Moderator: Support
Re: How to use Variables in MySQL queries?
Oh yeah!
This issue slipped in in Ventuz 3.7.0.
Will be fixed for upcoming Ventuz 4.4.0.
Cheers
Karol
This issue slipped in in Ventuz 3.7.0.
Will be fixed for upcoming Ventuz 4.4.0.
Cheers
Karol
Re: How to use Variables in MySQL queries?
Ok, good to know :D
Thanks
Greets,
schub
Thanks
Greets,
schub
Re: How to use Variables in MySQL queries?
In the meantime just use variables without a leading @.
Should work if you choose a name that's not used in the database table already.
Cheers,
Götz
Should work if you choose a name that's not used in the database table already.
Cheers,
Götz
Re: How to use Variables in MySQL queries?
Sadly, it does not work for me :(Götz_B wrote:In the meantime just use variables without a leading @.
Should work if you choose a name that's not used in the database table already.
I created a variable "x" as Integer in the inputs of the query node, then when I use the following query, the error event flashes and no data is written to the database
Code: Select all
UPDATE testdb.debug SET testvalue = x WHERE debug.id = 1;
Code: Select all
UPDATE testdb.debug SET testvalue = 'x' WHERE debug.id = 1;
Code: Select all
UPDATE testdb.debug SET testvalue = 1234 WHERE debug.id = 1;
But I dont know how efficient this is, and I'm bound to the numeric variables provided by "convert to text"
Greets,
schub
Re: How to use Variables in MySQL queries?
Sorry I have to bring this up again, but the problem persists.
After the 4.04 update its possible to create the @variables, but they will not be used in the query.
The entries will be changed to '0' or I get an error message, depending if I used the 'UPDATE' command or 'INSERT INTO'
The only way to use an @variable is to 'SET' it first in the query like this:
This proves that variables are supported by the MySQL server, but again, if the variable values need to be hardcoded into the query they're useless for Ventuz integration.
Can someone post an example how to use Custom Model Input with a MySQL query?
Or is this not intented at all, and we're only supposed to use the Custom Model Output of the query node?
Greets
Schub
After the 4.04 update its possible to create the @variables, but they will not be used in the query.
The entries will be changed to '0' or I get an error message, depending if I used the 'UPDATE' command or 'INSERT INTO'
The only way to use an @variable is to 'SET' it first in the query like this:
Code: Select all
SET @variable=1234;
UPDATE testdb.debug SET testvalue = @variable WHERE id = 1;
Can someone post an example how to use Custom Model Input with a MySQL query?
Or is this not intented at all, and we're only supposed to use the Custom Model Output of the query node?
Greets
Schub