Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Pass value from sqlplus to shell on AIX Post 303037224 by tricampeon81 on Friday 26th of July 2019 09:30:25 AM
Old 07-26-2019
Pass value from sqlplus to shell on AIX

hello friend good morning
I have a problem, how can I take the value that the PROCEDURE returns to me in the variable "CodError", when the connection to the bbdd is closed I lose the value and I need it in the shell

Code:
#AIX
cat <<EOF | sqlplus -s ${ORA_LOGIN}/${ORA_PASSWORD} > $logftmp
   set feedback off;
   set serveroutput on size 1000000
   set line 500;
   DECLARE
     coderror    NUMBER;
     desc_error  varchar2(200);
     fecha_ini   VARCHAR2(10);
     fecha_aux    varchar2(10);
   BEGIN
      coderror   :=0;
      desc_error :=null;
       RPY_OMSJSOSTKPTG(coderror,desc_error);
       dbms_output.put_line('CodError:' || CodError);
       dbms_output.put_line('Desc Error:' || desc_error);

   EXCEPTION
     WHEN OTHERS THEN
       dbms_output.put_line('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM);
   END;
/
   exit;
EOF
echo "controlo error"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass Shell variables to sqlplus use them as parameters

Hi, I am trying to pass some of the variables in my shell scripts to the sqlplus call and use them as parameters. For example, I would like to replace the 'SAS', and '20050612' with $var1 and $var2, respectively, how can I do that? --------------------------------------------------------... (1 Reply)
Discussion started by: Jtrinh
1 Replies

2. Shell Programming and Scripting

How to pass variable to SQLPLUS in a ksh script?

Hi, I am writing a ksh script which will use sqlplus to run a sql and pass 2 variables as the SQL request. In the ksh script, I have 2 variables which are $min_snap and $max_snap holding 2 different numbers. Inside the same script, I am using SQLPLUS to run an Oracle SQL script,... (6 Replies)
Discussion started by: rwunwla
6 Replies

3. UNIX for Advanced & Expert Users

How to pass unix variable to SQLPLUS

hi fellows, can any body tell me how to pass unix variables to oracle code is... #! /bin/ksh echo ENTER DATE VALUE's read START_DATE END_DATE sqlplus xyx/abc@oracle select * from table1 where coloumn1 between $START_DATE and $END_DATE; is this is correct way........... Thanks in... (1 Reply)
Discussion started by: chiru
1 Replies

4. Shell Programming and Scripting

To pass the .sql file as a paramter to sqlplus through shell programming

Hi, Currently i have a .sql file 1.sql. I need to pass that as a parameter through a shell script to the sqlplus inside the same shell script. How I should I do.can anyone help me pls. I have an req where I need to send the .sql file and the place where the script has to create a .csv... (9 Replies)
Discussion started by: Hemamalini
9 Replies

5. Shell Programming and Scripting

How to pass parameter from sqlplus(procedure completed) to your shell script

if then # mail -s "Import failed file does not exist" sanjay.jaiswal@xyz.com echo "FILE does not exist" exit 1 fi echo "FILE EXIST" size=-1 set $(du /export/home/oracle/nas/scott21.dmp.gz) while do echo "Inside the loop" size=$1 set $(du... (1 Reply)
Discussion started by: sanora600
1 Replies

6. Shell Programming and Scripting

AIX ksh: how to pass variable to host shell

I have a script that "runs" a script. For example: ./runscript.ksh pcnmc01.ksh runscript puts pcnmc01.ksh into the background with log output going to the logfile. After executing the command, I get this output: Running script in the background: pcnmc01.ksh Logfile:... (2 Replies)
Discussion started by: Eben Yong
2 Replies

7. Shell Programming and Scripting

Can't get shell parameters to pass properly to sqlplus

Gurus, The issue I'm having is that my Shell won't accept SQL parameters properly...... Here's they way I'm running it.... applmgr@ga006hds => sh CW_MigrationDeployScript.sh apps <appspwd> <SID> '01-JAN' '31-MAR' The process just hangs not submitting the SQL job... ... (3 Replies)
Discussion started by: WhoDatWhoDer
3 Replies

8. Shell Programming and Scripting

How to pass Variable from shell script to select query for SqlPlus?

echo "set echo off"; echo "set feedback off"; echo "set linesize 4000"; echo " set pagesize 0"; echo " set sqlprompt ''"; echo " set trimspool on"; Select statement is mentioned below echo "select res.ti_book_no from disney_ticket_history res where res.ti_status =${STATUS} and... (7 Replies)
Discussion started by: aroragaurav.84
7 Replies

9. Programming

How to pass parameter from file to sqlplus in UNIX?

i have file in which i have employee id are there and every time number of employee id are different in file means number of count of employee id in file are every time different. 343535435 365765767 343534543 343543543 i want to pass this file to sqlplus and sql command is ... (7 Replies)
Discussion started by: pallvi_mahajan
7 Replies

10. Shell Programming and Scripting

Pass a VARIABLE to sqlplus script

Hi Team, I am trying to run a sqlplus script against several databases via a FOR/LOOP and also passing the loop variable to a sqlplus script I am calling, as follows: #!/bin/bash export ORACLE_SID=plgc1 export ORACLE_HOME=/opt/oracle/product/11.2.0.2/db_1 export... (1 Reply)
Discussion started by: jonnyd
1 Replies
roar_vs_connection_obj(3)				   RoarAudio Programmer's Manual				 roar_vs_connection_obj(3)

NAME
roar_vs_connection_obj, roar_vs_stream_obj, roar_vs_vio_obj - VS API interface for use of main API SYNOPSIS
#include <roaraudio.h> struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error); struct roar_stream * roar_vs_stream_obj (roar_vs_t * vss, int * error); struct roar_vio_calls * roar_vs_vio_obj (roar_vs_t * vss, int * error); DESCRIPTION
Those functions return internal connection, stream and VIO object of the VS object. They are used to use the main API with a VS opened stream. roar_vs_connection_obj() returns the connection object used for the control connection to the server. roar_vs_stream_obj() returns the stream object storing information about the stream. roar_vs_vio_obj() returns the VIO object used to read data from or send data to the server. Returned objects are freed as soon as the VS object is closed. If the VS object was created using roar_vs_new_from_con(3) the connection is not closed by the VS object and stay valid after close until it is closed by the program or library. The VIO object MUST NOT be used while in buffered mode. PARAMETERS
vss The VS object to return internal objects from. error This is a pointer to a integer used to store the error value in case of error. This can be NULL if not used but it is very recom- mended to use this error value to report good error messages to the user. RETURN VALUE
On success these calls return the described object. On error, NULL is returned. EXAMPLES
FIXME SEE ALSO
roarvs(7), libroar(7), RoarAudio(7). RoarAudio May 2011 roar_vs_connection_obj(3)
All times are GMT -4. The time now is 06:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy