Sherry, it's your lucky day.
Thanks to John's message I found the patch that Tom Moore sent me
(thanks Tom). It only applies to views but it should be fairly obvious
how to extend it to synonyms (or you could just setup a view that
refers to the synonym).
Volunteers are most welcome to polish up the patch to be more general
(eg synonyms) and send me back a diff -c output. Thanks!
Tim.
On Wed, Apr 11, 2001 at 04:31:47PM -0500, John Milton wrote:
>
> I'm finding little bits and pieces of people having problems
> with this, and I would rather use a patch than the risk
> associated with implementing the fix myself.
>
> I found a very obscure reference from you here, second message:
>
> http://www.webclub.ru/confarchive/6269.html:
>
> >>> If you are working with a table in another user's schema, you need to
> >>> include that other user's name as part of specifying the table name (e.g.,
> >>> owner.Good_picture). This can be avoided if a synonym has been
> >>> defined for the table name, but that doesn't appear to be the case in your
> >>> database.
> >> I use public synonyms for tables and sequencies.
> >
> >Known bug. Patch is in the archives. Nag me if you really can't find it.
> >
> >Tim Bunce.
>
> Which archives?
> Is this the patch I'm looking for?
>
>
> If not, then is this approach correct:
>
> In oci8.c, in init_lob_refetch, before the existing
> OCIDescribeAny_log_stat, I would first attempt to describe
> a synonym by the same name and then construct a fully
> qualified tablename and continue.
>
>
> Thanks,
> John
> --
> John Bly Milton IV (512) w:493-2764, h:873-8567, m:791-8567
> FundsXpress [EMAIL PROTECTED] Don't FLAME, inform! O-
>From [EMAIL PROTECTED] Tue Jan 18 06:24:39 2000
Return-Path: <[EMAIL PROTECTED]>
Received: from oink by toad.ig.co.uk (SMI-8.6/SMI-SVR4)
id GAA20253; Tue, 18 Jan 2000 06:24:39 GMT
Received: from finch-punt-12.mail.demon.net by oink with SMTP (PP)
id <06635-0@oink>; Sun, 18 Jan 1970 07:24:05 +0100
Received: from punt-1.mail.demon.net by mailstore for [EMAIL PROTECTED]
id 948174420:10:06228:0; Tue, 18 Jan 2000 05:47:00 GMT
Received: from ha2.rdc1.bc.wave.home.com ([24.2.10.67])
by punt-1.mail.demon.net id aa1118031; 18 Jan 2000 5:46 GMT
Received: from spatial.ca ([24.65.169.48])
by lh2.rdc1.bc.home.com (InterMail v4.01.01.00 201-229-111)
with ESMTP
id <[EMAIL PROTECTED]>;
Mon, 17 Jan 2000 21:20:52 -0800
Message-ID: <[EMAIL PROTECTED]>
Date: Mon, 17 Jan 2000 21:25:09 -0800
From: Tom Moore <[EMAIL PROTECTED]>
Organization: Spatial Planning Systems
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Cannot insert blobs into views (DBD::Oracle) (problem and solution)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Status: RO
X-Status: A
Content-Length: 1703
Lines: 41
I am trying to insert records into a view using DBD::Oracle 1-03.
It was working fine until I tried to insert a blob column.
At that point the DBD::Oracle driver returned error message 4043
(table does not exist). I took a look into the driver source code and
found the following problem on line 1142 of oci8.c. It seems that the
driver only tries to get a description of a table. In case a view is
being used the OCIDescribeAny call will fail. I made the following
patch and it seems to work:
*** DBD-Oracle-1.03/oci8.c Sun Jul 11 23:21:01 1999
--- oci8.c Mon Jan 17 21:15:11 2000
***************
*** 1142,1150 ****
OCIDescribeAny_log_stat(imp_sth->svchp, errhp, tablename, strlen(tablename),
OCI_OTYPE_NAME, 1, OCI_PTYPE_TABLE, dschp, status);
if (status != OCI_SUCCESS) {
OCIHandleFree_log_stat(dschp, OCI_HTYPE_DESCRIBE, status);
return oci_error(sth, errhp, status, "OCIDescribeAny/LOB refetch");
! }
OCIAttrGet_log_stat(dschp, OCI_HTYPE_DESCRIBE,
&parmhp, 0, OCI_ATTR_PARAM, errhp, status);
--- 1142,1154 ----
OCIDescribeAny_log_stat(imp_sth->svchp, errhp, tablename, strlen(tablename),
OCI_OTYPE_NAME, 1, OCI_PTYPE_TABLE, dschp, status);
if (status != OCI_SUCCESS) {
+ OCIDescribeAny_log_stat(imp_sth->svchp, errhp, tablename, strlen(tablename),
+ OCI_OTYPE_NAME, 1, OCI_PTYPE_VIEW, dschp, status);
+ if (status != OCI_SUCCESS) {
OCIHandleFree_log_stat(dschp, OCI_HTYPE_DESCRIBE, status);
return oci_error(sth, errhp, status, "OCIDescribeAny/LOB refetch");
! }
! }
OCIAttrGet_log_stat(dschp, OCI_HTYPE_DESCRIBE,
&parmhp, 0, OCI_ATTR_PARAM, errhp, status);
Cheers,
Tom Moore
XXX synonyms!