Sponsored Content
Full Discussion: Order of data in Spool File
Top Forums Shell Programming and Scripting Order of data in Spool File Post 303003050 by Aparna.N on Thursday 7th of September 2017 06:55:58 AM
Old 09-07-2017
Order of data in Spool File

Hello,

I have a shell script through which I am executing .sql file and spooling the result of Query from .sql . I want to spool the result in ascending order. Is there any parameter to be set to print result in ascending or descending order.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK - printing certain fields when field order changes in data file

I'm hoping someone can help me on this. I have a data file that greatly simplified might look like this: sec;src;dst;proto 421;10.10.10.1;10.10.10.2;tcp 426;10.10.10.3;10.10.10.4;udp 442;10.10.10.5;10.10.10.6;tcp sec;src;fac;dst;proto 521;10.10.10.1;ab;10.10.10.2;tcp... (3 Replies)
Discussion started by: eric4
3 Replies

2. Shell Programming and Scripting

how to spool a unix file

hi, can anyone help me by saying how can i spool a unix file.. do we need to specify the pathname as such to spool the file .. right now, i tried giving like spool filename in the sql prompt.. but its not giving me the required output even if i can see that the command is being executed.. ... (2 Replies)
Discussion started by: kripssmart
2 Replies

3. AIX

Spool data file

Dear Gurus, Tried searching for some clues in this forum but dont seem to be able to find my answer. :confused: Anyway i have a quick question: Today I have produced a messages generated from a application and placed them on the print queue. Before this I had stopped the printer queue, so... (2 Replies)
Discussion started by: lweegp
2 Replies

4. Shell Programming and Scripting

Problem in spool file

Hi, Iam a newbie. When I give the below query at SQL prompt. SQL> select col1||'`ß`'||col2 from tablename where rownum<2; 1-J7WGX`ß`1-7OKC-23 Iam getting ß within appostropies...... If I remove appostropies and give the query it is throwing an error. If I give the same query in spool as... (1 Reply)
Discussion started by: kknayak
1 Replies

5. Shell Programming and Scripting

Help with sort data based on descending order problem

Input file 9.99331e-13 8.98451e-65 9.98418e-34 7.98319e-08 365592 111669 74942.9 0 Desired output 365592 111669 74942.9 7.98319e-08 1.99331e-13 6.98418e-34 (2 Replies)
Discussion started by: perl_beginner
2 Replies

6. Shell Programming and Scripting

Spool file, only if data exists.

Hi All, I have one Question, that is it possible to check the spool output? What i mean to say is "spool the file only if data exists" I am trying to fetch data from a sql query, and want to generate a file, on a condition that the file should be generated, only if the output of the sql... (5 Replies)
Discussion started by: spiabhi
5 Replies

7. Shell Programming and Scripting

how to extract data from numbered files using linux in the numerical order-

Hi experts, I have a list of files containing forces as the only number as follows. Force1.txt Force2.txt Force3.txt Force4.txt Force5.txt . . . . . . . . . Force100.txt I want to put all the data(only a number ) in these forces files in the file with the same order like 1,2,3 ..100 .... (2 Replies)
Discussion started by: hamnsan
2 Replies

8. Shell Programming and Scripting

How to insert gaussian noise to a data with an order with awk?

Hello everybody, My problem is inserting gaussian noise to a file containing data, that is, add every single noise to the number after every 6 character. here is my data 0910 1 2048 32.38 40 20.88 28 35.53 9.62 0.00 MSDMP0 1.790MSDMS1 2.840KCTXP2 4.400KRCMP0 4.600BOZMP0 5.640BOZMS2... (26 Replies)
Discussion started by: miriammiriam
26 Replies

9. Shell Programming and Scripting

Spool Data in a file

Hello, I am trying to spool data from database into a file on solaris through ksh. Data is getting fetched but the problem is record is getting split in to multiple lines. excerpt from sql is whenever sqlerror exit 1; set define on set echo off set feed off set head off set... (1 Reply)
Discussion started by: abhi1988sri
1 Replies

10. Shell Programming and Scripting

How order a data matrix using awk?

is it possible to order the following row clusters from ascending to descending. thanx in advance input 1 2 4 0 1 2 4 0 3 3 3 3 1 5 1 0 1 5 1 0 6 0 0 0 5 1 1 1... (4 Replies)
Discussion started by: quincyjones
4 Replies
DB2_FETCH_ARRAY(3)							 1							DB2_FETCH_ARRAY(3)

db2_fetch_array - Returns an array, indexed by column position, representing a row in a result set

SYNOPSIS
array db2_fetch_array (resource $stmt, [int $row_number = -1]) DESCRIPTION
Returns an array, indexed by column position, representing a row in a result set. The columns are 0-indexed. PARAMETERS
o $stmt - A valid stmt resource containing a result set. o $row_number - Requests a specific 1-indexed row from the result set. Passing this parameter results in a PHP warning if the result set uses a forward-only cursor. RETURN VALUES
Returns a 0-indexed array with column values indexed by the column position representing the next or requested row in the result set. Returns FALSE if there are no rows left in the result set, or if the row requested by $row_number does not exist in the result set. EXAMPLES
Example #1 Iterating through a forward-only cursor If you call db2_fetch_array(3) without a specific row number, it automatically retrieves the next row in the result set. <?php $sql = "SELECT id, name, breed, weight FROM animals ORDER BY breed"; $stmt = db2_prepare($conn, $sql); $result = db2_execute($stmt); while ($row = db2_fetch_array($stmt)) { printf ("%-5d %-16s %-32s %10s ", $row[0], $row[1], $row[2], $row[3]); } ?> The above example will output: 0 Pook cat 3.20 5 Rickety Ride goat 9.70 2 Smarty horse 350.00 Example #2 Retrieving specific rows with db2_fetch_array(3) from a scrollable cursor If your result set uses a scrollable cursor, you can call db2_fetch_array(3) with a specific row number. The following example retrieves every other row in the result set, starting with the second row. <?php $sql = "SELECT id, name, breed, weight FROM animals ORDER BY breed"; $result = db2_exec($stmt, $sql, array('cursor' => DB2_SCROLLABLE)); $i=2; while ($row = db2_fetch_array($result, $i)) { printf ("%-5d %-16s %-32s %10s ", $row[0], $row[1], $row[2], $row[3]); $i = $i + 2; } ?> The above example will output: 0 Pook cat 3.20 5 Rickety Ride goat 9.70 2 Smarty horse 350.00 SEE ALSO
db2_fetch_assoc(3), db2_fetch_both(3), db2_fetch_object(3), db2_fetch_row(3), db2_result(3). PHP Documentation Group DB2_FETCH_ARRAY(3)
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy