Sponsored Content
Top Forums UNIX for Advanced & Expert Users Retrieve data and redirect to a file Post 302387328 by zaxxon on Friday 15th of January 2010 09:20:47 AM
Old 01-15-2010
Get your data by calling appropriate SQL queries like SELECT etc. maybe via SQLPLUS and redirect it to someoutput file. As output delimeter you might want to choose something appropriate, maybe a semicolon, depending to your data so that it can be imported as let's say .csv file.
How to check for return codes of commands and how to send a notify mail is covered in plenty posts in this forum.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Retrieve data from a file

Hello guys I want to retrieve two data from a file, like this: bash-2.03$ cat numtest 123456 123457 bash-2.03$ more ./test_num #!/bin/bash num1= num2= cnt=1 while read x do num${cnt}=$x cnt=$(($cnt+1)) done <$1 echo $num1 "\n" $num2 But when i executed this script, error... (2 Replies)
Discussion started by: tpltp
2 Replies

2. Programming

to find header in Mp3 file and retrieve data

hi all, In an mp3 file , data is arranged in sequence of header and data ,how to retrieve data between two headers. Is the data between two headers fixed? because as per theory it says 1152 samples will be there , but dont knw how many bits one sample correspond to? it would help if any c... (2 Replies)
Discussion started by: shashi
2 Replies

3. Shell Programming and Scripting

need a script to redirect the command prompt data int a log file.

Hello forum memebers, I have to write a script to copy command arguments into a log.please see the below issue and help me to complete it. i have command "mkidcfg" it is custiomized.I will run the command with one arguments . mkidcfg -I _config.db_ids it will open the below options. 1... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

4. Shell Programming and Scripting

More time to retrieve data from DB

Hi All, It takes around one hour to retrieve 3 lakhs data from DB. I feel this can be still more reduced, please help me in improvising the below code, to get it retrieve faster, atleast 30 to 45 minutes. sqlplus -s ${OCAU_DB_UNAME}/${OCAU_DB_UPSWD}@${OCAU_DB_NAME} > /apps/data/filedata.txt... (4 Replies)
Discussion started by: pattamuthu
4 Replies

5. UNIX for Dummies Questions & Answers

How to compare two columns and retrieve data

I am a newbie to Unix and slowly learning it. I have a large data set with 8 different columns. I want to compare two columns and retrieve data if the two columns have similar number. I have attached the example. There are two columns (S-Contig and N-Contig). I want to retrieve the data from... (7 Replies)
Discussion started by: bjorngill
7 Replies

6. Shell Programming and Scripting

How to retrieve a number or string from file1 and redirect into file2 in perl script?

hello forum members, I am siva ,As i am new to perl scripting i looking help from forum members. i need a sample program are command for pattern matching. I have file name infile1 which some data, I need to search the particular number are string in the file which repeats n number of... (0 Replies)
Discussion started by: workforsiva
0 Replies

7. Shell Programming and Scripting

Redirect output to a different text file depending source of data

I have a list of DNS servers I need to look up information on. Each of these servers has a master and a slave database. Essentially what I need to do is create two text files for each server. One with the Master view and one with the Slave view. There's 20 servers, in the end I should have 40 text... (4 Replies)
Discussion started by: spartan22
4 Replies

8. Shell Programming and Scripting

Retrieve data from one file comparing the ID in the second file

Hi all, I have one file with IDs Q8NDM7 P0C1S8 Q8TF30 Q9BRP8 O00258 Q6AWC2 Q9ULE0 Q702N8 A4UGR9 Q13426 Q6P2D8 Q9ULM3 A8MXQ7 I want to compare ID file with another file which has complete information about these IDs and also about other IDs which are not in the above ID file. As... (10 Replies)
Discussion started by: kaav06
10 Replies

9. Shell Programming and Scripting

How can I retrieve the matching records from data file mentioned?

XYZNA0000778800Z 16123000012300321000000008000000000000000 16124000012300322000000007000000000000000 17234000012300323000000005000000000000000 17345000012300324000000004000000000000000 17456000012300325000000003000000000000000 9 XYZNA0000778900Z 16123000012300321000000008000000000000000... (8 Replies)
Discussion started by: later_troy
8 Replies
SQL-ACCEPTABLE-BY-4D(3) 						 1						   SQL-ACCEPTABLE-BY-4D(3)

SQL acceptable by 4D - PDO and SQL 4D

	4D  implements	strictly  the  ANSI  89 standard, and have it enforced. It is highly recommended to read the 4D SQL documentation to learn
       about the available commands. The URL of the manual is : http://doc.4d.com/. Below is a list of 4D SQL characteristics: it is  not  exhaus-
       tive, but may serve as an introduction.

       Characteristics of 4D SQL

       +-------------------------------------+--------------------------------------+---+
       |	  Characteristics	     |					    |	|
       |				     |					    |	|
       |				     |		   Alternative		    |	|
       |				     |					    |	|
       |				     |		       Note		    |	|
       |				     |					    |	|
       +-------------------------------------+--------------------------------------+---+
       |	      INTEGER		     |					    |	|
       |				     |					    |	|
       |				     |	    Modify the SQL to use INT.	    |	|
       |				     |					    |	|
       |				     | INT is the supported integer type in |	|
       |				     | 4Dv12.0. 			    |	|
       |				     |					    |	|
       |		CHAR		     |					    |	|
       |				     |					    |	|
       |				     |	       Use VARCHAR instead.	    |	|
       |				     |					    |	|
       |				     |	      Unsupported in 4Dv12.0	    |	|
       |				     |					    |	|
       |	       UNION		     |					    |	|
       |				     |					    |	|
       |				     | Unsupported. Make separate queries.  |	|
       |				     |					    |	|
       |				     |	      Unsupported in 4Dv12.0	    |	|
       |				     |					    |	|
       |	   SELECT 1 + 1;	     |					    |	|
       |				     |					    |	|
       |				     |	 SELECT 1 + 1 FROM _USER_SCHEMAS;   |	|
       |				     |					    |	|
       |				     |		 FROM is required	    |	|
       |				     |					    |	|
       |	       FLOAT		     |					    |	|
       |				     |					    |	|
       |				     | Cast the FLOAT value into a FLOAT or |	|
       |				     | STRING,	with  an  SQL  4D  function |	|
       |				     | (CAST, ROUND, TRUNC or TRUNCATE)     |	|
       |				     |					    |	|
       |				     | Unsupported in current  versions  of |	|
       |				     | the PDO_4D driver		    |	|
       |				     |					    |	|
       |	   Strong typing	     |					    |	|
       |				     |					    |	|
       |				     | Take  care  your  SQL query, or your |	|
       |				     | PHP  code  provides  data  with	the |	|
       |				     | expected type			    |	|
       |				     |					    |	|
       |				     |	One  must  provide  the  right type |	|
       |				     | that 4D expect. One can't insert '1' |	|
       |				     | (as a string) in an INTEGER column.  |	|
       |				     |					    |	|
       |PDO.execute(row)(3)  : only works if |					    |	|
       |all the table's column are  of	type |					    |	|
       |TEXT or VARCHAR 		     |					    |	|
       |				     |					    |	|
       |				     | Use the prepared statements, and use |	|
       |				     | the right types. 		    |	|
       |				     |					    |	|
       |				     | The PDO extension  cast	all  values |	|
       |				     | through	execute()  as  string,	and |	|
       |				     | expect the SQL database to parse the |	|
       |				     | values.				    |	|
       |				     |					    |	|
       |       SELECT NULL FROM TABLE	     |					    |	|
       |				     |					    |	|
       |				     | Do  not	use NULL constants. Extract |	|
       |				     | them from the table		    |	|
       |				     |					    |	|
       |				     | It is not allowed to  use  the  NULL |	|
       |				     | constant in the select list	    |	|
       |				     |					    |	|
       |    SELECT * FROM TABLE WHERE 1      |					    |	|
       |				     |					    |	|
       |				     |		 Use WHERE 1 = 1	    |	|
       |				     |					    |	|
       |				     | A  constant can't be used in a WHERE |	|
       |				     | clause				    |	|
       |				     |					    |	|
       |	    SHOW TABLES 	     |					    |	|
       |				     |					    |	|
       |				     |		Use system tables	    |	|
       |				     |					    |	|
       |				     |	The list of tables, schemas, index, |	|
       |				     | etc.  are  in  these system tables : |	|
       |				     | _USER_TABLES,	     _USER_COLUMNS, |	|
       |				     | _USER_INDEXES,	 _USER_CONSTRAINTS, |	|
       |				     | _USER_IND_COLUMNS,   _USER_CONS_COL- |	|
       |				     | UMNS, and _USER_SCHEMAS. 	    |	|
       |				     |					    |	|
       |      SQL structure delimiter	     |					    |	|
       |				     |					    |	|
       |				     |	Use  the following function to pro- |	|
       |				     | tect    SQL    elements:    function |	|
       |				     | sqlEscapeElement(elem)  { return '[' |	|
       |				     | .  str_replace(']',']]',  $elem)   . |	|
       |				     | ']'; }				    |	|
       |				     |					    |	|
       |				     |	To   escape   SQL   elements  names |	|
       |				     | (tables,  fields,   users,   groups, |	|
       |				     | schema,	 primary  key,	etc.),	the |	|
       |				     | whole  identifier  must	be  between |	|
       |				     | square  brackets,  and  the  closing |	|
       |				     | brackets ']' must be doubled.	    |	|
       |				     |					    |	|
       +-------------------------------------+--------------------------------------+---+
PHP Documentation Group 												   SQL-ACCEPTABLE-BY-4D(3)
All times are GMT -4. The time now is 04:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy