The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Converting Binary decimal coded values to Ascii Values gaur.deepti UNIX for Advanced & Expert Users 3 04-02-2008 09:33 AM
isql query in unix shell script jaydeep_sadaria Shell Programming and Scripting 3 11-14-2007 12:07 AM
isql output d_swapneel14 Shell Programming and Scripting 4 05-23-2006 03:53 AM
regarding isql girish_shukla UNIX for Dummies Questions & Answers 2 10-21-2003 04:15 AM
isql eloquent99 UNIX for Dummies Questions & Answers 2 02-10-2003 11:05 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-24-2005
Registered User
 

Join Date: May 2005
Posts: 48
get values from isql query

hi all

i have an isql sentence in a ksh script, what get some values from my database (Sybase IQ 12.5 - solaris 5.7)

how can i read this sql results??? do i have to do a while?? a for???
where do i put the values??

my idea is put them in an array, is that possible?


please, help me
any idea, thanks

jona
Reply With Quote
Forum Sponsor
  #2  
Old 05-24-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Something to get you started...
Code:
$ more testisql.ksh
#!/bin/ksh

results=`isql -Usa -Pmy_sa_password_goes_here <<EOF
select name from sysobjects where type = "U"
go
EOF`

line_count=0
echo "${results}" | while read line; do
   echo "Line $((line_count = line_count + 1)) is ${line}"
done

exit 0
$ ./testisql.ksh
Line 1 is name
Line 2 is ------------------------------
Line 3 is spt_values
Line 4 is spt_monitor
Line 5 is spt_limit_types
Line 6 is syblicenseslog
Line 7 is spt_ijdbc_table_types
Line 8 is spt_ijdbc_mda
Line 9 is spt_ijdbc_conversion
Line 10 is ijdbc_function_escapes
Line 11 is spt_jdbc_table_types
Line 12 is spt_mda
Line 13 is spt_jtext
Line 14 is spt_jdbc_conversion
Line 15 is jdbc_function_escapes
Line 16 is 
Line 17 is (13 rows affected)
Cheers
ZB
Reply With Quote
  #3  
Old 04-26-2006
Registered User
 

Join Date: Apr 2006
Posts: 3
Hi can you tell me if there is a sybase sql client (iSQL) that works with SCO6 and if so where can I download it from?
Reply With Quote
  #4  
Old 06-27-2008
Registered User
 

Join Date: Jun 2008
Posts: 4
I need help badly

Hi

I am getting leading spaces when i excecute a query in ISQL,is there any option to remove that while in ISQL itself


|LU0001749554|Luxembourg Stock Exchange|Luxembourg Stock Exchange|4081045||D03363767802
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0