I have searched the forums and other sites and cannot come with the applicable approach for what I am trying to do. I am trying to setup a cron job that executes this script. The script uses iSQL - which is connecting ok - to then query a field and then assign that field to a variable to do an If statement on.
I have tried various different isql statement combinations and cannot get it to work right. The data being returned is the headers and the data. I need the $server variable to equal one string such as "data1" or "data2", which is what is contained in the field from the SELECT statement. Here is the script. Any advice is appreciated!
Last edited by Corona688; 10-17-2012 at 08:35 PM..
hi all ,
i wanted to know if someone knows how can i use
a variable inside another variable
e.g.
#!/bin/csh
foreach test(1 2 3)
set sta_$test = "2"
##now its the problem i want to echo the new var
#$sta_$test , each time with anothe num ($test = 1... (2 Replies)
hi..
i have a big problem, and i hope you cand help me.
i have a program in unix (program.sc). When i run this program manually works OK (including isql and dbisqlc instructions), but when i execute it from the crontab, it works, but the isql and dbisql instructions don't work. This is the... (1 Reply)
hi ,
i have a problem in setting value of $TERM variable in solaris while installing the SUN SPARCT1 simulation environment on ma pc so some one plkease guide me i have attached a snapshot of my error below thankew (1 Reply)
The AppName may be TCS/HCL/SCB.
For All the above 3 i ill have exported TCSDIR/HCLDIR/SCBDIR in .profile with some path.
i'm cnstruct the path in script and trying to cd $VARIABLE, it shows "not found".
Any solution for this....?
> AppName="TCS"
> echo $AppName
TCS
>... (4 Replies)
Hi..
I am passing a variable in my shell function. I need to access it for an isql comand in the shell script.
However the isql o/p gives no results if i pass a variable in the command. The isql command works perfectly fine if i hardcore the table name.
My script is :
... (0 Replies)
I am writing a script with a sed call that needs to use a variable and still have quotations be present in the substitution.
Example:
sed -i "s/Replacable.\+$/Replaced="root@$VAR"/g"
this outputs:
where $VAR = place
Replaced=root@place
and i need
Replaced="root@place"
... (2 Replies)
Hello,
I have a problem combining two variables into one.
I did the following:
in my env variables i had set
PATH_DESTINATION_1=/root/path_one
PATH_DESTINATION_2=/root/path_two
#!/usr/bin/ksh
count=1
count_path=2
while
do (3 Replies)
Hello,
I have a tricky problem:
I have a $file with a variable number of occurrences of "ORA-" (in this case two)
..........
EXP-00008: ORACLE error 3113 encountered
ORA-03113: end-of-file on communication channel
EXP-00056: ORACLE error 1403 encountered
ORA-01403: no data found... (9 Replies)
Hello!
I have a problem to insert variables with sed... And I can't find the solution. :confused:
I would like to display one/few line(s) between 2 values.
This line works well
sed -n '/Dec 12 10:42/,/Dec 12 10:47/p'
Thoses lines with variables doesn't work and I don't find the... (2 Replies)
Discussion started by: Castelior
2 Replies
LEARN ABOUT DEBIAN
bsqlodbc
bsqlodbc(1) FreeTDS Utilities bsqlodbc(1)NAME
bsqlodbc - batch SQL script processor using ODBC
SYNOPSIS
bsqlodbc [-U username] [-P password] [-S server] [-D database]
[-i input_file] [-o output_file] [-e error_file]
[-t field_term] [-qv]
DESCRIPTION
bsqlodbc is a utility program distributed with FreeTDS.
bsqlodbc is a non-interactive equivalent of the "isql" utility programs distributed by Sybase and Microsoft. Like them, bsqlodbc uses the
command "go" on a line by itself as a separator between batches. The last batch need not be followed by "go".
bsqlodbc makes use of the ODBC API provided by FreeTDS. This API is of course also available to application developers.
OPTIONS -U username
Database server login name.
-P password
Database server password.
-S server
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.
-q Do not print column metadata, return status, or rowcount. Overrides -h.
-v Verbose mode, for more information about the ODBC 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.
NOTES
bsqlodbc 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.
EXIT STATUS
bsqlodbc exits 0 on success, and >0 if the server cannot process the query.
HISTORY
bsqlodbc first appeared in FreeTDS 0.65.
AUTHORS
The bsqlodbc utility was written by James K. Lowden <jklowden@freetds.org>
doc 13 November 2011 bsqlodbc(1)