Sponsored Content
Top Forums Shell Programming and Scripting Connecting to Oracle Database Post 57990 by bhargav on Thursday 11th of November 2004 01:33:28 PM
Old 11-11-2004
OR


u can redirect the sql's o/p to a file and read it to a variable.
This is waht we do while pulling up the informix database using 'dbaccess'

Is there any good way of doing it using 'dbaccess' ????
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem in Connecting to Oracle Database using KornShell

Hello, I am very new to Scripting. I am having a Kornshell Script below for connecting to Oracle database. But getting an error while executing it. #!/bin/ksh ssh -X root@192.168.2.127 <perimuka> sleep 5 su - oracle sqlplus <mraghunandanan>/<peri123> <<eof Can anyone tell what is wrong... (3 Replies)
Discussion started by: mraghunandanan
3 Replies

2. Shell Programming and Scripting

Connecting to oracle database from shell script

Hi all, I am satyakiran , i am new to the forum. i never done shell scripts for connecting to the data base (oracle) and fetching the data from the database( thru sql select statements ) i want to know 1. how to connect to the data base(oracle) using shell script 2. how to retrieve data... (8 Replies)
Discussion started by: satyakiran
8 Replies

3. Shell Programming and Scripting

Connecting to Database

Hi, I want to write a shell script which connects to a Database, executes a set of SQLs and displays a message for every SQL that was run whether any records have been returned or not? Can anyone help me in this regard? Appreciate your help and concern. Thanks, Dave (1 Reply)
Discussion started by: yoursdavinder
1 Replies

4. Shell Programming and Scripting

Connecting to oracle database

Hai i want to connect to oracle database from user input and create a view. ${ECHO} "Debut Creating View" ${ECHO} "Please Enter the User Name:" read user_name ${ECHO} "Please Enter the Connection String:" read con_string ${ECHO} "Please Enter the Password:" read pwd... (3 Replies)
Discussion started by: shenthil76
3 Replies

5. Solaris

Connecting to Oracle database

Hi guys, long time no typing :D I have problems when I try to connect to Oracle database from SQL Developer which is located on my Windows box. Server is running Solaris 11/11 and Oracle 11 enterprise. I can log in locally with sys account to database, start it up and shut it down but when I... (2 Replies)
Discussion started by: solaris_user
2 Replies

6. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies
DB2_LOB_READ(3) 							 1							   DB2_LOB_READ(3)

db2_lob_read - Gets a user defined size of LOB files with each invocation

SYNOPSIS
string db2_lob_read (resource $stmt, int $colnum, int $length) DESCRIPTION
Use db2_lob_read(3) to iterate through a specified column of a result set and retrieve a user defined size of LOB data. PARAMETERS
o $stmt - A valid stmt resource containing LOB data. o $colnum - A valid column number in the result set of the stmt resource. o $length - The size of the LOB data to be retrieved from the stmt resource. RETURN VALUES
Returns the amount of data the user specifies. Returns FALSE if the data cannot be retrieved. EXAMPLES
Example #1 Iterating through different types of data <?php /* Database Connection Parameters */ $db = 'SAMPLE'; $username = 'db2inst1'; $password = 'ibmdb2'; /* Obtain Connection Resource */ $conn = db2_connect($db,$username,$password); if ($conn) { $drop = 'DROP TABLE clob_stream'; $result = @db2_exec( $conn, $drop ); $create = 'CREATE TABLE clob_stream (id INTEGER, my_clob CLOB)'; $result = db2_exec( $conn, $create ); $variable = ""; $stmt = db2_prepare($conn, "INSERT INTO clob_stream (id,my_clob) VALUES (1, ?)"); $variable = "THIS IS A CLOB TEST. THIS IS A CLOB TEST."; db2_bind_param($stmt, 1, "variable", DB2_PARAM_IN); db2_execute($stmt); $sql = "SELECT id,my_clob FROM clob_stream"; $result = db2_prepare($conn, $sql); db2_execute($result); db2_fetch_row($result); $i = 0; /* Read LOB data */ while ($data = db2_lob_read($result, 2, 6)) { echo "Loop $i: $data "; $i = $i + 1; } $drop = 'DROP TABLE blob_stream'; $result = @db2_exec( $conn, $drop ); $create = 'CREATE TABLE blob_stream (id INTEGER, my_blob CLOB)'; $result = db2_exec( $conn, $create ); $variable = ""; $stmt = db2_prepare($conn, "INSERT INTO blob_stream (id,my_blob) VALUES (1, ?)"); $variable = "THIS IS A BLOB TEST. THIS IS A BLOB TEST."; db2_bind_param($stmt, 1, "variable", DB2_PARAM_IN); db2_execute($stmt); $sql = "SELECT id,my_blob FROM blob_stream"; $result = db2_prepare($conn, $sql); db2_execute($result); db2_fetch_row($result); $i = 0; /* Read LOB data */ while ($data = db2_lob_read($result, 2, 6)) { echo "Loop $i: $data "; $i = $i + 1; } } else { echo 'no connection: ' . db2_conn_errormsg(); } ?> The above example will output: Loop 0: THIS I Loop 1: S A CL Loop 2: OB TES Loop 3: T. THI Loop 4: S IS A Loop 5: CLOB Loop 6: TEST. Loop 0: THIS I Loop 1: S A BL Loop 2: OB TES Loop 3: T. THI Loop 4: S IS A Loop 5: BLOB Loop 6: TEST. SEE ALSO
db2_bind_param(3), db2_exec(3), db2_execute(3), db2_fetch_row(3), db2_prepare(3), db2_result(3). PHP Documentation Group DB2_LOB_READ(3)
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy