05-26-2009
Your suggestion is good, but let's first see of we can understand your problem. Is the input data clean: is the origin of your data a source where prepopulated combo-boxes are used? If so, then your query will be a simple INSERT statement where FK relations are observed by default. If the source could be from anywhere, then you are likely to need multiple SQL statements, each checking the presence of the fields which are referenced. Hope this helps
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi!
I would like to do a single connection to sqlplus and execute some querys.
Actually I do for every query one connection to database
i.e
echo 'select STATUS from v$instance;
exit' > $SQL_FILE
sqlplus user/pass@sid @$SQL_FILE > $SELECT_RESULT
echo 'select VERSION from v$instance;... (6 Replies)
Discussion started by: guif
6 Replies
2. Web Development
Say I have two tables like below..
status
HId sName dName StartTime EndTime
1 E E 9:10 10:10
2 E F 9:15 10:15
3 G H 9:17 10:00
logic
Id devName capacity free Line
1 E 123 34 1
2 E 345 ... (3 Replies)
Discussion started by: ilan
3 Replies
3. Programming
Hi,
I have 2 tables.
Table1
name map_code data_code id
aaa 2732C 3333B 10
bbb 1223F 2545v 11
ccc 12
Table2
name map_code data_code id text_description
aaa 2732C 3333B 10 description 1
bbb 1223F 2545v 11 ... (3 Replies)
Discussion started by: vanitham
3 Replies
4. Shell Programming and Scripting
Hi everyone,
I once again got stuck with merging tables and was wondering if someone could help me out on that problem.
I have a number of tab delimited tables which I need to merge into one big one. All tables have the same header but a different number of rows (this could be changed if... (6 Replies)
Discussion started by: TuAd
6 Replies
5. Programming
I want to check for rows in a table where all values (except the key) is empty. I am using MySQL 5.5.
I plan to do this mechanically, so the approach should work for any table in my database schema.
Suppose for illustration purposes I start with the following table:
CREATE TABLE `sources` (
... (4 Replies)
Discussion started by: figaro
4 Replies
6. Shell Programming and Scripting
multiple files to load into different tables,
I have a script show below, but this script loads data from txt file into a table,
but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder ,
can we load these files in diff tables (table 1, table2... (0 Replies)
Discussion started by: nani1984
0 Replies
7. Shell Programming and Scripting
multiple files to load into different tables,
I have a script show below, but this script loads data from txt file into a table,
but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder ,
can we load these files in diff tables (table 1, table2... (1 Reply)
Discussion started by: nani1984
1 Replies
8. Shell Programming and Scripting
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
9. UNIX for Advanced & Expert Users
Hi,
Please let me know if you have any thoughts on how to read a table that has all the oracle sql files or shell scripts at the job and step level to identify all the tables that does merge, update, delete, insert, create, truncate, alter table (ALTER TABLE XYZ RENAME TO ABC) and call them out... (1 Reply)
Discussion started by: techmoris
1 Replies
10. UNIX for Beginners Questions & Answers
Hello All,
just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table.
Can you please suggest why? or any better idea?
export FILE="/abc/autom/file/geo_JOB.csv"
Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies
LEARN ABOUT DEBIAN
sql::translator::filter::globals
SQL::Translator::Filter::Globals(3pm) User Contributed Perl Documentation SQL::Translator::Filter::Globals(3pm)
NAME
SQL::Translator::Filter::Globals - Add global fields and indices to all tables.
SYNOPSIS
# e.g. Add timestamp field to all tables.
use SQL::Translator;
my $sqlt = SQL::Translator->new(
from => 'MySQL',
to => 'MySQL',
filters => [
Globals => {
fields => [
{
name => 'modified'
data_type => 'TIMESTAMP'
}
],
indices => [
{
fields => 'modifed',
},
]
constraints => [
{
}
]
},
],
) || die "SQLFairy error : ".SQL::Translator->error;
my $sql = $sqlt->translate || die "SQLFairy error : ".$sqlt->error;
DESCRIPTION
Adds global fields, indices and constraints to all tables in the schema. The globals to add can either be defined in the filter args or
using a _GLOBAL_ table (see below).
If a table already contains a field with the same name as a global then it is skipped for that table.
The _GLOBAL_ Table
An alternative to using the args is to add a table called "_GLOBAL_" to the schema and then just use the filter. Any fields and indices
defined on this table will be added to all the tables in the schema and the _GLOBAL_ table removed.
The name of the global can be changed using a "global_table" arg to the filter.
SEE ALSO
perl(1), SQL::Translator
BUGS
Will generate duplicate indices if an index already exists on a table the same as one added globally.
Will generate duplicate constraints if a constraint already exists on a table the same as one added globally.
TODO
Some extra data values that can be used to control the global addition. e.g. 'skip_global'.
AUTHOR
Mark Addison <grommit@users.sourceforge.net>
perl v5.14.2 2012-01-18 SQL::Translator::Filter::Globals(3pm)