[CDBI] I need to specify the db owner as dbo..table_name

Michael G Schwern schwern at pobox.com
Fri Feb 15 03:47:09 GMT 2008


Berg, Eric wrote:
> I thought of that, but hadn't tried it.  When I did, it worked in
> general, a in it did pass the entire string right through to the db.
> That was cool.
> 
> Unfortunately, sp_columns which is called by cdbi::Sybase can't handle
> that.  We could move away from the Sybase automatic setup stuff, but
> we're not at this point.

That's annoyingly inconsistent.  Maybe just patch CDBI::Sybase::set_up_table() 
to strip off the owner part before using it with the sp functions?

sub set_up_table
{
     my ( $class, $table ) = @_;
     my $dbh = $class->db_Main();

     $class->table($table);

     my($sp_safe_table) = (split m{\.\.}, $table)[-1];

     # find the primary key and column names.
     my $sth = $dbh->prepare("sp_columns $sp_safe_table");
     $sth->execute();



-- 
184. When operating a military vehicle I may *not* attempt something
      “I saw in a cartoon”.
     -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
            http://skippyslist.com/list/



More information about the ClassDBI mailing list