Sponsored Content
Top Forums UNIX for Advanced & Expert Users Extract Oracle DB Connect and SQL execution log Post 302446837 by mirage0809 on Thursday 19th of August 2010 11:41:26 PM
Old 08-20-2010
|& is to open the sqlplus thread asynchronously in the background, and we enter the sql statements in the pipe using print p.

removing -s is of no use as I am still not able to capture the errors for individual sql stmt and check the DB connection before proceeding further.

We want to capture any errors thrown dynamically

Last edited by mirage0809; 08-20-2010 at 06:40 AM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Connect From VB to SQL Server

Dear All Now I can't connect from VB to Sybase on Unix. How could I do? Please help me. (0 Replies)
Discussion started by: Than Chanroeun
0 Replies

2. Shell Programming and Scripting

Oracle SQL Query & connect?

Hi I'm looking to query a table on a database and then iterate over the results in a loop. I believe this is the last part of my script that I need (after finding out threads for passing variables to other scripts and calling functions in other scripts). I've searched the forums but the best... (8 Replies)
Discussion started by: Dird
8 Replies

3. Shell Programming and Scripting

Perl connect to remote oracle db without local oracle installation

I want to use Perl to connect to a remote Oracle DB I have no oracle installation on my server (and dont plan on installing one) I am using solaris 9 on x86 server. Is this possible? I basically want to run some basic sql queries on the remote oracle db which I have access to using perl on my... (0 Replies)
Discussion started by: frustrated1
0 Replies

4. Shell Programming and Scripting

Unable to connect to SQL through unix

I am trying to connect to SQL plus through unix but i am getting below error 'ksh: sqlplus: not found' note i am running this from /home/xxx do i need to set any environmental variable for this. below is my code echo " hello world" sqlplus -s apps/CAF78GEN<<EOF set heading... (4 Replies)
Discussion started by: karnatis
4 Replies

5. Shell Programming and Scripting

Switching user to oracle to connect Oracle 11g DB with 'sysdba'

I need to connect my Oracle 11g DB from shell script with 'sysdba' permissions. To do this I have to switch user from 'root' to 'oracle'. I've tried the following with no success. su - oracle -c "<< EOF1 sqlplus -s "/ as sysdba" << EOF2 whenever sqlerror exit sql.sqlcode;... (2 Replies)
Discussion started by: NetBear
2 Replies

6. SuSE

Connect to SQL server from Linux

I am trying to establish connection with SQL server 2008 through ODBC on Linux. First step would be 1. How to verify if ODBC driver for SQL server is installed on Linux OS. PLease let me know how to do it/ if there is any link which could be helpful in this context. thanks in advance (1 Reply)
Discussion started by: cvsanthosh
1 Replies

7. Shell Programming and Scripting

Connect once db disconnect after all execution

Hi All, Please see the below code. it is working fine when in 'test_file' have only one emplid. test_file contains only emplid and date, like below ... 0000221|1/12/2003 0000223|1/1/1996 Problem :- when test_file contains more then one records(emplids) it is not giving any errors... (3 Replies)
Discussion started by: krupasindhu18
3 Replies

8. Shell Programming and Scripting

Extract Oracle sql queries from .fmb and .rdf files

Hi all, Thanks for your time! Regards, (1 Reply)
Discussion started by: a1_win
1 Replies

9. 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

10. AIX

Connect to a SQL server from AIX

Hello aix community, After scouring the internet to find a step by step process, I've exhausted my efforts. Although I have learned a lot which brings me to this forum. I'm totally new and hope to ask the right questions. What is the easiest way to connect to a SQL server from aix? ... (2 Replies)
Discussion started by: TechStudent36
2 Replies
SQLSRV_SEND_STREAM_DATA(3)												SQLSRV_SEND_STREAM_DATA(3)

sqlsrv_send_stream_data - Sends data from parameter streams to the server

SYNOPSIS
bool sqlsrv_send_stream_data (resource $stmt) DESCRIPTION
Send data from parameter streams to the server. Up to 8 KB of data is sent with each call. PARAMETERS
o $stmt - A statement resource returned by sqlsrv_query(3) or sqlsrv_execute(3). RETURN VALUES
Returns TRUE if there is more data to send and FALSE if there is not. EXAMPLES
Example #1 sqlsrv_send_stream_data(3) example <?php $serverName = "serverNamesqlexpress"; $connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password" ); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { die( print_r( sqlsrv_errors(), true)); } $sql = "UPDATE Table_1 SET data = ( ?) WHERE id = 100"; // Open parameter data as a stream and put it in the $params array. $data = fopen( "data://text/plain,[ Lengthy content here. ]", "r"); $params = array( &$data); // Prepare the statement. Use the $options array to turn off the // default behavior, which is to send all stream data at the time of query // execution. $options = array("SendStreamParamsAtExec"=>0); $stmt = sqlsrv_prepare( $conn, $sql, $params, $options); sqlsrv_execute( $stmt); // Send up to 8K of parameter data to the server // with each call to sqlsrv_send_stream_data. $i = 1; while( sqlsrv_send_stream_data( $stmt)) { $i++; } echo "$i calls were made."; ?> SEE ALSO
sqlsrv_prepare(3), sqlsrv_query(3). PHP Documentation Group SQLSRV_SEND_STREAM_DATA(3)
All times are GMT -4. The time now is 05:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy