ISQL Data export

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.
LVL 3
fjkaykr11Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Nick UpsonConnect With a Mentor Principal Operations EngineerCommented:
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
 
fjkaykr11Author Commented:
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
 
Nick UpsonConnect With a Mentor Principal Operations EngineerCommented:
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
fjkaykr11Author Commented:
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
 
fjkaykr11Author Commented:
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
 
Nick UpsonPrincipal Operations EngineerCommented:
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
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.

All Courses

From novice to tech pro — start learning today.