Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2008-11-19
1
Medium Priority
?
2,926 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:gudii9
1 Comment
 
LVL 19

Accepted Solution

by:
grant300 earned 2000 total points
ID: 22998932
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question