|
|
Archives of the TeradataForum
Message Posted: Fri, 05 Oct 2012 @ 09:20:06 GMT
Subj: | | Stored Procedure: SELECT INTO clause |
|
From: | | Ravi.Singh |
Hi,
Is it possible to use a local variable in FROM clause of SELECT INTO statement. I have a requirement like this,
BEGIN
DECLARE vDBame varchar(30);
DECLARE vClient_ID SMALLINT;
IF (some condition) THEN
SET vDBName = 'XXX';
ELSE
SET vDBName = 'YYY'
END IF;
SELECT CLIENT_ID INTO :vClient_ID FROM :vDBName.CLIENT_TABLE WHERE CLIENT_CODE = 'ABC';
END
The SELEC INTO clause is not working out. Can anyone please help me out how to get it done.
Regards,
Ravi
| |