[ic] Adding records to Oracle table with non-unique index?

Mike Heins interchange-users@icdevgroup.org
Fri Oct 11 19:09:00 2002


Quoting Ed LaFrance (edl@newmediaems.com):
> At 06:16 PM 10/11/2002 -0400, you wrote:
> >Quoting Ed LaFrance (edl@newmediaems.com):
> > > Hi all -
> > >
> > > Have a client who wants me to insert a record into an oracle table which
> > > has a non-unique index (key) column, purposely to allow multiple entries
> > > with the same index value. It seems that every data table writing 
> > method in
> > > Interchange is designed to prevent this, updating the first matching 
> > record
> > > found instead of writing a new one. Anybody have any ideas on how I can
> > > force IC to blindly insert the new record into the table?
> >
> >You'll have to either use DBI or $db->query().
> 
> I had attempted an insert via $Db{table_name}->query() earlier and got a 
> failure with this message in the error log:
> 
> SQL query failed for table_name: DBI tables must be updated natively.
> 
> ... I saw in the list archives where others had posted that this worked for 
> them, so I'm not sure what the issue is here.

Probably your products table is not in the same database, so you need:

	$db->query( { table => 'the_table', sql => $query });

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

People who want to share their religious views with you
almost never want you to share yours with them. -- Dave Barry