02-10-2009
Try this
Quote:
Originally Posted by
games_icon
Hi All!
I need to write a script which reads a file and tries to insert into the DB using those values...
file format:
var1 var2 var3
var4 var5 var6
Now I want to read from the above file and trying to insert like...
insert into table1 values( var1, var2, var3 );
in a loop to cover all rows in the file...
Please help me guys... from yesterday its killing me...
cat file| tr ' ' ',' | awk '{print "insert into <tablename> values (" $0 ")" }'
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
HI.
I just accidently wipe out my hard drive when i installed sun solaris, this is the last thing i remember, it ask me if want to delete the partition table, and i said yes" Im a retard" i thought solaris can't see xp partition table. Could anyone help me recover my data back, is it really... (21 Replies)
Discussion started by: souldier
21 Replies
2. UNIX for Dummies Questions & Answers
actually i have important question about unix / linux
i'm working on visuall basic and visuall c++
i heared from someone that i can't open them while i useing unix / linux
is that right?
if yes .......... what's the solution
if no ............. thanks :) :D :D
thanks my friends (1 Reply)
Discussion started by: M_Hafez
1 Replies
3. AIX
Hi guys,
I would like to inform you that I have cleared ....
IBM Certified Specialist - p5 and pSeries Administration and Support for AIX 5L V5.3 with 89%
thanks to you all.
Manu (0 Replies)
Discussion started by: b_manu78
0 Replies
4. Shell Programming and Scripting
Hello Guys,
I have written the following script to do certain job. I have more than 300 files, all are .pdb & .out files. and the files are (1,3,5,7,11,13,15,17,21,.......787,791,793,795).pdb /.out . But the way I created the for loop in my script works only one file at a time. But that is not... (2 Replies)
Discussion started by: chuchu
2 Replies
5. UNIX for Advanced & Expert Users
I want a Bash Shell Script for taking backup of all files created to day and killing all the Process still active of mine at evening every day (1 Reply)
Discussion started by: vinayraj
1 Replies
6. UNIX for Advanced & Expert Users
Dear All
I have a pattern which look like this :
2 20080226_18:02:09.749 ISC-Libya Egypt-Cairo2 111 IAM 2913258040 218927157966 b 61 REL f 143 RLC :COMMA:NCI=10,FCI=6101,CPC=0A,TMR=00,OFI=80,USI: :COMMB:: :RELCAUSE:15:
2 20080226_18:02:11.629 ISC-Libya Egypt-Cairo2 170 IAM 93572641... (8 Replies)
Discussion started by: zanetti321
8 Replies
7. UNIX for Advanced & Expert Users
Dear All
I have an important request:
I have a pattern which look like this:
2 20080219_21:43:22.194 ISC-Libya Belgium1 24 IAM 20115139248 218913265641 b 11672 ACM b 20614 CPG b 20619 CPG b 20626 CPG f 33925 REL b 34215 RLC :COMMA: NCI=00,FCI=6001,CPC=0A,TMR=00,USI: :COMMB: BCI=0201:... (15 Replies)
Discussion started by: zanetti321
15 Replies
8. Cybersecurity
Hey guys, new geek here, sorry I didnt see a intro section. But I do have a question and hope to make my stay here perma. I am interested in IT security, ands I really want to learn, I was hoping for whatever questions I had you guys could lead me through the narrowest path with a broad selection... (1 Reply)
Discussion started by: abeja
1 Replies
9. Shell Programming and Scripting
how to print first line of each repeated 2 fields only if i got files like :
USA|Tony|12:25:22:431
USA|John|14:22:42:981
USA|John|08:22:12:349
France|Adam|14:22:42:981
Italy|Tony|18:22:42:212
Italy|Tony|04:22:42:212
Italy|Tony|08:22:42:212
to make output like :
... (9 Replies)
Discussion started by: teefa
9 Replies
LEARN ABOUT DEBIAN
alzabo::runtime::inserthandle
Alzabo::Runtime::InsertHandle(3pm) User Contributed Perl Documentation Alzabo::Runtime::InsertHandle(3pm)
NAME
Alzabo::Runtime::InsertHandle - A handle representing an insert
SYNOPSIS
my $handle =
$table->insert_handle
( columns => [ $table->columns( 'name', 'job' ) ] );
my $faye_row =
$handle->insert( values =>
{ name => 'Faye',
job => 'HK Pop Chanteuse' } );
my $guesch_row =
$handle->insert( values =>
{ name => 'Guesch',
job => 'French Chanteuse and Dancer' } );
DESCRIPTION
This object is analogous to a DBI statement handle, and can be used to insert multiple rows into a table more efficiently than repeatedly
calling "Alzabo::Runtime::Table->insert()".
METHODS
Objects of this class provide one public method:
insert
This method is used to insert a new row into a table.
It accepts the following parameters:
* values
This should be a hash reference containing the values to be inserted into the table.
If no value is given for a primary key column and the column is "sequenced" then the primary key will be auto-generated.
If values are not provided for other columns which were given when "Alzabo::Runtime::Table->insert_handle" was called, this method
first checks to see if a value was provided for the column when "Alzabo::Runtime::Table->insert_handle" was called. If none was pro-
vided, then the column's default value is used.
If column values were passed to "Alzabo::Runtime::Table->insert_handle", then these can be overridden by values passed to this method.
It is not possible to override column values that were given as SQL functions when "Alzabo::Runtime::Table->insert_handle" was called.
This method returns a new "Alzabo::Runtime::Row" object.
Throws: "Alzabo::Exception::Logic", "Alzabo::Exception::Params"
perl v5.8.8 2007-12-23 Alzabo::Runtime::InsertHandle(3pm)