Using isql in korn shell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Using isql in korn shell
# 1  
Old 09-25-2008
Using isql in korn shell

Hi all,

I have two accounts in a Unix server, the first one uses .tcsh as default shell and the other uses .ksh (korn shell) as default.

When I login using the account with .tcsh default, I can use the isql command and connect to our database server. However, when I use the other account that uses korn shell (.ksh) as default, the isql does not work. Unix does not recognise it.

I noticed that in the .tcsh account, i have these two files .login and .tcshrc, which I think contain the configuration to connect to our database server.

I tried copying these files to my .ksh account, and even tried renaming the file .tcshrc to .cshrc but still, the .ksh account does not recognise the isql command.

Any suggestions how I can make my .ksh account recognise isql? I also noticed that even though i have this .login file in my .ksh account, it does not load. (as the echo command is not being displayed)

Thank you.
# 2  
Old 09-25-2008
Find where the isql binary resides ( find / | grep isql ), and put in your PATH for ksh, and if not even echo is working I would check the PATH and make sure it has /usr/bin:/usr/sbin:/sbin:/usr/local/bin etc or symlink the isql binary to /usr/bin or something like that and make sure it is in your PATH. echo $PATH will show you the current PATH variable. do
Code:
export PATH=$PATH:/dir/with/isql

the PATH variable is where unix stores the locations of command commands so you do not need to type the absolute path every time you want to execute them. hope this helps
# 3  
Old 09-25-2008
thank you raidzero.

However, when I tried using find / | grep isql, the command returns too many directories and most of them displays "Permission denied" at the end of the directory. e.g.

find: cannot read dir /var/sadm/patch/: Permission denied
find: cannot read dir /var/adm/db/patchlogs: Permission denied
find: cannot read dir /var/spool/cron/crontabs: Permission denied
find: cannot read dir /var/spool/clientmqueue: Permission denied
find: cannot read dir /var/spool/mqueue: Permission denied
find: cannot read dir /var/krb5/rcache/root: Permission denied
find: cannot read dir /var/fm/fmd/xprt: Permission denied
find: cannot read dir /var/fm/fmd/rsrc: Permission denied
find: cannot read dir /var/fm/fmd/ckpt: Permission denied
find: cannot read dir /var/preserve/casaall: Permission denied
find: cannot read dir /var/preserve/chuljay: Permission denied
find: cannot read dir /var/preserve/cheherb: Permission denied
find: cannot read dir /var/cron: Permission denied
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Help with isql in Shell Script

Hi Guys, I need help with my code. I am not able to find what the error is (tried debugging and everything). #! /bin/sh # MODSET_CLOSE # Usage: modset_close echo "Enter the Type of Modsets that needs to be Closed: " read mod_typ serv_name=`cat $mod_typ | awk '{ print $1 }'`... (5 Replies)
Discussion started by: gkrish
5 Replies

2. Shell Programming and Scripting

Help With isql in shell script

Hello I am not able to get the isql output to temp_res file ... i have tried all the different combinations as shown below, but could not get anywhere .... Please Help isql -S $serv_name -U $usr_name -P $pswd -D $db_name -o temp_res << EOF1 select status from modset where... (1 Reply)
Discussion started by: gkrish
1 Replies

3. UNIX for Dummies Questions & Answers

how to use shell variable in isql

Hi , I want to use shell variable in isql. example.. $ksh ./sudh.ksh "2041qwer" sudh.ksh is my script passing the perameter "2041qwer" Code in my script : =========== $SYBASE/$SYBASE_OCS/bin/isql -I$SYBASE/interfaces -S$OTHRSRVR -U$SYBUSER -P$SYBPASS -w... (1 Reply)
Discussion started by: sudhakarpasala
1 Replies

4. Shell Programming and Scripting

isql out in shell script

Hi I wrote a script for connecting isql(Sybase database) and stored the SQL output in Unix box. my script: isql -U${USER} -P${PASS} -S${SERVER} <<EOF > $WORK_DIR/out1.log go select convert(varchar(10),sdcurrent,101) from pr_sysdate go exit EOF Unfortunately, the output file not... (5 Replies)
Discussion started by: koti_rama
5 Replies

5. Shell Programming and Scripting

Isql query in unix shell

Hi i want write a script for list of sysbase are having access or open. then i wrote like: USER="abc" PASS="xyz" SERVER="SCCS" DB="blue" WORK_DIR="/usr/home/ramakrishna" set -x isql -U${USER} -P${PASS} -S${SERVER}<<EOF>$WORK_DIR/output.log go use blue (database name) go use... (0 Replies)
Discussion started by: koti_rama
0 Replies

6. Shell Programming and Scripting

Passing Shell Variables in ISQL

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)
Discussion started by: dikki
0 Replies

7. Shell Programming and Scripting

ISQL Shell Script Question

I am trying to run the following Sybase SQL query in a shell script file. It isn't working although everything else in the file runs, and I can run queries from a file fine. For some reason, entering the query directly doesn't work. Any ideas? #!/bin/sh $SYBASE/$SYBASE_OCS/bin/isql -e... (2 Replies)
Discussion started by: andy_h
2 Replies

8. Shell Programming and Scripting

Setting variable for query using iSql / Korn Shell

Hi All- First time using iSql. I have 4 query files - some have more than 1 line of sql statements After a bit of research it appears I can just use the -i command and specify the input file. Questions: Does it matter that there are multiple queries in each file? Do I need to have... (3 Replies)
Discussion started by: Cailet
3 Replies

9. Shell Programming and Scripting

Setting value of Shell variable from within ISQL

Hi Guys, Need help. I am using ISQL inside a shell script. Is there a way to set the value of shell script variable from inside the ISQL code. I do not want to write the results from the SQL to an output file. Please let me know. Regards, Tipsy. (3 Replies)
Discussion started by: tipsy
3 Replies

10. Shell Programming and Scripting

isql in shell script help

Hello all... i'm trying to execute a shell script through crontab. To run at 8pm on wednesday's The crontab entry: 00 20 * * 3 /u2/dir1/dir2/jobs/p.sh the p.sh file: isql -s claims /u2/dir1/dir3/dir4/a.sql permissions for it are -rwxrwx--x i've confirmed a.sql is in that directory. ... (2 Replies)
Discussion started by: mrviking
2 Replies
Login or Register to Ask a Question