Sponsored Content
Top Forums Shell Programming and Scripting Calling sql file from shell script with parameters. Post 302433701 by durden_tyler on Wednesday 30th of June 2010 09:20:18 AM
Old 06-30-2010
Quote:
Originally Posted by anil029
...Can you just tell me the reason for having data in extract file from 2nd row not from first?
...
Sorry, I don't think I understand your question.
You want me to tell you why your extract file has data from 2nd row and not from the first ??

Is your SQL statement similar to the following ?

Code:
SELECT col1||chr(9)||col2||chr(9)||col3
FROM table
where col1 ='&1' and col2=`&2';

I have no idea why Oracle would omit the first row.
Unless there's something else you want to add.

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling SQL scripts through Shell Script

Oracle and Scripting gurus, I need some help with this script... I am trying to add the query SELECT * FROM ALL_SYNONYMS WHERE SYNONYM_NAME = 'METADATA' in the current script.... Read the result set and look for the TABLE_NAME field. If the field is pointing to one table eg.... (18 Replies)
Discussion started by: madhunk
18 Replies

2. Shell Programming and Scripting

Problem with Calling sql file from shell script

I have created abc.sh file which will set the environment variables (UNIX env variables as well as ORACLE required variables like ORACLE_SID,ORACLE_HOME etc) and then calls a function file which checks for starts some logs and then it will try to execute the .sql file. The .sh, function file are as... (1 Reply)
Discussion started by: sskc
1 Replies

3. UNIX for Advanced & Expert Users

Calling PL/SQL Script in Shell Programming

Hi all, In a shell script I need to pass two parameters to a pl/sql script and get the ouput of the pl/sql script and use it in shell script. For example Shell script : test.sh PL/SQL script : get_id.sql parameter1 parameter2 Actually get_id.sql has a select statement something... (1 Reply)
Discussion started by: lijju.mathew
1 Replies

4. Shell Programming and Scripting

calling sql file from shell script

Hello everybody I need help calling sql file from shell script. Can anyone help me creating a small shell script which calls an sql file . The .sql file should contain some select statements like select emp_no from emp_table; select emp_id from emp_table; And the results should be... (6 Replies)
Discussion started by: dummy_needhelp
6 Replies

5. Shell Programming and Scripting

Calling SQL LDR and SQL plus scripts in a shell script

Hi- I am trying to achieve the following in a script so I can schedule it on a cron job. I am fairly new to the unix environment... I have written a shell script that reads a flat file and loads the data into an Oracle table (Table1) via SQLLDR. This Works fine. Then, I run a nested insert... (5 Replies)
Discussion started by: rajagavini
5 Replies

6. Shell Programming and Scripting

Calling sql in shell script with parameters

Dear All, I want to call an sql script within a unix shell script. I want to pass a parameter into the shell script which should be used as a parameter in teh sql script. e.g $ ./shell1.sh 5000129 here 5000129 is a prameter inside shell script i am calling one sql script e.g. ... (2 Replies)
Discussion started by: Radhe
2 Replies

7. UNIX for Advanced & Expert Users

Calling sql file from shell script

Hi I have a shell script that call a sql file. The sql file will create a spool file. My requirement is, when ever i get an OS error like file not found. I have to log it in a log file. Could some who worked in a like scenario help me by giving the code sample. Many Thanks.. (1 Reply)
Discussion started by: chintapalli001
1 Replies

8. Shell Programming and Scripting

calling a sql file in my shell script

Hi, I want to call a sql file in my shell script. see the below code:- if ] then ( isql -U${S_USER} -S${S_SERV} -w100 -b -h0 <<ENDSQL | sed -e "s/Password://" ${S_PWD} set nocount on go use ${S_DB} go // need to call a file name... (16 Replies)
Discussion started by: dazdseg
16 Replies

9. Shell Programming and Scripting

shell script hangs while calling sql file

I have a master shell script which calls some 40 shell scripts. All the shell scripts calls a sql file which executes some sql statements. I run these scripts in parallel such that it saves me time. When i executed them i saw some strange behavior. Firstly, I found that some scripts among the 40... (1 Reply)
Discussion started by: sushi
1 Replies

10. Shell Programming and Scripting

[Solved] Calling PL/SQL Block into Shell Script

Hi, i have one simple PL/SQL Block and i have saved it as .sql file, which i am trying to call from UNIX script. PL/SQL block structure CONNECT DB_NAME/PWD@Database whenever SQLERROR EXIT 1; Declare ..Variables... BEGIN --Code-- exception END; exit; I have save this block as... (3 Replies)
Discussion started by: abhii
3 Replies
MAXDB_STMT_BIND_RESULT(3)						 1						 MAXDB_STMT_BIND_RESULT(3)

maxdb_stmt_bind_result - Binds variables to a prepared statement for result storage

       Procedural style

SYNOPSIS
bool maxdb_stmt_bind_result (resource $stmt, mixed &$var1, [mixed &$...]) DESCRIPTION
Object oriented style bool maxdb_stmt::bind_result (mixed &$var1, [mixed &$...]) maxdb_stmt_bind_result(3) is used to associate (bind) columns in the result set to variables. When maxdb_stmt_fetch(3) is called to fetch data, the MaxDB client/server protocol places the data for the bound columns into the specified variables $var1, .... Note Note that all columns must be bound prior to calling maxdb_stmt_fetch(3). Depending on column types bound variables can silently change to the corresponding PHP type. A column can be bound or rebound at any time, even after a result set has been partially retrieved. The new binding takes effect the next time maxdb_stmt_fetch(3) is called. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } /* prepare statement */ if ($stmt = $maxdb->prepare("SELECT zip, name FROM hotel.city ORDER BY name")) { $stmt->execute(); /* bind variables to prepared statement */ $stmt->bind_result($col1, $col2); /* fetch values */ while ($stmt->fetch()) { printf("%s %s ", $col1, $col2); } /* close statement */ $stmt->close(); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } /* prepare statement */ if ($stmt = maxdb_prepare($link, "SELECT zip, name FROM hotel.city ORDER BY name")) { maxdb_stmt_execute($stmt); /* bind variables to prepared statement */ maxdb_stmt_bind_result($stmt, $col1, $col2); /* fetch values */ while (maxdb_stmt_fetch($stmt)) { printf("%s %s ", $col1, $col2); } /* close statement */ maxdb_stmt_close($stmt); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: 12203 Albany 60601 Chicago 60615 Chicago 45211 Cincinnati 33575 Clearwater 75243 Dallas 32018 Daytona Beach 33441 Deerfield Beach 48226 Detroit 90029 Hollywood 92714 Irvine 90804 Long Beach 11788 Long Island 90018 Los Angeles 70112 New Orleans 10019 New York 10580 New York 92262 Palm Springs 97213 Portland 60018 Rosemont 95054 Santa Clara 20903 Silver Spring 20005 Washington 20019 Washington 20037 Washington SEE ALSO
maxdb_stmt_bind_param(3), maxdb_stmt_execute(3), maxdb_stmt_fetch(3), maxdb_prepare(3), maxdb_stmt_prepare(3), maxdb_stmt_init(3), maxdb_stmt_errno(3), maxdb_stmt_error(3). PHP Documentation Group MAXDB_STMT_BIND_RESULT(3)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy