Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Ingres Topics / April 2007

Tip: Looking for answers? Try searching our database.

problem with table names as parameters in Ingres 2006 Release 2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
glennr69@gmail.com - 30 Apr 2007 00:57 GMT
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
John Dennis - 30 Apr 2007 10:39 GMT
On Apr 30, 9:57 am, glenn...@gmail.com wrote:
> Hi
>
[quoted text clipped - 3 lines]
> statement, but not for other statements (like updates).  This sort of
> substitution works fine in 2.6.

...
> Has anyone else had a similar sort of problem on any other platforms?
>
> Cheers
> Glenn

The problem reproduces with 2006r2 on Windows. But the two cases you
have provided are different. There are no errors with either insert or
update where the table being inserted or updated is a variable, and
both the update or insert will generate errors when the table name is
a variable in a subselect or "from" in the insert.  A bug will be
raised shortly...

John
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.