A
A
Andrey Vershinin2014-04-18 14:07:41
SQL
Andrey Vershinin, 2014-04-18 14:07:41

How to store the result of a SELECT query in a local variable?

Tried like this:

SELECT value FROM table WHERE id = :id INTO variable;

and so: But neither one nor the other works.
variable = (SELECT value FROM table WHERE id=:id);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Vershinin, 2014-04-18
@WolfdalE

for(unsigned i = 0; i < 200; ++i)
cout << "A variable name should always be preceded by a colon";
In some places the variable was used without a preceding colon, so this error was thrown.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question