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
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
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
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
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, 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
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
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
Please read How To Ask Questions The Smart Way (1 Reply)
Discussion started by: balu_279013
1 Replies
9. Shell Programming and Scripting
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
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
LEARN ABOUT DEBIAN
class::dbi::loader::relationship
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)