I am kinda new to sybase/SQL programming, but I am having to work with 160 databases with .db files that are accessible through Sybase Central (64-bit). Each database has several tables related to different chemicals (160 different chemicals thus 160 databases). Tables in all databases have same fields (only the database names are different). Anyway, I was able to import individual .db files to sybase using SQL Anywhere 16 and do the relational databases stuffs (merging and stuffs that I knew how to do in access) within a single database. However, I am looking for a way to merge all similar tables from all databases and ran into a problem when I imported all databases individually and did:

SELECT * FROM Database1.Table1 UNION ALL SELECT * FROM Database2.Table1 UNION ALL …..(tables from other databases).

While doing the above, I just got only repeated rows for Database1.Table1(when I did union once - I got duplicates for Database1.Table1, union twice - triplicates for Database1.Table1, and so on)

So I was wondering if someone would guide me to

find a way to import all 160 .db files (from 160 databases) from my computer directory to Sybase central (all at once without having to import them 160 times) and to unionize all similar tables such that say, if I have individual tables for chemical name and molecular weight, I would like to be able to unionize all of them in one master chemical name and molecular weight table. Like I said, I am just learning this language because I now need it for my research and would appreciate any comments or advices.

Thanks a lot!

asked 17 May '16, 14:42

Akranta's gravatar image

Akranta
10111
accept rate: 0%


The database component of the table specification database.user.table is ignored by SQL Anywhere. To access another database you need to use a proxy table. So what you will do is create a proxy table for each table in one of the other databases and then select from the proxy table - the server will then make the connection to the other database to get the table data.

See the documentation for more information.

permanent link

answered 17 May '16, 18:58

Mark%20Culp's gravatar image

Mark Culp
23.0k9130270
accept rate: 40%

edited 18 May '16, 08:44

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
7.3k35107

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×102
×10
×6
×6
×3

question asked: 17 May '16, 14:42

question was seen: 351 times

last updated: 18 May '16, 08:44