Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Control not returning to UNIX when sqlplus is executed in while loop of shell script Post 303045808 by preetham30 on Monday 13th of April 2020 10:53:06 PM
Old 04-13-2020
Thanks for the reply Jim.

So, you are suggesting this is a parameter problem?

Parameter remains the same for my script. That is the select query. I didn't get what you meant by garbage value.

The query executes within fraction of seconds. Initially, I thought that sleep for 1 second could be cause. But, I don't have anything to support it.
 

10 More Discussions You Might Find Interesting

1. Programming

Returning Strings from C program to Unix shell script

Hi, Iam calling a C program from a Unix shell script. The (C) program reads encrypted username/password from a text file , decrypts and returns the decrypted string. Is there any way i can return the decrypted string to Unix shell program. My shell script uses the output of the program to... (11 Replies)
Discussion started by: satguyz
11 Replies

2. Shell Programming and Scripting

Unix shell script couldn't be executed. Pls help!

I have wrriten a script to call sql script to do some work in database. However, the script couldn't be executed. The only information was: ksh: ./updt_attrib.ksh cannot execute. Please help me to identify where the problem is. I post script here for your reference. Thanks a lot. #!/bin/ksh ... (8 Replies)
Discussion started by: duke0001
8 Replies

3. Programming

Returning Strings from C program to Unix shell script

Hi, I'm having a requirement where I need to call a C program from a shell script and return the value from the C program to shell script. I refered a thread in this forum. But using that command in the code, it is throwing an error clear_text_password=$(get_password) Error: bash:... (24 Replies)
Discussion started by: venkatesh_sasi
24 Replies

4. Shell Programming and Scripting

returning un executed string to shell prompt

Hi all, i'm pritty new to chell scripting I'm trying to find a way to return a value to shell without it executing. is there a special character that will encase a sting including the command to a shell without executing, so waiting for the user to press enter. say i wanted to return a value... (3 Replies)
Discussion started by: jvan
3 Replies

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

6. UNIX for Dummies Questions & Answers

calling a unix shell script from sqlplus

I want to execute a shell script from sqlplus prompt and get its output back to sqlplus. Is this possible? if yes just give me an example for doing that. (2 Replies)
Discussion started by: boopathyvasagam
2 Replies

7. UNIX for Dummies Questions & Answers

How to send keyboard inputs toa UNIX command executed from a shell script?

I have a unix command that prompts for 'y'. How do I run this from my shell script? (4 Replies)
Discussion started by: Sree10
4 Replies

8. Shell Programming and Scripting

Control from UNIX script is not returning to the Parent program

Hi All, My program flow is as below Windows batch -- > Cygwin batch --> zsh script There are multiple Cygwin batch scripts that are called from Windows batch file . But when i am executing the first cygwin batch script the control goes to the zsh file and executes and stoping from... (1 Reply)
Discussion started by: Hypesslearner
1 Replies

9. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have a UNIX script which will prepare anonymous oracle pl/sql block in a temporary file in run time and passes this file to sqlplus as given below. cat > $v_Input_File 2>>$v_Log << EOF BEGIN EXECUTE IMMEDIATE 'ALTER SESSION FORCE PARALLEL DML PARALLEL 16'; EXECUTE... (1 Reply)
Discussion started by: vikas_trl
1 Replies

10. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have exactly same issue @vikas_trl had in following link: https://www.unix.com/shell-programming-and-scripting/259854-control-not-returning-sqlplus-calling-unix-shell-script.html I wonder if he or somebody else could find the issue's cause or the solution. Any help would... (4 Replies)
Discussion started by: RicardoQ
4 Replies
INGRES_UNBUFFERED_QUERY(3)						 1						INGRES_UNBUFFERED_QUERY(3)

ingres_unbuffered_query - Send an unbuffered SQL query to Ingres

SYNOPSIS
mixed ingres_unbuffered_query (resource $link, string $query, [array $params], [string $types]) DESCRIPTION
ingres_unbuffered_query(3) sends the given $query to the Ingres server. The query becomes part of the currently open transaction. If there is no open transaction, ingres_unbuffered_query(3) opens a new transac- tion. To close the transaction, you can call either ingres_commit(3) to commit the changes made to the database or ingres_rollback(3) to cancel these changes. When the script ends, any open transaction is rolled back (by calling ingres_rollback(3)). You can also use ingres_autocommit(3) before opening a new transaction to have every SQL query immediately committed. Ingres allows only a single unbuffered statement to be active at any one time. The extension will close any active unbuffered statements before executing any SQL. In addition you cannot use ingres_result_seek(3) to position the row before fetching. Note Related Configurations See also the ingres.describe and ingres.utf8 directives in Runtime Configuration. PARAMETERS
o $link - The connection link identifier o $query - A valid SQL query (see the Ingres SQL reference guide) in the Ingres documentation. See the query parameter in ingres_query(3) for a list of SQL statements that cannot be executed via ingres_unbuffered_query(3). Data inside the query should be properly escaped. o $params - An array of parameter values to be used with the query o $types - A string containing a sequence of types for the parameter values passed. See the types parameter in ingres_query(3) for the list of type codes. RETURN VALUES
ingres_unbuffered_query(3) returns a query result identifier when there are rows to fetch; else it returns FALSE when there are no rows, as is the case of an INSERT, UPDATE, or DELETE statement. To see if an error occurred, use ingres_errno(3), ingres_error(3), or ingres_errsql- state(3). EXAMPLES
Example #1 Issue a simple un-buffered select <?php $link = ingres_connect("demodb"); $result = ingres_unbuffered_query($link, "select * from user_profile"); while ($row = ingres_fetch_row($result)) { echo $row[1]; echo $row[2]; } ?> Example #2 Passing query parameters to ingres_unbuffered_query(3) <?php $link = ingres_connect("demodb"); $params[] = "Emma"; $query = "select * from user_profile where up_first = ?"; $result = ingres_unbuffered_query($link, $query, $params); while ($row = ingres_fetch_row($result)) { echo $row[1]; echo $row[2]; } ?> Example #3 Inserting a BLOB with parameter types <?php $link = ingres_connect("demodb"); //Open a photo $fh = fopen("photo.jpg","r"); $blob_data = stream_get_contents($fh); fclose($fh); //Prepare parameters $params[] = $blob_data; $params[] = 1201; //Define parameter types $param_types = "Bi"; $query = "update user_profile set up_image = ? where up_id = ?"; $result = ingres_unbuffered_query($link, $query , $params, $param_types); if (ingres_errno()) { echo ingres_errno() . "-" . ingres_error() . " "; } ?> SEE ALSO
ingres_query(3), ingres_fetch_array(3), ingres_fetch_assoc(3), ingres_fetch_object(3), ingres_fetch_row(3), ingres_commit(3), ingres_roll- back(3), ingres_autocommit(3), ingres_set_environment(3), ingres_errno(3), ingres_error(3). PHP Documentation Group INGRES_UNBUFFERED_QUERY(3)
All times are GMT -4. The time now is 12:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy