Select * from db2.table (sql base) how to do

Discussion forum about all things SqlBase.
JOHN
Zambia
Posts: 4
Joined: 01 Sep 2021, 06:48
Location: Zambia

Select * from db2.table (sql base) how to do

Post by JOHN » 01 Sep 2021, 06:53

SELECT NAME FROM db2.EMP;

am trying something like this . in sql base



eagerly waiting for someones help
Last edited by JOHN on 01 Sep 2021, 07:57, edited 2 times in total.

FRBhote
India
Posts: 2172
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Select * from db2.table (sql base) how to do

Post by FRBhote » 01 Sep 2021, 07:56

Set SqlDatabase = Database1
SqlConnect( hSqlDB1 )

Set SqlDatabase = Database2
SqlConnect( hSqlDB2 )

hSqlDB1 will always access DB1 and hSqlDB2 will always access DB2.

JOHN
Zambia
Posts: 4
Joined: 01 Sep 2021, 06:48
Location: Zambia

Re: Select * from db2.table (sql base) how to do

Post by JOHN » 01 Sep 2021, 07:59

FRBhote wrote:
01 Sep 2021, 07:56
Set SqlDatabase = Database1
SqlConnect( hSqlDB1 )

Set SqlDatabase = Database2
SqlConnect( hSqlDB2 )

hSqlDB1 will always access DB1 and hSqlDB2 will always access DB2.
can we do something like SELECT NAME FROM db2.EMP;

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 1365
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: Select * from db2.table (sql base) how to do

Post by Igor Ivanovic » 01 Sep 2021, 10:19

No.
Igor Ivanovic
Image

JOHN
Zambia
Posts: 4
Joined: 01 Sep 2021, 06:48
Location: Zambia

Re: Select * from db2.table (sql base) how to do

Post by JOHN » 01 Sep 2021, 10:33

Igor Ivanovic wrote:
01 Sep 2021, 10:19
No.
so we cannot access data with single statement or there is no way to acces other database tables

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 1365
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: Select * from db2.table (sql base) how to do

Post by Igor Ivanovic » 02 Sep 2021, 05:41

JOHN wrote:
01 Sep 2021, 10:33
so we cannot access data with single statement
No.
JOHN wrote:
01 Sep 2021, 10:33
or there is no way to acces other database tables
You already got the answer how to do it from FRBhote

And you can also use

Code: Select all

SqlConnectEx( hSql1, sDatabase1, sUser, sPassword)
SqlConnectEx( hSql2, sDatabase2, sUser, sPassword)
Igor Ivanovic
Image

JOHN
Zambia
Posts: 4
Joined: 01 Sep 2021, 06:48
Location: Zambia

Re: Select * from db2.table (sql base) how to do

Post by JOHN » 02 Sep 2021, 06:12

Igor Ivanovic wrote:
02 Sep 2021, 05:41
JOHN wrote:
01 Sep 2021, 10:33
so we cannot access data with single statement
No.
JOHN wrote:
01 Sep 2021, 10:33
or there is no way to acces other database tables
You already got the answer how to do it from FRBhote

And you can also use

Code: Select all

SqlConnectEx( hSql1, sDatabase1, sUser, sPassword)
SqlConnectEx( hSql2, sDatabase2, sUser, sPassword)

many thanks.. but i am concerned about sqlbase only not from TD app. it is working with TD app. just need in sqlbase as a statement

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest