Sponsored Content
Top Forums Shell Programming and Scripting SQL query within an awk script !! Post 302813919 by Yoda on Tuesday 28th of May 2013 11:09:13 AM
Old 05-28-2013
I don't think this is the best way for handling this task.

I would suggest using SQL Loader for loading your colon separated file to a temporary table.

Later you can join this temporary table with your table: t_id to identify missing or common fields from your input file.
This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing Sql Query Using Shell Script

HI ALL i have a requirement like this. i have to write a shell script to run a sql query. DB is oracle. once the query is run, the results of the query has to be published in a data file. can you please advice me how to go about it. i am absolutely new to shell scripts and this is a part of my job. (14 Replies)
Discussion started by: ragha81
14 Replies

2. Shell Programming and Scripting

executing a SQL query in shell script

Hi ALL, I need an help in connecting to oracle database, executing a select query and printing it on the screen. Can any one please write a simple code or psuedo code and let me know. select query returns multiple values( say select name from emp) Thanks in advance LM (1 Reply)
Discussion started by: lijju.mathew
1 Replies

3. Shell Programming and Scripting

script variable within a sql query

I created a script to read a csv file with four columns. The script also saved values of each col in a arry. In the script, i connected to db try to run a query to pull out data baisc on the values from the csv file. select Num from tableName where Sec_Num in ('${isin}') /*isin is an arry... (1 Reply)
Discussion started by: Sherry_Run
1 Replies

4. Shell Programming and Scripting

Script executing sql query

Hello, I have a sh script excuting a sql query through sqlplus. I am having trouble making my date equal to the date of the server time in the sql script. How can i call the server date from my query? Thanks (2 Replies)
Discussion started by: kingluke
2 Replies

5. Shell Programming and Scripting

query sql using shell script

query sql using shell script, is it possible? my friend told me to do a file.sql and link to my shell script, but can i query sql using shell script? thanks in advance! (2 Replies)
Discussion started by: kingpeejay
2 Replies

6. Shell Programming and Scripting

Run SQL thru shell script: how to get a new line when run sql query?

Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database. I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :( What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies

7. Red Hat

Sql query through shell script

hey , i am using this code to store value of a sql query and and then use it in other query but after some time , but it is not working. please help #!/bin/bash val_1=$( sqlplus -s rte/rted2@rel76d2 << EOF setting heading off select max(stat_id) from cvt_stats; exit EOF ) nohup... (5 Replies)
Discussion started by: ramsavi
5 Replies

8. UNIX for Dummies Questions & Answers

Script to run sql query.

Please read How To Ask Questions The Smart Way (1 Reply)
Discussion started by: balu_279013
1 Replies

9. Shell Programming and Scripting

Convert the SQL Query in Shell Script

Hi All, I have a query with output below select 'create synonym "'||TABLE_NAME||'" for '||Table_owner||'."'||table_name||'"'||chr(59) from user_synonyms; ================== create synonym "RV_SBC_SIG" for WFCONTROLLER_TE."RV_SBC_SIG"; create synonym "AQM_TASK" for AWQM_TE."AQM_TASK";... (2 Replies)
Discussion started by: pvmanikandan
2 Replies

10. Shell Programming and Scripting

How do I read sql query into shell script?

Hello All, I'm trying to put together a shell script that will: 1. connect to an oracle database 2. execute a query 3. save the output to a csv file I know that I can execute the sqlplus -s user/pass @dbsid and get logged in. What I would like to do is have my query in a separate text... (9 Replies)
Discussion started by: bbbngowc
9 Replies
Relationship(3pm)					User Contributed Perl Documentation					 Relationship(3pm)

NAME
Class::DBI::Loader::Relationship - Easier relationship specification in CDBI::L SYNOPSIS
use Class::DBI::Loader::Relationship; my $loader = Class::DBI::Loader->new( dsn => "mysql:beerdb", namespace => "BeerDB"); Now instead of saying BeerDB::Brewery->has_many(beers => "BeerDB::Beer"); BeerDB::Beer->has_a(brewery => "BeerDB::Brewery"); BeerDB::Handpump->has_a(beer => "BeerDB::Beer"); BeerDB::Handpump->has_a(pub => "BeerDB::Pub"); BeerDB::Pub->has_many(beers => [ BeerDB::Handpump => 'beer' ]); BeerDB::Beer->has_many(pubs => [ BeerDB::Handpump => 'pub' ]); Just say $loader->relationship( "a brewery produces beers" ); $loader->relationship( "a pub has beers on handpumps" ); DESCRIPTION
This module acts as a mix-in, adding the "relationship" method to "Class::DBI::Loader". Since "Class::DBI::Loader" knows how to map between table names and class names, there ought to be no need to replicate the names. In addition, it is common (but not universal) to want reverse relationships defined for has-many relationships, and for has-a relationships to be defined for the linkages surrounding a many-to-many table. The aim of "CDBIL::Relationship" is to simplify the declaration of common database relationships by providing both of these features. The "relationship" takes a string. It recognises table names (singular or plural, for convenience) and extracts them from the "sentence". AUTHOR
Simon Cozens, "simon@cpan.org" SEE ALSO
Class::DBI::Loader. perl v5.10.1 2010-07-04 Relationship(3pm)
All times are GMT -4. The time now is 02:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy