Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sybase outfile

Status
Not open for further replies.

amorvivir

Programmer
Jun 18, 2005
2
US
Could some one please give me some advice? I am new to Sybase and am trying to get sybase-ase-11.0.3.3-6 to produce an outfile of a certain table. It would be great if I could create an xml file but anything will do.
This is what I would do for MySQL:
Select * from someTable into outfile 'someFile.txt'
Thanks for any help.
Scott
 
There is an OUTPUT statement using Interactive SQL.

You might also try the UNLOAD statement. The various manuals used to be downloadable from the Sybase web site in PDF format.
 
you can write your sql into a file and then run it using ISQL -S[servername] -U[username] -P[password]-i [your_file_name.sql] -o [output_file_name.out]

the table will be avail. in the output file.

Iziki
 
Thanks fellas for responding. I have looked into the unload command and it doesnt seem to be firing for me. These are my attemts:
#$endDate = Syb::Value($conn,"select getdate()");
#$endDate = 45;
#$endDate = Syb::Value($conn,"SET TEMPORARY OPTION TEMP_EXTRACT_APPEND = ON");
#$endDate = Syb::Value($conn,"SET TEMPORARY OPTION TEMP_EXTRACT_NAME1 = 'testOutFile.txt'");
#$endDate = Syb::Value($conn,"SET TEMPORARY OPTION TEMP_EXTRACT_NAME2 = ''");
#$endDate = Syb::Value($conn,"SELECT * FROM Admin");
#$endDate = Syb::Value($conn,"SET TEMPORARY OPTION TEMP_EXTRACT_NAME1 = ''");
#$endDate = Syb::Value($conn,"select * from Acconts");#into outfile /home/e-smith/files/users/dmmreports/someTest.txt");
#$endDate = Syb::Value($conn,"unload from Acconts to 'testOutFileJune21.txt'");
#$endDate = Syb::Value($conn,"select * from Acconts to 'testOutFileJune21.txt'");
$endDate = Syb::Value($conn,"UNLOAD FROM TABLE Admin TO \'testOutFileJune21.dat\'");
Many attempts, any further suggestions?
Thanks in advance,
Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top