New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL editor: save query results in variable #4750
Comments
Good feature. |
Reference - may be close by: #4337 |
Is this feature being dropped? It's been carried over milestone to milestone and now it isn't attached to anything. |
implemented in #11533 |
#11533 does not work for my request #4750 (comment) |
@Barosky works for me (picture below, query ends up with an error due to absence of the mentioned tables, but the variable is set and variable value was copied to query) |
@uslss this one does not work: @set xx = INSERT INTO test (valore) VALUES ('test') RETURNING id --valore is a varchar field also this one does not work for me:
So, by the error my understanding is that :xx does not contain the result of the insert, but the whole statement. IMHO this is not the correct behaviour |
Hello,
I often write insert queries, then copy the inserted id to use it in another insert or update query.
In my opinion it would be useful to have the possibility to assign to named parameters the result of a scalar query.
For example:
@set param1 = insert into test_table (field1, field2) values (value1, value2) returning id;
insert into table2 (field1,field2) values (value1, :param1)
Best regards,
Cristiano
The text was updated successfully, but these errors were encountered: