[Info-Ingres] problem with table names as parameters in Ingres 2006 Release 2
glennr69 at gmail.com
glennr69 at gmail.com
Sun Apr 29 18:57:52 CDT 2007
Hi
I have been testing Ingres 2006 Release 2 for Solaris and have found
an interesting problem. We have a large amount of ABF code and there
seems to be a problem using a parameter for a table name in a insert
statement, but not for other statements (like updates). This sort of
substitution works fine in 2.6.
I have recompiled all the source code as recommended.
I turned on printqry and can show you the following statements (from
the code and from the output from printqry). The following is an
example of an update:
The ABF code looks like:
UPDATE :tmp_tbl_nm t
SET perorg_ty = 'NID' /* Non_Individual. */
WHERE t.contract_acct_no IN
( SELECT contract_acct_no
FROM perorg_individual p
, contract_involve ci
WHERE ci.contract_acct_no = t.contract_acct_no
AND p.perorg_no = ci.perorg_no
AND ci.seq_no = 0
AND ci.perorg_rol = 'BWR'
AND ci.start_dt <= date('today')
AND ci.stop_dt = ''
AND p.title = '')
AND t.perorg_ty != 'NID';
The output in printqry looks like:
update intcpb_perorg_tmp t set perorg_ty='NID' where
t.contract_acct_no IN (s
elect contract_acct_no from perorg_individual p, contract_involve ci
where ci
.contract_acct_no=t.contract_acct_no and p.perorg_no=ci.perorg_no
and ci.seq_
no=0 and ci.perorg_rol='BWR' and ci.start_dt<=date('today') and
ci.stop_dt='' and p.title='') and t.perorg_ty<>'NID'
For an insert - the code looks like:
INSERT INTO market_salut_tbl
( contract_acct_no
, contract_nm
, marketing_nm
)
SELECT contract_acct_no = t.contract_acct_no
, contract_nm = t.contract_nm
, marketing_nm = 'Sir/Madam'
FROM :tmp_tbl_nm t
WHERE t.perorg_ty = 'NID';
But the output in printqry looks like:
insert into market_salut_tbl(contract_acct_no, contract_nm,
marketing_nm) sel
ect contract_acct_no=t.contract_acct_no, contract_nm=t.contract_nm,
marketing
_nm='Sir/Madam' from 'intcpb_perorg_tmp' t where t.perorg_ty='NID
Notice the single quotes around the temp table name... This throws a
syntax error.
Has anyone else had a similar sort of problem on any other platforms?
Cheers
Glenn
More information about the Info-Ingres
mailing list