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

Bradley C Bailey <[email protected]> Thu, 14 Feb 2008 20:58:17 -0700
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
I haven't tried it, but what about something like this in your class:

__PACKAGE__->set_up_table("table_name");
__PACKAGE__->table('owner..' . __PACKAGE__->table)

That'll call sp_columns with the table name, and then after that is done 
it will reset the table name to include the owner.

Regards,
Bradley C Bailey


> 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.
> 
> We're thinking it may be something else at this point, however.
> 
> In an case, now we know.
> 
> Thanks, Michael.
> 
> Eric
> 
> -----Original Message-----
> From: Michael G Schwern [mailto:[email protected]] 
> Sent: Thursday, February 14, 2008 5:23 PM
> To: Berg, Eric
> Cc: classdbi-uVLvtXkw1RPgjt3iqB9Uk5F3r5kRpbQ7rE5yTffgRl4@public.gmane.org
> Subject: Re: [CDBI] I need to specify the db owner as dbo..table_name
> 
> Berg, Eric wrote:
>> I'm having some issues with queries against a Sybase cluster, and am 
>> told by my DBAs that I need to specify not only the table name, but 
>> the owner using the folloiwing syntax:
>>
>>    owner..table_name
>>
>> Is this possible? 
> 
> Try it?
> 
> 	Some::Table->table('owner..table_name');
> 
> CDBI doesn't do much with the table name other than stick it into the
> query so it should work.
> 
>