Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to capture context from a database link?

Re: How to capture context from a database link?

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 24 Aug 2004 08:57:15 -0500
Message-ID: <uwtzo63tx.fsf@standardandpoors.com>


On Mon, 23 Aug 2004, makbo_at_pacbell.net wrote:

> Galen Boyer wrote:
> 

>> On 20 Aug 2004, jared_at_hwai.com wrote:
>>
>>>Galen Boyer <galenboyer_at_hotpop.com> wrote in message
>>>news:<ullgaoq2c.fsf_at_standardandpoors.com>...
>>>
>>>
>>>>First things first. This is wrong design. You are putting
>>>>intelligence in keys. A definitely bad thing to do. The
>>>>domain needs to be an attribute on the table being inserted.
>>>
>>>No, not an intelligent key, just a way to guarantee uniqueness
>>>when combining sequence-generated numbers from multiple
>>>databases.
>> Well, then why didn't you ask that?
>> sys_guid()
>>

>
> Doesn't work across a dblink.

On the remote instance:

    CREATE OR REPLACE function sysguid

         RETURN varchar2
         AS
           v_sysguid        varchar2(2000);
         BEGIN
             select cast(sys_guid() as varchar2(2000))
             into v_sysguid
             from dual
             ;
          RETURN v_sysguid;
         END;

    /

On the local instance:

   variable v_sysguid varchar2(2000);
   exec :v_sysguid := sysguid_at_somedblink;

-- 
Galen Boyer
Received on Tue Aug 24 2004 - 08:57:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US