Message from discussion
Oracle Auto Init PK Sequence - DB user, Not Sequence Owner
Received: by 10.224.186.20 with SMTP id cq20mr3204568qab.8.1350577902674;
Thu, 18 Oct 2012 09:31:42 -0700 (PDT)
X-BeenThere: rose-db-object@googlegroups.com
Received: by 10.224.70.208 with SMTP id e16ls1178737qaj.0.gmail; Thu, 18 Oct
2012 09:31:42 -0700 (PDT)
Received: by 10.224.33.136 with SMTP id h8mr6181698qad.1.1350577902102;
Thu, 18 Oct 2012 09:31:42 -0700 (PDT)
Date: Thu, 18 Oct 2012 09:31:41 -0700 (PDT)
From: Tom Adamo <tad...@gmail.com>
To: rose-db-object@googlegroups.com
Message-Id: <0ef200f3-28fc-4caf-8660-d38048a91228@googlegroups.com>
Subject: Oracle Auto Init PK Sequence - DB user, Not Sequence Owner
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_749_4929632.1350577901649"
------=_Part_749_4929632.1350577901649
Content-Type: multipart/alternative;
boundary="----=_Part_750_6447423.1350577901649"
------=_Part_750_6447423.1350577901649
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
I've been testing out the auto-init of RDBO objects with an Oracle
database. I noticed the sequence value of my primary key column wasn't
being populated correctly (the sequence I created follows the naming
convention described in the Rose::DB::Object docs for auto-incremented
columns). I tracked the problem down to the follow code
in Rose::DB::Object::Metadata::Auto::Oracle:
In auto_init_primary_key_columns...
The code has this...
32 my $sequence_name = uc
$cm->auto_primary_key_column_sequence_name($table, $name);
The problem I have is that I'm not signed into the DB as the sequence
owner, so this code needs to also supply the schema name so it will work
regardless of which DB user I'm signed in as (and the proper grants are
given). Something like this...
32 my $sequence_name = uc
$cm->auto_primary_key_column_sequence_name($schema . '.' . $table, $name);
I'm still trying to think of a work-around (we just use Oracle at this
point), but I thought I'd point this out.
- Tom
------=_Part_750_6447423.1350577901649
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
I've been testing out the auto-init of RDBO objects with an Oracle database=
. I noticed the sequence value of my primary key column wasn't being popula=
ted correctly (the sequence I created follows the naming convention describ=
ed in the Rose::DB::Object docs for auto-incremented columns). I tracked th=
e problem down to the follow code in Rose::DB::Object::Metadata::Auto:=
:Oracle:<div><br></div><div>In auto_init_primary_key_columns...</div><=
div><br></div><div>The code has this...</div><div><br></div><div> 32 &=
nbsp; my $sequence_name =3D uc $cm->auto_primary_key_column_seque=
nce_name($table, $name);</div><div><br></div><div><br></div><div>The proble=
m I have is that I'm not signed into the DB as the sequence owner, so this =
code needs to also supply the schema name so it will work regardless of whi=
ch DB user I'm signed in as (and the proper grants are given). Something li=
ke this...</div><div><br></div><div> 32 my $sequence_nam=
e =3D uc $cm->auto_primary_key_column_sequence_name($schema . '.' . $tab=
le, $name);<br></div><div><br></div><div><br></div><div>I'm still trying to=
think of a work-around (we just use Oracle at this point), but I thought I=
'd point this out.</div><div><br></div><div>- Tom</div>
------=_Part_750_6447423.1350577901649--
------=_Part_749_4929632.1350577901649--