In an SQL procedure which I'm going to use for a model for several
others, I tried:
DECLARE v_schema character(8) default 'is2';
SELECT bhid INTO v_tmp_bhid FROM v_schema.animals
WHERE prefix=v_tmp_prefix
AND regnum=v_tmp_regnum;
so that I didn't have to change the schema in every SQL statement in the
procedure.
It failed, as I really expected, pointing to v_schema.animals as an
unknown name. The question is: how do I achieve the substitution for the
schema, the table name, or both together throughout an SQL procedure?