Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > Table merge from multiple databases

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-11-08, 15:04
Sybaze Sybaze is offline
Registered User
 
Join Date: Jun 2008
Posts: 3
Table merge from multiple databases

Hi.

I have a question I hope somebody will be able to help answer. I've worked almost exclusively with Oracle for almost 7 years, and now have to do some work on Sybase databases, but am struggling to accomplish some of the basic tasks.

The main goal is to write stored procedure/routing to merge identical tables from DIFFERENT databases, possibly on different servers.

The questions I have are:

1. How can I reference a table from another database in sql query?
In Oracle I can create database links, but how is it done in Sybase?

2. Next, I plan to do a row count comparison of each table in different databases (ex: DB1.TABLE_A and DB2.TABLE_A), and if they differe, run a reconciliation routine. Again, I Oracle I could have used MERGE statement and merge the tables based on a KEY field. Is there a similar statement available in Sybase?

I guess If I figure out how to read data from another database, I should be able to code the simple merge logic for item 2 above.

Look forward to your replies, and appologies for some basic questions.

S.
Reply With Quote
  #2 (permalink)  
Old 06-12-08, 02:46
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
1) look up proxy tables
2) No
Reply With Quote
  #3 (permalink)  
Old 06-12-08, 11:42
ishu.cs ishu.cs is offline
Registered User
 
Join Date: Mar 2008
Posts: 19
1. In sybase u can have more than one databases in one database instance. So if other database is on the same instance then u can access the tables of another database as following
Suppose u r in database A and u want to access the table T of database B, then the quesry will be like
select * from B..T

2. if ur other database is on a physically different server go to the link
http://infocenter.sybase.com/help/index.jsp
and serch for remote server
Reply With Quote
  #4 (permalink)  
Old 06-12-08, 12:12
Sybaze Sybaze is offline
Registered User
 
Join Date: Jun 2008
Posts: 3
Thank you.
Reply With Quote
  #5 (permalink)  
Old 06-12-08, 13:47
Sybaze Sybaze is offline
Registered User
 
Join Date: Jun 2008
Posts: 3
Would you be kind to post the equivalent of Oracle "desc table" command?

Or is the only way to get meta data on table colums is by quering one of the "sys" tables?
Reply With Quote
  #6 (permalink)  
Old 06-12-08, 14:01
O'sambo O'sambo is offline
Registered User
 
Join Date: Dec 2007
Location: Chennai,India
Posts: 11
1. sp_help table_name
2. sp_columns table_name
Reply With Quote
  #7 (permalink)  
Old 11-03-08, 07:10
Hemanta Hemanta is offline
Registered User
 
Join Date: Nov 2008
Posts: 2
I need to write a stored procedure/routing to merge identical tables from DIFFERENT databases
Reply With Quote
  #8 (permalink)  
Old 11-04-08, 07:18
O'sambo O'sambo is offline
Registered User
 
Join Date: Dec 2007
Location: Chennai,India
Posts: 11
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On