Sponsored Content
Top Forums Shell Programming and Scripting DBMS_OUTPUT.PUT_LINE doesn't print values in shell script Post 303038965 by Yoda on Wednesday 18th of September 2019 11:31:20 AM
Old 09-18-2019
You have to use a LOOP to fetch and print all of them:-

Code:
BEGIN
OPEN C1;
LOOP
 FETCH C1 into KS_UID;
 EXIT WHEN C1%NOTFOUND;
 DBMS_OUTPUT.PUT_LINE(KS_UID);
END LOOP;
CLOSE C1;
END;
/

These 2 Users Gave Thanks to Yoda For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day: 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log after I created the crontab file I have also done: $crontab my_crontab I also check to make sure it exists, by using the following... (11 Replies)
Discussion started by: radhika
11 Replies

2. Shell Programming and Scripting

sqlplus and dbms_output.put_line in shell script

Hi, I have created a pl/sql block utilises dbms_output.put_line. This script works fine when I call from sqlplus ie sqlplus @./scriptname but when I embed it within my shell script I get no output to screen so I end up with an empty spool file. I know it's executing successfully when called from... (6 Replies)
Discussion started by: stuck1
6 Replies

3. Shell Programming and Scripting

shell script, echo doesn't work

#!/bin/sh something(){ echo "Inside something" echo $1 $2 } val=$(something "Hello " "world") Output expected: Inside somethingHello world But it's not echoing. (4 Replies)
Discussion started by: cola
4 Replies

4. Programming

How to Format database output (DBMS_OUTPUT.PUT_LINE) in unix?

Dear All, As I'm new here, please forgive me if any rule violation occurred. I have a script like this: #! /bin/ksh # Author : Saptarshi # Date : 18-Mar-2011 # Version : 1.0 Return_op=`sqlplus -s <<ENDOFSQL db_user/db_pass@db_nm WHENEVER SQLERROR EXIT 1 set ... (1 Reply)
Discussion started by: saps19
1 Replies

5. Shell Programming and Scripting

[Solved] How to display only output of DBMS_OUTPUT.PUT_LINE , rest should be neglected

Hi All, I Have written a script through that i am calling sql file Sqlfile.sql set time on set timing on set echo on set head off set scan on set feedback on set serveroutput on set linesize 1000 DECLARE v_acc_no NUMBER(10); v_product_no NUMBER(10); BEGIN... (3 Replies)
Discussion started by: sujit_kashyap
3 Replies

6. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

7. Shell Programming and Scripting

Script doesn't print error.

Hi Gurus, I have below sample script. I expect it print error when running script without input parameter. but the it doesn't. would you please help me about this issue. thanks in advance. /script$cat test.ksh #!/bin/ksh while getopts :f: arg do case $arg in ... (4 Replies)
Discussion started by: ken6503
4 Replies

8. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

9. Shell Programming and Scripting

The shell script doesn't get arguments, but parse them

Hello, I have a simple shell script, which starts from crontab like this: 00 03 * * 2-6 /export/applications/dte/sh/fwmarg.sh > /export/applications/dte/data/cron_log/fwmarg.cronlog.`date +\%m.\%d` 2>&1 The script doesn't get any argument. But inside it I see the line ... (10 Replies)
Discussion started by: digioleg54
10 Replies
OCI_BIND_ARRAY_BY_NAME(3)												 OCI_BIND_ARRAY_BY_NAME(3)

oci_bind_array_by_name - Binds a PHP array to an Oracle PL/SQL array parameter

SYNOPSIS
bool oci_bind_array_by_name (resource $statement, string $name, array &$var_array, int $max_table_length, [int $max_item_length = -1], [int $type = SQLT_AFC]) DESCRIPTION
Binds the PHP array $var_array to the Oracle placeholder $name, which points to an Oracle PL/SQL array. Whether it will be used for input or output will be determined at run-time. PARAMETERS
o $statement - A valid OCI statement identifier. o $name - The Oracle placeholder. o $var_array - An array. o $max_table_length - Sets the maximum length both for incoming and result arrays. o $max_item_length - Sets maximum length for array items. If not specified or equals to -1, oci_bind_array_by_name(3) will find the longest element in the incoming array and will use it as the maximum length. o $type - Should be used to set the type of PL/SQL array items. See list of available types below: o SQLT_NUM - for arrays of NUMBER. o SQLT_INT - for arrays of INTEGER (Note: INTEGER it is actually a synonym for NUMBER(38), but SQLT_NUM type won't work in this case even though they are synonyms). o SQLT_FLT - for arrays of FLOAT. o SQLT_AFC - for arrays of CHAR. o SQLT_CHR - for arrays of VARCHAR2. o SQLT_VCS - for arrays of VARCHAR. o SQLT_AVC - for arrays of CHARZ. o SQLT_STR - for arrays of STRING. o SQLT_LVC - for arrays of LONG VARCHAR. o SQLT_ODT - for arrays of DATE. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 oci_bind_array_by_name(3) example <?php $conn = oci_connect("hr", "hrpwd", "localhost/XE"); if (!$conn) { $m = oci_error(); trigger_error(htmlentities($m['message']), E_USER_ERROR); } $create = "CREATE TABLE bind_example(name VARCHAR(20))"; $stid = oci_parse($conn, $create); oci_execute($stid); $create_pkg = " CREATE OR REPLACE PACKAGE ARRAYBINDPKG1 AS TYPE ARRTYPE IS TABLE OF VARCHAR(20) INDEX BY BINARY_INTEGER; PROCEDURE iobind(c1 IN OUT ARRTYPE); END ARRAYBINDPKG1;"; $stid = oci_parse($conn, $create_pkg); oci_execute($stid); $create_pkg_body = " CREATE OR REPLACE PACKAGE BODY ARRAYBINDPKG1 AS CURSOR CUR IS SELECT name FROM bind_example; PROCEDURE iobind(c1 IN OUT ARRTYPE) IS BEGIN -- Bulk Insert FORALL i IN INDICES OF c1 INSERT INTO bind_example VALUES (c1(i)); -- Fetch and reverse IF NOT CUR%ISOPEN THEN OPEN CUR; END IF; FOR i IN REVERSE 1..5 LOOP FETCH CUR INTO c1(i); IF CUR%NOTFOUND THEN CLOSE CUR; EXIT; END IF; END LOOP; END iobind; END ARRAYBINDPKG1;"; $stid = oci_parse($conn, $create_pkg_body); oci_execute($stid); $stid = oci_parse($conn, "BEGIN arraybindpkg1.iobind(:c1); END;"); $array = array("one", "two", "three", "four", "five"); oci_bind_array_by_name($stid, ":c1", $array, 5, -1, SQLT_CHR); oci_execute($stid); var_dump($array); ?> PHP Documentation Group OCI_BIND_ARRAY_BY_NAME(3)
All times are GMT -4. The time now is 07:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy