K shell with Oracle


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting K shell with Oracle
# 1  
Old 01-14-2008
K shell with Oracle

--------------------------------------------------------------------------------

Hi,
I am getting values from oracle database and splitting with "|".
When i loop thru the $OUTPUT i am getting so many new line characters.

Please help me why i am getting so many line and how to get rid of the same.


below is the code i am using.

OUTPUT=`sqlplus -s <<-!
$DBLOGIN
whenever sqlerror exit failure
set pages 0 feed off echo off
select SEQNO,'|',MESSAGE_ID,'|'
from triton.cims_msg_out;
exit
!`

let count=0
IFS="|"
for variable in $OUTPUT
do
echo "variable ======= $variable"
#file=$(echo $variable | awk '{FS = "." } {print $1}')
#ext=$(echo $variable | awk '{FS = "." } {print $2}')
file=${variable%.*}
ext=${variable#*.}

done
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help on Oracle insert from shell script

Hi All I am trying to create a shell script to insert in to oracle table so far insert happens with out an issue, but i cant pass message variable to sqlplus script insert. i have highlighted the variable in red. Please help. thanks in advance. #!/bin/sh df -H | grep -vE... (3 Replies)
Discussion started by: LPK
3 Replies

2. Shell Programming and Scripting

Oracle to shell script

hi , i have some procedures that were written in oracle (sql/plsql). I need to convert them into shell scripts. So is there any procedure to this. or any tools available to do this. I need some guidance on this as i am totally new . I dont know shell scripting at all. My main target get the logic... (5 Replies)
Discussion started by: harishbabuy
5 Replies

3. Shell Programming and Scripting

Connecting to ORACLE through SHELL

Hi, I am trying to connect to oracle database (9.2.0.7.0) through Sun solaris. But I am unable to do so. The content of my script is as follows: Shell Sript: RESULT=`$ORACLE_HOME/bin/sqlplus schema/'pwd'@db << EOF set echo on; set feedback on; @/home/count/qry.sql` echo... (10 Replies)
Discussion started by: fidelis
10 Replies

4. Shell Programming and Scripting

Getting value from oracle to unix shell

All, I am using Sun Solaris and Oracle 10g. I have a simple shell script returning a value. #!/usr/bin/ksh dummyvar=`sqlplus -s '/as sysdba' <<END set feedback off; set verify off; set serveroutput on; select num from scott.num1; END` echo $dummyvar For the above script - i... (5 Replies)
Discussion started by: user7509
5 Replies

5. UNIX for Advanced & Expert Users

Shell menus And Oracle

Dear All, Kindly suggest on how should i proceed with the following requirement I need to develop an interactive shell script menu which would enable the user to inquire the value of a column based on a key value . The output can be more records.. Also is it possible to do the following 1)... (2 Replies)
Discussion started by: ksm
2 Replies

6. Shell Programming and Scripting

Korn Shell and Oracle

Hi Guys, I haven't worked on oracle much but I have a situation where I have to do bdf in all the servers and insert that information into oracle table. I have already created table which have 7 columns, I can insert manually but I dont know how to insert that using Korn shell. SERVER_ID ... (9 Replies)
Discussion started by: pareshan
9 Replies

7. AIX

Accessing Oracle DB via Shell possible ?

At work we are using AIX 4.2 for the client. On this system, there is Oracle and kron, Bash and C shell. Is it possible to access Oracle via the shell to create/update tables ? There is this hourly data that we accumulate on the AIX and we manually copy the infos to Excel for stats. I thought... (2 Replies)
Discussion started by: Browser_ice
2 Replies

8. Shell Programming and Scripting

Shell Scripting with Oracle...

Hi guys, I have searched all the forums and searched the net as much as possible, but I carn't find any tutorials about shell scripting with Oracle. Has anyone come across any? Thanks for reading and in advance of posts, B14... (2 Replies)
Discussion started by: B14speedfreak
2 Replies

9. Shell Programming and Scripting

ORACLE from Shell scripts

Hi, I have Oracle, and I want to execute simple queries in it. Is it possible to do this using a UNIX shell scripts. Are there any commands in Shell scripting where in I can communicate to ORACLE!? Thanks, (2 Replies)
Discussion started by: mohanprabu
2 Replies
Login or Register to Ask a Question
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)