Sponsored Content
Top Forums Shell Programming and Scripting linux ISQL and MSSQL unload results to file Post 302335777 by benefactr on Monday 20th of July 2009 12:17:20 PM
Old 07-20-2009
linux ISQL and MSSQL unload results to file

Hello,
I am using suse 10.1 and isql from unixodbc to connect to a MS SQL server. I got everything to work fine. What do I need to unload the results from the sql to a file? I attempted to put unload to in my sql statement but got a error. I don't see in the isql help where it has a option to unload to files, I read about a -o option but the isql I am using doesn't have that option.
Guess I either need to know how to unload the results using MS SQL's or how to do it from ISQL. I set the delimiter to pipe and attempted to redirect the output but got all of the isql login stuff. Thanks.

---------- Post updated at 11:17 AM ---------- Previous update was at 11:01 AM ----------

I figured it out, I just needed to add on the -b optoin, and the redirecting of the output now just includes the results. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

connect to mssql

Hi - can any one tell me is it possible to connect to mssql and fetch the data from unix shell scripts (3 Replies)
Discussion started by: ahmedwaseem2000
3 Replies

2. Linux

Is there any way to unload *.so by force?

In linux, dlclose can unload the dynamic linked library when the reference count decreases to zero. My questions is: Is there any way to unload the *.so without caring the reference count? (0 Replies)
Discussion started by: princelinux
0 Replies

3. AIX

AIX to access MSSQL server

Anyone can provide a solution for how AIX to access Microsoft SQL server ? (0 Replies)
Discussion started by: hellboy01
0 Replies

4. Red Hat

Linux ls -L Results

I seem to be somewhat baffled by the results of the -L option of the ls command on our new Linux system. I have a symbolic link defined like the following: ptmawpmfld.sqr as /u21/xxxx/m/moranp1/yyyy/fixpaths/tests20091218/awpmfld.sqr When I issue the command ls -l ptmawpmfld.sqr, I see the... (2 Replies)
Discussion started by: ptmoran
2 Replies

5. Shell Programming and Scripting

Print some results in a text file using script in linux

hello everyone, i really need your help to write a script which would just print following kind of result into a text file (result.txt) XYZ test Results ID: <unique-id> Date: <date> ------------------------------------------------- | Task | Result | Time |... (3 Replies)
Discussion started by: viriimind
3 Replies

6. UNIX and Linux Applications

linux sqlplus select results writes into file twice

Hello, This is my first post and its because I could not find solution for myself I decided to ask help here. What I want to do; I want to get some data from a table 1 on server 1 and insert those datas into a table 2 on server 2. ( lets say schema names are server1 and server 2 also ).... (10 Replies)
Discussion started by: azuahaha
10 Replies

7. Shell Programming and Scripting

Read parameter file in a shell script to unload a DB2 Table???

Hi , I Have following requirement: DB2 Sql query to pass from a parameter file for example, I would create a parameter file with (SELECT column 1, column 2 FROM Table name) then job would read it and create a file with the contents named table.txt How to write/modify below ksh script to... (10 Replies)
Discussion started by: developer.dwh9
10 Replies

8. Red Hat

isql command not working in Linux 64bit

I am using Linux RHEL5 64 bit and installed oracle 11g. I want to check ODBC connection , i had modified odbc.ini file when i use this command -isql I am getting following error . bash: isql: command not found Kindly help (5 Replies)
Discussion started by: roopalidalvi231
5 Replies

9. Shell Programming and Scripting

MSSQL or SQL SERVER or SQLSERVER?

hi, i'll want to try on the parameter with three possibility because mine colleagues usally to work on the other name folders. for example: MSSQL SQL SERVER SQLSERVER case $q in a) echo -ne "Work database: " echo "" echo " 1) ORACLE" echo... (4 Replies)
Discussion started by: gsflash80
4 Replies

10. Shell Programming and Scripting

Create a text file and a pdf file from Linux command results.

Hello. The task : Using multiple commands like : gdisk -l $SOME_DISK >> $SOME_FILEI generate some text file. For readiness I must insert page break. When the program is finished I want to convert the final text file to a pdf file. When finished, I got two files : One text file and One pdf... (1 Reply)
Discussion started by: jcdole
1 Replies
bsqldb(1)							 FreeTDS Utilities							 bsqldb(1)

NAME
bsqldb - batch SQL script processor using DB-Library SYNOPSIS
bsqldb [-U username] [-P password] [-S servername] [-D database] [-i input_file] [-o output_file] [-e error_file] [-H hostname] [-t field_term] [-hqv] DESCRIPTION
bsqldb is a utility program distributed with FreeTDS. bsqldb is a non-interactive equivalent of the "isql" utility programs distributed by Sybase and Microsoft. Like them, bsqldb uses the com- mand "go" on a line by itself as a separator between batches. The last batch need not be followed by "go". bsqldb makes use of the DB-Library API provided by FreeTDS. This API is of course also available to application developers. OPTIONS
-U username Database server login name. If username is not provided, a domain login is attempted for TDS 7+ connections. -P password Database server password. -S servername Database server to which to connect. -D database Database to use. -i input_file Name of script file, containing SQL. -o output_file Name of output file, holding result data. -e error_file Name of file for errors. -t field_term Specifies the field terminator. Default is two spaces (' '). Recognized escape sequences are tab (' '), carriage return (' '), newline (' '), and backslash ('\'). -h Print column headers with the data to the same file. -H hostname Override name of client sent to server. -q Do not print column metadata, return status, or rowcount. Overrides -h. -v Verbose mode, for more information about the DB-Libraryrary interaction. This also reports the result set metadata, including and return code. All verbose data are written to standard error (or -e), so as not to interfere with the data stream. ENVIRONMENT
DSQUERY default servername NOTES
bsqldb is a filter; it reads from standard input, writes to standard output, and writes errors to standard error. The -i, -o, and -e options override these, of course. The source code for bsqldb is intended as a model for DB-Library users. DB-Library has a rich set of functions, and it can be hard some- times to understand how to use them, particularly the first time. If you are using it in this way and find something unclear, you are encouraged to email the author your comments. EXIT STATUS
bsqldb exits 0 on success, and >0 if the server cannot process the query. bsqldb will report any errors returned by the server, but will continue processing. In a production environment, this behavior may be insufficiently stringent. To make it extremely intolerant of errors, change the message and error handlers to call exit(3). HISTORY
bsqldb first appeared in FreeTDS 0.63. AUTHORS
The bsqldb utility was written by James K. Lowden <jklowden@schemamania.org> BUGS
Microsoft servers as of SQL Server 7.0 SP 3 do not return output parameters unless the RPC functions are used. This means bsqldb cannot return output parameters for stored procedures with these servers. doc 13 November 2011 bsqldb(1)
All times are GMT -4. The time now is 10:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy