I would like to assign a value to a variable which is used in an sql code in firebird. The MySQL-Code would be:
SET @x = 1;
SELECT @x;
What is the correspondent Firebird-Code?
Thanks for help.
I would like to assign a value to a variable which is used in an sql code in firebird. The MySQL-Code would be:
SET @x = 1;
SELECT @x;
What is the correspondent Firebird-Code?
Thanks for help.
I'm no expert in Firebird, but I believe it would be something like this...
To define a user-defined session-specific variable in Firebird you can use rdb$set_context.
The correspondent Firbird-code for your MySql-example would be:
Notes:
1.) Be aware that variable names are case-sensitive.
2.) Internally variable values are stored with datatype
VARCHAR(255)
and thus casted toVARCHAR(255)
!!3.) The maximum number of variables is 1000.
4.) You don't need to refer to
rdb$database
:would work as well.