Sponsored Content
Top Forums Shell Programming and Scripting Capturing SQL O/P in Unix Script Post 302349668 by jim mcnamara on Tuesday 1st of September 2009 01:05:01 PM
Old 09-01-2009
Code:
echo "
set pages 0
set feed off
select count(*) from mytable;
exit
" | sqlplus -s username/pwd@dbname | tr -d '[:space:]' | read value
if [[ $value -eq 1 ]] ; then
  # do something
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to call pl/sql in unix script

sample code as following: test_sql(){ #test#echo test_sql str=`$ORACLE_BIN/sqlplus -s $user/$passwd <<EOM set verify off set heading off set feedback off #--------start pl/sql { DECLARE CURSOR pah_cs IS select id from table where letter = 'abcd';... (6 Replies)
Discussion started by: YoYo
6 Replies

2. UNIX for Advanced & Expert Users

Calling unix script from sql or plsql

Hi Can anyone please let me know how to call unix scripts from sql or plsql ASAP. (2 Replies)
Discussion started by: ksailesh
2 Replies

3. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

4. UNIX for Dummies Questions & Answers

Execute PL/SQL function from Unix script (.sql file)

Hi guys, I am new on here, I have a function in oracle that returns a specific value: create or replace PACKAGE BODY "CTC_ASDGET_SCHED" AS FUNCTION FN_ASDSCHEDULE_GET RETURN VARCHAR2 AS BEGIN DECLARE ASDSchedule varchar2(6); ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies

5. UNIX for Advanced & Expert Users

How to use parameter in sql script pass from unix script?

Hi, I am unable to use parameter in sql script passed from unix script. my sql script CREATE_SBI_LIST_GROUP.sql is like this - ------------------------------- SELECT SDS.ID "SO_ID", SDS.SO a1, sgp.sga__code SGA_CODE, FROM sga sga,sales_genl_provision sgp , comm_product_condn cpc... (2 Replies)
Discussion started by: apskaushik
2 Replies

6. UNIX for Advanced & Expert Users

Use of Oracle pl/sql in UNIX shell script

Hi, I have basic knowledge on how to write pl/sql code inside shell script. I am looking for more advance thing. Is there any book for that which can just talk about how to write more advance plsql code inside shell script. Please help Thanks!!!!!! (1 Reply)
Discussion started by: diehard
1 Replies

7. Shell Programming and Scripting

Capturing Oracle SQL Error Codes

My issue pertains to earlier posts like exit unix script after sqlerror in procedure - dBforums SQLPLUS Error Capturing | Unix Linux Forums | Shell Programming and Scripting We are executing PL/SQL blocks from shell scripts using SQLPLUS. The error code has to be captured into a logfile that... (3 Replies)
Discussion started by: jerome_rajan
3 Replies

8. Shell Programming and Scripting

How can i run sql queries from UNIX shell script and retrieve data into text docs of UNIX?

Please share the doc asap as very urgently required. (1 Reply)
Discussion started by: 24ajay
1 Replies

9. Shell Programming and Scripting

How to pass Oracle sql script as argument to UNIX shell script?

Hi all, $ echo $SHELL /bin/bash Requirement - How to pass oracle sql script as argument to unix shell script? $ ./output.sh users.sql Below are the shell scripts and the oracle sql file in the same folder. Shell Script $ cat output.sh #!/bin/bash .... (7 Replies)
Discussion started by: a1_win
7 Replies

10. Shell Programming and Scripting

Call sql script from UNIX shell script

I know this question is out there in many forums, but I tried all the combinations in vain. I'm basically trying to call a sql script from a shell script. Below is my sql script (plsql.sql) DELCARE v_empno NUMBER := '&empno'; BEGIN select ename,sal from emp where empno = v_empno;... (3 Replies)
Discussion started by: FName_LName
3 Replies
Alzabo::Debug(3pm)					User Contributed Perl Documentation					Alzabo::Debug(3pm)

NAME
Alzabo::Debug - Creates constants used to turn on debugging SYNOPSIS
export ALZABO_DEBUG='SQL|TRACE' ... load and run code using Alzabo ... export ALZABO_DEBUG=METHODMAKER ... load and run code using Alzabo ... DESCRIPTION
This module creates constants used by other modules in order to determine what debugging output should be generated. The interface is currently experimental. USAGE
Currently, the only way to turn on debugging is by setting the "ALZABO_DEBUG" environment variable. This variable can contain various flags, each separated by a pipe char (|). Each flag turns on different types of debugging output. These flags must be set before Alzabo is loaded, as debugging is turned on or off through the use of constants. The current flags are: * SQL Generated SQL and its associated bound variables. * TRACE A stack trace will be generated any time SQL is generated. * METHODMAKER The "Alzabo::MethodMaker" module will generate verbose output describing the methods it is creating. * REVERSE_ENGINEER The modules involved in reverse-engineering will generate output describing what it finds during reverse-engineering. * ALL Turn on all flags. For now, all debugging output is sent to "STDERR". perl v5.8.8 2007-12-23 Alzabo::Debug(3pm)
All times are GMT -4. The time now is 05:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy