Sybase Adaptive Server Anywhere version 126.96.36.19951
Folks, I could use some help. I am assisting a customer with migrating some data off of an existing application. This application was built by an ISV using Adaptive Server Anywhere 9 as the database. No support from the ISV now.
I wanted to figure out the best way of writing SQL from a scripting language like PERL/Python to connect to this database. My questions were:
1. Are there client libraries that I need to install on this machine to allow for PERL's DBD::SQLAnywhere to connect to and work with this database? If so, what might that be? And is there an easy way for me to test if such client libraries are already installed on the machine?
2. Forgetting PERL etc., what might be the easiest way for me to connect to the database to run queries to extract data in a programmatic fashion.
Thanks in advance.
Jeff Albion replied
- The full installation Adaptive Server Anywhere 9 ("SQL Anywhere 9") comes with a "src\perl" directory, which you can compile with Microsoft Visual C / Microsoft Visual Studio and install the "DBD::ASAny" DBI driver (what it was called in version 9 before being called "DBD::SQLAnywhere" in version 10).
It's unlikely that your deployed version of SQL Anywhere from your ISV would include this directory, so you will likely have to look for another approach to extract the data.
- Do you have the database username and password for the database user from your ISV? Many ISVs do not allow customers to connect directly to the database - if you do not have the username and password, you will not be able to use any of the SQL Anywhere utilities to connect to extract the data.
If you do have the database username and password and the utility is included with your deployment, you can attempt to unload the database using the Unload Utility (dbunload), at the command line which will produce a reload.sql and a set of .dat files, which are flat-file exports of your database tables. Before running this command, ensure no other database servers (dbeng9 / dbsrv9) are running. Here is an example:
dbunload -c "uid=dba;pwd=sql;dbf=myolddatabase.db" c:\unload
You can also potentially unload the tables individually using SQL once connected to the database (e.g. using Interactive SQL) and issuing the SQL statement 'UNLOAD TABLE':
UNLOAD TABLE employee TO 'c:\emp_test.txt'
SAP Active Global Support