Sponsored Content
Top Forums Shell Programming and Scripting To create a file writing a SQL into it from another file Post 302457231 by durden_tyler on Monday 27th of September 2010 02:53:02 PM
Old 09-27-2010
Code:
$
$ cat f24
Database_Name:D1
Schema_Name:S1
Table_Name:T1
Select * from <schema>.<table>
$
$
$ perl -lne 'if (/^Schema_Name:(.*?)$/){$s=$1} elsif (/^Table_Name:(.*?)$/){$t=$1} elsif (/^(Select.*from).*$/){print "$1 $s.$t;"}' f24
Select * from S1.T1;
$
$

tyler_durden
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Reading a file and writing the file name to a param file.

Hi All, Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this. I have list of files - adc_earnedpoints.20070630.txt adc_earnedpoints.20070707.txt adc_earnedpoints.20070714.txt adc_earnedpoints.20070721.txt... (1 Reply)
Discussion started by: thebeginer
1 Replies

2. Programming

Writing to a File using pl/sql

Hi I am new to using pl/sql on a unix platform and am having trouble writing to a file from within a block. Below is an example of the code that I have. I know that I need to use UTL_FILE to accomplish this; however, I keep getting errors. Can someone please help me? I am trying to create a... (1 Reply)
Discussion started by: stky13
1 Replies

3. UNIX for Dummies Questions & Answers

Create directories from a sql file?

Hi, I have a sql file which has CREATE and INSERT commands in it. Basically, inside this file, a table will be created and the data will be inserted into the table. I was wondering if there is a way for me to create directories from this file? Thanks in advance (4 Replies)
Discussion started by: tezarin
4 Replies

4. Shell Programming and Scripting

writing the output of SQL into one file

Hi All, Please help me writing the below script. I have two sql queries. 1. Select count(1),Client_id from TABLE_A group by Client_id; 2. Select count(1),Client_id from TABLE_B group by Client_id; I need the output of above two sql queries in a single file. The output 2nd query should be... (4 Replies)
Discussion started by: 46019
4 Replies

5. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

6. Shell Programming and Scripting

Writing sql results to file using ksh -nevermind

I'm having problems with writing my sql results to a file: sqlplus -S username/password@DB <<!! set echo off set verify off set showmode off set feedback off set timing off set linesize 250 set wrap off set pagesize 0 set newpage none set tab off set trimspool on set colsep... (1 Reply)
Discussion started by: avillanueva
1 Replies

7. Shell Programming and Scripting

Need help in writing a script to create a new text file with specific data from existing two files

Hi, I have two text files. Need to create a third text file extracting specific data from first two existing files.. Text File 1: Format contains: SQL*Loader: Release 10.2.0.1.0 - Production on Wed Aug 4 21:06:34 2010 some text ............so on...and somwhere text like: Record 1:... (1 Reply)
Discussion started by: shashi143ibm
1 Replies

8. Shell Programming and Scripting

How can I create a CSV file from PL/Sql in UNIX?

Can someone help me on creating a script that will manage/create a csv file from Pl/Sql using UNIX?Any advice is welcome,thank you so much,:) (2 Replies)
Discussion started by: Atrap
2 Replies

9. Programming

create a spool file based on values passed from korn shell to sql script

this is my issue. 4 parameters are passed from korn shell to sql script. parameter_1= varchar2 datatype or no value entered my user. parameter_2= number datatype or no value entered my user. parameter_3= number datatype or no value entered my user. parameter_4= number datatype or no... (5 Replies)
Discussion started by: megha2525
5 Replies

10. Shell Programming and Scripting

Create SQL DML insert statements from file using AWK or similar

Hi all. This is my first post on this forum. I've previously found great help in the huge knowledgebase that is here, but this time I have not been able to find a solution to my problem. I have a large text file that looks like this: typedef struct ABC_struct_nbr1_ { char attr1; /*... (0 Replies)
Discussion started by: Yagi Uda
0 Replies
PODSELECT(1)						 Perl Programmers Reference Guide					      PODSELECT(1)

NAME
podselect - print selected sections of pod documentation on standard output SYNOPSIS
podselect [-help] [-man] [-section section-spec] [file ...] OPTIONS AND ARGUMENTS
-help Print a brief help message and exit. -man Print the manual page and exit. -section section-spec Specify a section to include in the output. See "SECTION SPECIFICATIONS" in Pod::Parser for the format to use for section-spec. This option may be given multiple times on the command line. file The pathname of a file from which to select sections of pod documentation (defaults to standard input). DESCRIPTION
podselect will read the given input files looking for pod documentation and will print out (in raw pod format) all sections that match one ore more of the given section specifications. If no section specifications are given than all pod sections encountered are output. podselect invokes the podselect() function exported by Pod::Select Please see "podselect()" in Pod::Select for more details. SEE ALSO
Pod::Parser and Pod::Select AUTHOR
Please report bugs using <http://rt.cpan.org>. Brad Appleton <bradapp@enteract.com> Based on code for Pod::Text::pod2text(1) written by Tom Christiansen <tchrist@mox.perl.com> perl v5.14.2 2014-09-30 PODSELECT(1)
All times are GMT -4. The time now is 09:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy