Solved

ISQL Data export

Posted on 2013-02-07
6
2,006 Views
Last Modified: 2013-02-07
I am connected to a database with a file format .fdb using ISQL (Firebird).   I need help in querying or exporting the data using ISQL.  Any ideas? Thanks.
0
Comment
Question by:fjkaykr11
  • 3
  • 3
6 Comments
 
LVL 19

Accepted Solution

by:
NickUpson earned 500 total points
ID: 38864613
you have to install the firebird server, if you have done that are are correctly connecting to the database, then just do "select field1, field2, ... from tablename"
0
 
LVL 3

Author Comment

by:fjkaykr11
ID: 38864752
Thanks for the reply. I do have firebird server installed and i am connected to the database using ISQL. I was able to figure out how to view all the table names using the command >show tables;  However, I want to be able to select all the data and then export it a format that I can work with the data (such as .csv, .mdb, etc)  
When I run the command
SELECT * FROM SomeTable
OUTPUT TO 'C:\temp\sometable.csv' FORMAT ASCII DELIMITED BY ';' QUOTE '';

I also tried this command:
select * from TableName -o c:\Table.txt -n -1 -s ",";

I get an error for both commands
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 31

Any ideas?
0
 
LVL 19

Assisted Solution

by:NickUpson
NickUpson earned 500 total points
ID: 38865206
the functionality you are looking for does not exist, but you can get close

select varchar(field1, 10) || ',' || varchar(field2, 10) ... from table;

will get you csv, put that in a file and do

isql < my_file > my_output
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 3

Author Comment

by:fjkaykr11
ID: 38865356
Nick,  

Thanks for the reply. I am not really following how i would do that.  I can see the output from all the fields in the table when I do a Select * From TableName;
but I don't know how I would type in the format you are suggesting  ...., etc
Can you elaborate ?   Also, if I already have a file in a csv format as suggested, I am confused on the second step isql <my file> my_output, what is the purpose of that?  Thanks again.
0
 
LVL 3

Author Closing Comment

by:fjkaykr11
ID: 38865820
I found out the database I am connecting too I can't export the data. I have to use a proprietary tool.  Thanks for the help
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 38865833
The database does not have the ability to do the export you want as a built-in, however:

selecting each field and concatinating them together, with a comma between them would produce CSV form.

isql <my file> my_output

that runs isql, reading from the file my_file & sending output to my_output
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Query Syntax 17 43
Mysql Left Join Case 10 70
SQL Stored Proc - Performance Enhancement 15 55
Select question from MySQL 1 13
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

837 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