I am using Embarcadero Rapid SQL 7.5.5 to connect to sybase 12.0 database and i can see all the tables there.How to export those tables into .csv file.Can you please tell me the step by step procedure

I am using Embarcadero Rapid SQL 7.5.5 to connect to sybase 12.0 database and i can see all the tables there.How to export those tables into .csv file.Can you please tell me the step by step procedure to export within RapidSql tool.
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

grant300Commented:
Are you trying to export the table definitions to flat files or the data?  Since you are talking about CSV files, I will assume you want the data.

There is no point and click way to do what you want to do.  You have to:
 - Open a tab
 - Type SELECT * FROM <tblname>
 - Execute the query
 - In the results tab, do a File->Save As and select CSV

WARNING:  Do NOT try this on tables with more than a few thousand rows.

RapidSQL is not the correct tool to do this with nor is any other GUI query tool.  They are designed to display data in a friendly format; not handle mass quantities.

The best way to do this is to use the Sybase utility called Bulk Copy (BCP).  You can extract the entire contents of a table to a CSV very quickly and efficiently at something like 10,000 rows per second.

You can use RapidSQL to run a query that generates a script file with all the BCP command lines you need to get all the tables.  Something like the snippet below.  It may not be completely correct as I don't have a way to test it right now.

Run the query below in a RapidSQL tab for the database you are interested in. Then save the results as a Tab Delimited file with an extension of '.bat', assuming Windows of course.

When you run the script, make certain you are both in the directory where you want the extracted files to be placed AND that there is enough disk space to hold them.  If you have a 10GB database, you may need that much file system space.

Regards,
Bill

begin
set nocount on
    declare @bcp_prefix   varchar(128),
            @bcp_postfix  varchar(128)
 
    select @bcp_prefix = 'bcp ' + db_name() + '..',
           @bcp_postfix = '.csv -c -t, -S<your server> -U<your UID> -P<your PWD>'
 
    select @bcp_prefix + name + ' out ' + name + @bcp_postfix
      from sysobjects
     where type = 'U'
end

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.