|
Archives of the TeradataForumMessage Posted: Tue, 09 Oct 2012 @ 19:32:48 GMT
This works (of course) ... SET sG_SqlStringTx = 'SELECT COUNT(*) FROM '||TRIM(sP_ErrorDb)||'.'||TRIM(sP_TableNm)||' WHERE CON_ID = ?'; -- PREPARE sG_sql FROM sG_SqlStringTx ; -- OPEN sG_Csr USING sP_ConId; -- FETCH sG_Csr INTO nG_RowCt; CLOSE sG_Csr; but this doesn't ... SET sG_SqlStringTx = 'SELECT COUNT(*) FROM '||TRIM(sP_ErrorDb)||'.'||TRIM(sP_TableNm)||' WHERE CON_ID = ?'; -- PREPARE sG_sql FROM sG_SqlStringTx ; -- SET sL_RunCsr = 'OPEN sG_Csr USING sP_ConId;'; EXECUTE IMMEDIATE sL_RunCsr; -- FETCH sG_Csr INTO nG_RowCt; CLOSE sG_Csr; Any ideas why, guys ? The only difference is that in the second example I'm trying to dynamically build up the number of USING parameters I need. The code for the second example compile and doesn't fail when run, it just doesn't bring a value back in nG_RowCt If this would work then it would then be possible to have one OPEN Cursor Statement, with the number of Using parameters defined by how many filters are being passed through the Procedural interface. Does that make sense ? Regards David Clough
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||