Folks,
I'm sure this is dumb, but I'm a little confused about use of numerical
variables in pqsql. It was my impression one had to use EXECUTE on a
concatenated string including quote_literal() for the variable containing the
value. This can be quite a bit of trouble. I just wrote a
function that included the statement :
CREATE TEMPORARY TABLE author_names AS
SELECT ra.ref_auth_key, a.last_name, a.first_name FROM ref_auth ra INNER JOIN authors a ON (ra.author_num = a.author_key) WHERE ra.ref_num = refer_num; where refer_num is integer. This worked (surprisingly, to me).
So, what is the rule regarding variables? Would this query work if I
concatenated a string together, including quote_literal(refer_num) and then
EXECUTEd it?
Thanks and sorry to be so stupid.
|
- [SQL] Numerical variables in pqsql statements Michael Schmidt
- Re: [SQL] Numerical variables in pqsql statements Thomas F. O'Connell
- Re: [SQL] Numerical variables in pqsql statem... Thomas F. O'Connell
- [SQL] plpgsql question Postgres Admin
- Re: [SQL] [ADMIN] plpgsql question Michael Fuhr
- Re: [SQL] [ADMIN] plpgsql questi... Postgres Admin
- Re: [SQL] [ADMIN] plpgsql qu... Michael Fuhr