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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing SQL database with statment

Status
Not open for further replies.

Holla

Programmer
Sep 16, 2002
2
0
0
US
How do i print the data in a table using an SQL statment
sybase SQL anywhere 5.0

thank you
 
I'm not familiar with SQL Anywhere as such, but assuming this is the same as Sybase's SQL, if you want to see all the data in a table, it would be:

select * from tablename

If you want to see what the table structure is it would be:

exec sp_help tablename

Hopefully, that's what you're asking!
 
No I'm sorry maybe I phrased the question wrong. I want to send the data queried to a printer to print out!
If u can help me it would be appreciated!

Thank You In Advance
Holla(programmer)
 
I don't think you're going to find a command that will print out the data by giving a command to the database--think about it: the DB doesn't know about the printer connections the operating system has (all it cares about the OS for is disk access).

You may be able to find an application that will query the data, save it to a file, and then queue the file for printing, but I can't think of one off hand.

However, if you write a batch file to run ISQL against the DB and read the query from a file while saving the results to a file, the batch file can send the file to a printer and even, if desired, delete the file.

I think that's about the only way you'll be able to get what you want without stepping into the process manually to print the data.

BOL,

JMC J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top