Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Query between 2 databases

2 posts in General Discussion Last posting was on 2007-02-09 14:38:45.0Z
sb Posted on 2007-02-09 14:29:02.0Z
Sender: 1fa7.45cc8487.1804289383@sybase.com
From: sb
Newsgroups: ianywhere.public.general
Subject: Query between 2 databases
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <45cc852e.1fb4.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 9 Feb 2007 06:29:02 -0800
X-Trace: forums-1-dub 1171031342 10.22.241.41 (9 Feb 2007 06:29:02 -0800)
X-Original-Trace: 9 Feb 2007 06:29:02 -0800, 10.22.241.41
Lines: 17
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5828
Article PK: 1817

Hello all,

I have the following query that I execute on db1
SELECT count(*)
FROM "db11111"."dba"."T1"

it returns 30

If I execute it on db1 but change the query to
SELECT count(*)
FROM "db22222"."dba"."T1"

it still return 30 but the are not 30 rows in db2

Im I missing something ?

How do you qury from on db to an other ?


anil k goel Posted on 2007-02-09 14:38:45.0Z
From: "anil k goel" <firstname.no-junk.lastname@spam.ianywhere.com>
Newsgroups: ianywhere.public.general
References: <45cc852e.1fb4.1681692777@sybase.com>
Subject: Re: Query between 2 databases
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: agoel-xp.sybase.com
X-Original-NNTP-Posting-Host: agoel-xp.sybase.com
Message-ID: <45cc8775$1@forums-1-dub>
Date: 9 Feb 2007 06:38:45 -0800
X-Trace: forums-1-dub 1171031925 10.25.99.239 (9 Feb 2007 06:38:45 -0800)
X-Original-Trace: 9 Feb 2007 06:38:45 -0800, agoel-xp.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5829
Article PK: 1818

SA does not support cross-database references like below. The references to
DB are parsed and ignored.

In order to refer to tables in another database, you need to make use of the
remote database access feature. Look for proxy tables in the SA docs:
ASA SQL User's Guide

Accessing Remote Data

--
-anil
Query Processing, SQLAnywhere Research and Development
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------

<sb> wrote in message news:45cc852e.1fb4.1681692777@sybase.com...
> Hello all,
>
> I have the following query that I execute on db1
> SELECT count(*)
> FROM "db11111"."dba"."T1"
>
> it returns 30
>
> If I execute it on db1 but change the query to
> SELECT count(*)
> FROM "db22222"."dba"."T1"
>
> it still return 30 but the are not 30 rows in db2
>
> Im I missing something ?
>
> How do you qury from on db to an other ?