Sponsored Content
Top Forums Shell Programming and Scripting Select variable within a if statement Post 302424365 by ggoliath on Tuesday 25th of May 2010 05:05:29 AM
Old 05-25-2010
here is the diffs file
Code:
more diffs.txt
device for 0117bd1: lpd://172.25.29.60:515
device for 2001bl7: socket://172.25.44.188:9100
device for 2201bl7: socket://172.25.11.170:9100
device for 5001bl1: lpd://172.25.11.203:515
device for 5001x01: lpd://172.25.12.160:515
device for 5001x02: lpd://172.25.12.160:515

 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Want to use the output of Select statement in Unix script

Hi, I have a UNIX script which calls SQL Select statement: Now i want to use the output of that select statement within my UNIX script so as to call different shell script depending upon the output of the select statement. Can anyone help me in this regard. TIA Akhil Goel (4 Replies)
Discussion started by: akhilgoel9
4 Replies

2. UNIX and Linux Applications

Oracle Select IN statement

If I recall, when I used informix I could do a sql statement like: SELECT Value from Table WHERE ID in (100,200,300); How do I do this in Oracle? I believe I am using Oracle 10 if that matters. Thanks. (1 Reply)
Discussion started by: benefactr
1 Replies

3. Shell Programming and Scripting

using SELECT sql statement in shell script

Hi there I have a database on a remote box and i have been using shell script to insert data into it for example, i could have a script that did this SN=123456 n=server1 m=x4140 sql="UPDATE main SET hostname='$n',model='$m' WHERE serial='$SN';" echo $sql |/usr/sfw/bin/mysql -h... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

4. Shell Programming and Scripting

How can i assign an select statement into a variable?

I am trying to assign an select statement into a variable. Can someone hel me with this. example : a='select * from dual' echo $a should give me select * from dual But this is not working. I trying with \ before * and quotes too. (1 Reply)
Discussion started by: rdhanek
1 Replies

5. Shell Programming and Scripting

perl DBI: populate a scalar from a select statement

hi every resource i see regarding DBI refers to retrieving data from a database into and array or a hash, but i havent seen anything on how to pull out a single value to a scalar in my database i have a field called "forcewrite" with a value of "6". I am trying to connect to the database,... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

6. Shell Programming and Scripting

for each value in an array, execute select statement

Hello All, I am new to shell scripting. I am working on Solaris O/S, bash script and sybase programming. I want to loop through multiple values in an array and for each value, I want to select a row from the database. following is the code written for it. output="loop.csv" ... (8 Replies)
Discussion started by: arundhati_s
8 Replies

7. Shell Programming and Scripting

Problem with select statement

Hi I have run out of ideas as to why this select doesn't work in a script I am writing. The script sources a file of common functions and I am trying to use a select statement within one of the functions - PS3="Try? " select X in CONT EXIT; do if ] ... (4 Replies)
Discussion started by: steadyonabix
4 Replies

8. Shell Programming and Scripting

Parse SQL text and only format first SELECT statement.

Hi Forum. Need your expertise on the following question. I have the following file which I would like to parse, find first block of SELECT statment and concatenate all input fields as 1 field (~ delimited): Old File: SELECT /*+ USE_HASH(CCOMM ICAR IMAP IAS IP IMAS IMPS IAP SPCA) */ ... (5 Replies)
Discussion started by: pchang
5 Replies

9. Shell Programming and Scripting

SQLPLUS command with more than 1 select statement

Hi all, I'm using below code processId=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS whenever sqlerror exit sql.sqlcode; set head off feedback off echo off pages 0 SELECT PROCESS_ID FROM LSHADMIN.DATA_DOMAIN WHERE DOMAIN_NAME = '${tabname}' ... (8 Replies)
Discussion started by: Pratiksha Mehra
8 Replies

10. Shell Programming and Scripting

Storing passing and executing select statement in loop

Hi, i want to do the following: Grep the following kind of strings for the 15digit ID which is stored in filename1: "14:06:51.396 INFO BMCREMEDYSD INPUT-ACTION Failed to retrieve Remedy Incident Modification record: 000000000039047 org.apache.axis2.AxisFault: Read timed out - complete... (9 Replies)
Discussion started by: Khushbu
9 Replies
SQLSRV_CANCEL(3)														  SQLSRV_CANCEL(3)

sqlsrv_cancel - Cancels a statement

SYNOPSIS
bool sqlsrv_cancel (resource $stmt) DESCRIPTION
Cancels a statement. Any results associated with the statement that have not been consumed are deleted. After sqlsrv_cancel(3) has been called, the specified statement can be re-executed if it was created with sqlsrv_prepare(3). Calling sqlsrv_cancel(3) is not necessary if all the results associated with the statement have been consumed. PARAMETERS
o $stmt - The statement resource to be cancelled. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 sqlsrv_cancel(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 = "SELECT Sales FROM Table_1"; $stmt = sqlsrv_prepare( $conn, $sql); if( $stmt === false ) { die( print_r( sqlsrv_errors(), true)); } if( sqlsrv_execute( $stmt ) === false) { die( print_r( sqlsrv_errors(), true)); } $salesTotal = 0; $count = 0; while( ($row = sqlsrv_fetch_array( $stmt)) && $salesTotal <=100000) { $qty = $row[0]; $price = $row[1]; $salesTotal += ( $price * $qty); $count++; } echo "$count sales accounted for the first $$salesTotal in revenue.<br />"; // Cancel the pending results. The statement can be reused. sqlsrv_cancel( $stmt); ?> NOTES
The main difference between sqlsrv_cancel(3) and sqlsrv_free_stmt(3) is that a statement resource cancelled with sqlsrv_cancel(3) can be re-executed if it was created with sqlsrv_prepare(3). A statement resource cancelled with sqlsrv_free_statement(3) cannot be re-executed. SEE ALSO
sqlsrv_free_stmt(3), sqlsrv_prepare(3). PHP Documentation Group SQLSRV_CANCEL(3)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy