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

Home -> Community -> Usenet -> c.d.o.server -> Re: Use of sequences over db link

Re: Use of sequences over db link

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Mon, 15 Nov 1999 19:57:17 +0100
Message-ID: <942692299.21464.0.pluto.d4ee154e@news.demon.nl>


You can't
You are running a session at the remote database, and your nextval is retrieved to your own database.
You simply don't have a context in which the sequence is defined. You need to make sure you select pdmlogseq.nextval_at_d704 into <ANY HOSTVAR> and use <ANY HOST VAR > in your insert. That makes your second select redundant.

Hth,

--
Sybrand Bakker, Oracle DBA
<tjmxyz_at_my-deja.com> wrote in message news:80p82l$4ht$1_at_nnrp1.deja.com...
> How can 1 use sequences over a dblink
>
> I do a query such as ...
> select pdmlogseq.nextval_at_d704 from dual;
>
> This works
>
> An insert such as...
> insert ....
> pdmlogseq.nextval_at_d704);
>
> Works but then the query:
> select pdmlogseq.currval_at_d704 from dual;
>
> Fails: With sequence not difined for this session...
>
> How can I (should I do the following three queries with a sequence over
> a dblink!??!
>
> 1)insert ....
> pdmlogseq.nextval_at_d704);
> 2) select pdmlogseq.currval_at_d704 from dual;
> 3) select pdmlogseq.nextval_at_d704 from dual;
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Nov 15 1999 - 12:57:17 CST

Original text of this message

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