insert

2012-05-07 Thread lina
Hi, I have two files, one with 3 2 1 another is: 3 1 3 2 6 3 How can I insert the first file into the middle of the second file, Thanks ahead for your suggestions, Best regards, -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h

html insert

2002-02-27 Thread cbsvensson
Is there any way I can have a script producing a bit of html code on a remote computer and then be able to make a call to that in a HTML document which then will similair to http://something.com/xx.cgi?sdfsdfsdf";> If it can be done let me know how thank you -- To unsubscribe, e-mail: [EMA

insert keyword

2008-11-10 Thread Sharan Basappa
Hi, I have a string that has value delimited by space e.g. 1 2 10 8 etc. I need to add a keyword wherever there is a space. I wrote a small code to try this out: $str = "one two three"; $str =~ s/\s/x /g; In this case, I am trying to insert x where there is a space. one two three sho

postgres insert

2006-11-23 Thread Tom Allison
I've been using something like this for Oracle for some time and tried it with Postgresql. (RaiseError doesn't change the outcome) sub insert_token { my $token = shift; eval{ $sth1->execute($token) }; if ($@) { return 1 if $@ =~ /duplicate key violates unique constraint/;

Re: insert

2012-05-07 Thread Shawn H Corey
On 12-05-07 03:36 AM, lina wrote: How can I insert the first file into the middle of the second file, What code have you tried so far and please provide the expected output for your example. -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and

Re: insert

2012-05-07 Thread lina
On Mon, May 7, 2012 at 7:52 PM, Shawn H Corey wrote: > On 12-05-07 03:36 AM, lina wrote: >> >> How can I insert the first file into the middle of the second file, > > > What code have you tried so far and please provide the expected output for > your example. >

Re: insert

2012-05-07 Thread Jim Gibson
On May 7, 2012, at 5:51 AM, lina wrote: > On Mon, May 7, 2012 at 7:52 PM, Shawn H Corey wrote: >> On 12-05-07 03:36 AM, lina wrote: >>> >>> How can I insert the first file into the middle of the second file, >> >> >> What code have you tried so f

Re: insert

2012-05-07 Thread timothy adigun
Hi lina On Mon, May 7, 2012 at 8:36 AM, lina wrote: > Hi, > > I have two files, one with > > 3 > 2 > 1 > > another is: > > 3 1 > 3 2 > 6 3 > > How can I insert the first file into the middle of the second file, > This is one way to do it: #!/u

Re: insert

2012-05-07 Thread John W. Krahn
timothy adigun wrote: On Mon, May 7, 2012 at 8:36 AM, lina wrote: I have two files, one with 3 2 1 another is: 3 1 3 2 6 3 How can I insert the first file into the middle of the second file, This is one way to do it: #!/usr/bin/perl use warnings; use strict; my $part1 = get_data

Re: insert

2012-05-07 Thread timothy adigun
On Mon, May 7, 2012 at 11:29 PM, John W. Krahn wrote: > timothy adigun wrote: > >> >> On Mon, May 7, 2012 at 8:36 AM, lina wrote: >> >> I have two files, one with >>> >>> 3 >>> 2 >>> 1 >>> >>> another is: &g

Re: insert

2012-05-08 Thread Uri Guttman
On 05/07/2012 04:47 PM, timothy adigun wrote: sub get_data { my ($file) = @_; my $arr_ref = []; open my $fh, '<', $file or die "can't open this file: $!"; while (<$fh>) { chomp; push @$arr_ref, $_; } close $fh or die "can't close file:$!"; ret

regex and insert

2001-08-16 Thread Toni_T_Banire
Hi I'm trying to pipe a grep to an outfile. The grep function works ok @sc=grep /win|net/, @NIC However, I would like to insert a couple of lines before the file starts to log all occurrences containing net without using separate grep commands. All help appreciated Toni

Re: html insert

2002-02-27 Thread Jon Molin
svensson wrote: > > Is there any way I can have a script producing a bit of html code on a > remote computer > > and then be able to make a call to that in a HTML document which then will > > similair to http://something.com/xx.cgi?sdfsdfsdf";> > > If it can be done let me know how yes it is.

Re: html insert

2002-02-27 Thread cbsvensson
but that is still an image I wonder if I can produce text including links any good cgi groups to suggest thank you "Jon Molin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > svensson wrote: > > > > Is there any way I can have a script producing a bit of html

Re: html insert

2002-02-27 Thread Jon Molin
cbsvensson wrote: > > but that is still an image > I wonder if I can produce text including links > > any good cgi groups to suggest > > thank you > sorry i didn't saw that you wanted html, what i did can be useful for counters and similar. well, lwp is a useful module for things like that.

Large Insert statements

2002-05-16 Thread Kevin O
Hello all, I need to insert a lot of data into a mysql table. Know that I can do it like this example: my $sth = $dbh->prepare(q{ INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?) }) or die $dbh->errstr; while (<>) { chomp; my ($product_code,

SQL: Insert column?

2002-05-20 Thread eric-perl
Hello, All: I'm using DBI.pm to interact with flat-file database and want to add a new column to the database. Is there an SQL statement for such a task or do I need to transfer the contents of the file to another file and insert the column during the transfer? -- Eric P. Los Gato

Re: insert keyword

2008-11-11 Thread Chas. Owens
ot;one two three"; > $str =~ s/\s/x /g; > > In this case, I am trying to insert x where there is a space. one two > three should > become one x two x three. > But the above example results in: > nex twox three (chops off leading o char) > > The interesting this is th

Re: insert keyword

2008-11-11 Thread Sharan Basappa
>> Hi, >> >> I have a string that has value delimited by space >> e.g. 1 2 10 8 etc. >> >> I need to add a keyword wherever there is a space. >> I wrote a small code to try this out: >> >> $str = "one two three"; >> $str =~ s

database insert algorithm

2007-09-22 Thread Luke
Hello, I am looking for a proper, fastest and most reasonable way to insert data from pretty big file (~1,000,000 lines) to database. I am using Win32::ODBC (ActiveState Perl) module to connect with Access/MSSQL database and inserting line after line. I was wondering if there is a better way to do

mysql insert errors

2006-04-07 Thread Practical Perl
Hello,all, I wrote a script to insert datas to mysql database.The insert frequency is about 45 times per second. Most of the insert actions are successful,but I still see some errors as follow: DBD::mysql::st execute failed: INSERT command denied to user 'abc'@'192.168.3.10'

Re: postgres insert

2006-11-23 Thread D. Bolliger
Tom Allison am Donnerstag, 23. November 2006 16:13: [snipped some code] > I get a STDERR warning printed out everytime this has a duplicate key > violation... > > Any idea why eval{} doesn't suppress this? Hi Tom It'd be a bad idea... eval BLOCK adds the ability to catch runtime errors and modi

Re: postgres insert

2006-11-25 Thread Tom Allison
D. Bolliger wrote: Tom Allison am Donnerstag, 23. November 2006 16:13: [snipped some code] I get a STDERR warning printed out everytime this has a duplicate key violation... Any idea why eval{} doesn't suppress this? Hi Tom It'd be a bad idea... eval BLOCK adds the ability to catch runtime

Status of db insert?

2002-08-15 Thread Rob
Hi, I've recently started using PostgreSQL and am trying to load a table from a file. The file has 4275 records in it but the database only ends up with 4241 records. When I was using the Pg module I could check the status of the insert, I imagine I can do the same using the DBI module

Re: Large Insert statements

2002-05-16 Thread Frank Wiles
t;[EMAIL PROTECTED]> Revolution Systems, LLC. - On Thu, 16 May 2002 15:55:29 -0500 "Kevin O" <[EMAIL PROTECTED]> wrote: > Hello all, > > I need to insert a lot of data into a mysql table. Know that I can do it > like t

Re: Large Insert statements

2002-05-16 Thread Harry Jackson
> > From: Kevin O[SMTP:[EMAIL PROTECTED]] > > Hello all, > > I need to insert a lot of data into a mysql table. Know that I can > do it > like this example: > > my $sth = $dbh->prepare(q{ > INSERT INTO sales (product_code, qty, price) VALUES

Re: Large Insert statements

2002-05-16 Thread bob ackerman
On Thursday, May 16, 2002, at 01:55 PM, Kevin O wrote: > Hello all, > > I need to insert a lot of data into a mysql table. Know that I can do it > like this example: > > > > my $sth = $dbh->prepare(q{ >INSERT INTO sales (product_code, qty, price) VALU

Re: Large Insert statements

2002-05-16 Thread Harry Jackson
> > From: Kevin O[SMTP:[EMAIL PROTECTED]] > > Hello all, > > I need to insert a lot of data into a mysql table. Know that I can > do it > like this example: > > > > my $sth = $dbh->prepare(q{ > INSERT INTO sales (product_code, qty,

Re: Large Insert statements

2002-05-16 Thread Chas Owens
On Thu, 2002-05-16 at 16:55, Kevin O wrote: > Hello all, > > I need to insert a lot of data into a mysql table. Know that I can do it > like this example: > > > > my $sth = $dbh->prepare(q{ > INSERT INTO sales (product_code, qty, price) VALUES (?, ?,

Re: Large Insert statements

2002-05-16 Thread Michael Fowler
On Thu, May 16, 2002 at 03:55:29PM -0500, Kevin O wrote: > My problem is, I have 500 fields. I know I can start the Insert statement > like INSERT INTO mytable VALUES - cause I'm inserting a value for every > field in the database, but do I have to type a "?" for all

Re: SQL: Insert column?

2002-05-20 Thread bob ackerman
file to another file and insert the > column during the transfer? > > -- > Eric P. > Los Gatos, CA > most dbs let you add a column, but there is no standard - it depends on your database. check documentation for your db on 'ALTER' or 'ADD' command. -- To unsu

Re: database insert algorithm

2007-09-23 Thread Dr.Ruud
Luke schreef: > I am looking for a proper, fastest and most reasonable way to insert > data from pretty big file (~1,000,000 lines) to database. Make the file have a format as needed by the data import tool of the database system. Often a CSV format is supported. See also bcp

Re: database insert algorithm

2007-09-23 Thread [EMAIL PROTECTED]
On 22 Sep, 02:58, [EMAIL PROTECTED] (Luke) wrote: > Hello, > I am looking for a proper, fastest and most reasonable way to insert > data from pretty big file (~1,000,000 lines) to database. I am using > Win32::ODBC (ActiveState Perl) module to connect with Access/MSSQL > databas

Re: database insert algorithm

2007-09-24 Thread Jenda Krynicky
From: Luke <[EMAIL PROTECTED]> > Hello, > I am looking for a proper, fastest and most reasonable way to insert > data from pretty big file (~1,000,000 lines) to database. I am using > Win32::ODBC (ActiveState Perl) module to connect with Access/MSSQL > database and inserting l

Re: database insert algorithm

2007-09-24 Thread Rob Coops
transaction log and rollback segment are and if they will support the 100k or if maybe 50k or 25k would be better), the bigger the block the less the overhead. Also ask you DBA to consider table locks and so on when doing an insert this big... Then you should if at all posible prepare the insert statment so

Re: database insert algorithm

2007-09-24 Thread Matthew Whipple
I haven't dealt with MS databases in several years but some of this stuff will likely still apply. First a couple notes on the underlying databases, if you're running Access be sure to compact the database after the insert particularly if this is going to be a repeated process, in a

Re: mysql insert errors

2006-04-07 Thread Chas Owens
On 4/7/06, Practical Perl <[EMAIL PROTECTED]> wrote: > Hello,all, > > I wrote a script to insert datas to mysql database.The insert frequency is > about 45 times per second. > Most of the insert actions are successful,but I still see some errors as > follow: > >

Re: mysql insert errors

2006-04-07 Thread Dr.Ruud
"Practical Perl" schreef: > I wrote a script to insert datas to mysql database.The insert > frequency is about 45 times per second. > Most of the insert actions are successful,but I still see some errors > as follow: > > DBD::mysql::st execute failed: INSERT c

Re: mysql insert errors

2006-04-07 Thread Practical Perl
Thanks for all,I'll try some ways to fit it.

insert in perl tk

2012-08-23 Thread Irfan Sayed
hi, can we call function in the insert method of perl tk ? i have code like this:  $t->insert("end", "\&abc"); so when this line gets executed, it should first call function abc please suggest regards irfan

Search and Insert into Hash

2003-07-14 Thread bseel
What I am trying to do is to take lines out of a file that are formatted like: SYSTEM="value1" DOMAIN="value2" etc. There are about 1000 lines like that and what I need to do is to take all of the keys (like system and domain) and put them into a hash. But each of those keys has multiple values

Insert Var in Regex Problem

2002-07-10 Thread Connie Chan
Hi all, Say, I have an input $x = "ABCDEF"; and I will try to remove $x from a string, what can I do ? Is there something like : $x =~ s/$x//g; Rgds, Connie

RE: Status of db insert?

2002-08-15 Thread Bob Showalter
> -Original Message- > From: Rob [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 15, 2002 10:08 AM > To: [EMAIL PROTECTED] > Subject: Status of db insert? > > > Hi, I've recently started using PostgreSQL and am trying to > load a table > from a

Mysql and binary data insert

2003-10-22 Thread Michal Weinfurtner
Hello, I have a question, how to insert binary data into the table by MySql DBI module ? Thanks Michal Weinfurtner

Re: insert in a browseentry

2002-04-16 Thread John W. Krahn
Jorge Goncalvez wrote: > > Hi, I have this: > > opendir(DIR,"$_Globals{CDROM}:/DHS3MGR/$tel_version/DHS3Linux"); > foreach (readdir(DIR)){ > unless (/([Comm]+)/){ > $box3->insert('end', $_); > } > > $box3 is a

Insert text in HTML page...

2001-12-17 Thread Jack Smith
Hello to all! Somebody could say to me as I can insert the content of a text file in a page HTML? What happens is that this file is updated frequently and desire to print its content in a page Web. Could be... print " file.txt ";? Any advice well is receiv

insert and query a db

2008-01-07 Thread bbrecht56
his is a good way to read and parse data then insert them in a table? or there is a better way? Thanks for your help Berti The script: use warnings; use DBI; $driver = "DBI:DBM:TEST_DB"; $user = "user"; $password = "user1234"; #-

Insert value in existing record

2006-05-18 Thread Gerald Wheeler
Wondering how I can insert a value: "abc|" http://learn.perl.org/> <http://learn.perl.org/first-response>

DBI insert vs update question

2005-07-10 Thread Peter Rabbitson
single field difference for an already existing record). This obviously will involve a series of UPDATE and INSERT statements, mostly in random order. As most RDBMS can hold only one prepared statement at a time (including MySQL) I have 2 ways to do this that look somewhat efficient: 1. Sweep the

insert a . every four characters

2012-03-09 Thread Noah
Hi there, I am trying to insert a '.' every four characters. Say I have a $it = '123456789012' and want the result to be '1234.5678.9012' whats one of the smoothest ways to do that? Cheers, Noah -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org F

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
can someone please suggest ? regards irfan From: Irfan Sayed To: "beginners@perl.org" Sent: Thursday, August 23, 2012 4:15 PM Subject: insert in perl tk hi, can we call function in the insert method of perl tk ? i have code like this:  $t-&g

Re: insert in perl tk

2012-08-23 Thread John SJ Anderson
On Thursday, August 23, 2012 at 10:15 AM, Irfan Sayed wrote: > can someone please suggest ? > Explain what you're actually trying to achieve, instead of asking how to do what you think will let you accomplish what you're trying to achieve. Yes, if you write the insert() meth

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
it was quite rude. anyway lets say if i have to display the contents of array using insert method. if i just type :  $t->insert("end", "@arr1"); then surely , it will print the contents of array but on the same line i need to print the contents of array on separate li

Re: insert in perl tk

2012-08-23 Thread Jim Gibson
On Aug 23, 2012, at 10:51 AM, Irfan Sayed wrote: > it was quite rude. anyway What was quite rude? > lets say if i have to display the contents of array using insert method. > if i just type : $t->insert("end", "@arr1"); > then surely , it will print the con

Re: insert in perl tk

2012-08-23 Thread Shawn H Corey
: $t->insert("end", join( "\n", @array )); See `perldoc -f join` for details. -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. _Perl links_ official site : http://www.

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
Sent: Thursday, August 23, 2012 11:40 PM Subject: Re: insert in perl tk On Thu, 23 Aug 2012 10:51:09 -0700 (PDT) Irfan Sayed wrote: > i need to print the contents of array on separate line , so , i > thought , i should write one function where i will print the contents > of array on

Re: insert in perl tk

2012-08-23 Thread Jim Gibson
On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote: > thanks. this will help to print the contents of array on separate line. > however, if at all we need to call function then what is the syntax, how we > can call that ? What function do you want to call? When do you want to call it? What does the

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
i have to call localtime () function to get the latest time everytime when i print the lines using insert method i mean , i need to print the latest time in scrolled text box lets say : use Tk; $mw = MainWindow->new(); my $t = $mw->Scrolled("Text")->pack (-side => &

Re: insert in perl tk

2012-08-23 Thread Shekar
Try this. $t->insert("end", &gettime); -- Shekar On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed wrote: > i have to call localtime () function to get the latest time everytime when > i print the lines using insert method > i mean , i need to print the latest time in

Re: insert in perl tk

2012-08-24 Thread Irfan Sayed
thanks. it worked! regards irfan From: Shekar To: Irfan Sayed Cc: Jim Gibson ; Perl Beginners Sent: Friday, August 24, 2012 12:23 PM Subject: Re: insert in perl tk Try this. $t->insert("end", &gettime); -- Shekar On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed

Re: insert in perl tk

2012-08-24 Thread Shlomi Fish
Hi Shekar, On Fri, 24 Aug 2012 12:23:21 +0530 Shekar wrote: > Try this. > > $t->insert("end", &gettime); > Please don't recommend people to use leading ampersands in subroutine calls: * http://perl-begin.org/tutorials/bad-elements/#ampersand-in-subroutine-c

Re: insert in perl tk

2012-08-24 Thread Shekar
Thanks for the correction Shlomi. Mistake from my side, i copy pasted the wrong line from my terminal !!! -- Shekar On Fri, Aug 24, 2012 at 2:49 PM, Shlomi Fish wrote: > Hi Shekar, > > On Fri, 24 Aug 2012 12:23:21 +0530 > Shekar wrote: > > > Try this. > > >

How to Insert Array Elements Sequentially

2001-07-26 Thread Rashid Faraby
Hi Folks, I've been struggling with this for a couple of hours this morning and it seems like I'll need some help from the pros. I have a long file consisting of document numbers. I would like to insert sequentially a number into records saved in another file I am data munging

Help w/ script to insert text

2003-03-21 Thread William Voyek
Hi all, First of all I'm not a programmer and am completely new perl so please be gentle with me. My problem is that I'm trying to use the script below to insert some text into multiple files. The files are control files for qmail, the MTA we use. The text that I want to insert w

Re: Search and Insert into Hash

2003-07-14 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > What I am trying to do is to take lines out of a file that are > formatted like: > > SYSTEM="value1" DOMAIN="value2" etc. > > There are about 1000 lines like that and what I need to do is to take > all of the keys (like system and domain) and put them into a hash. But >

Re: Search and Insert into Hash

2003-07-15 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Jenda Krynicky wrote: > From: [EMAIL PROTECTED] >> What I am trying to do is to take lines out of a file that are >> formatted like: >> >> SYSTEM="value1" DOMAIN="value2" etc. >> >> There are about 1000 lines like that and what I need to do is to take >> all of th

Re: Search and Insert into Hash

2003-07-15 Thread Jenda Krynicky
From: Kevin Pfeiffer <[EMAIL PROTECTED]> > In article <[EMAIL PROTECTED]>, Jenda Krynicky wrote: > > > From: [EMAIL PROTECTED] > >> What I am trying to do is to take lines out of a file that are > >> formatted like: > >> > >> SYSTEM="value1" DOMAIN="value2" etc. > >> > >> There are about 1000 li

RE: Insert Var in Regex Problem

2002-07-10 Thread Timothy Johnson
It sounds like you want something more like: $string = "ABCDEFGHIJKLMNOP"; $x = "ABCDEF"; $string =~ s/$x//g; Or am I misunderstanding? -Original Message- From: Connie Chan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 3:06 PM To: [EMAIL PROTECTED] Su

Re: Insert Var in Regex Problem

2002-07-10 Thread Felix Geerinckx
on Wed, 10 Jul 2002 22:05:58 GMT, Connie Chan wrote: > Say, I have an input $x = "ABCDEF"; > and I will try to remove $x from a string, > what can I do ? > > Is there something like : > > $x =~ s/$x//g; That's just a complicated way to say $x = ''; But this works: #! perl -w u

Re: Insert Var in Regex Problem

2002-07-10 Thread Connie Chan
ally, logic error, my sample seem the var kills itself) Please help anyway. =) Rgds, Connie > -Original Message- > From: Connie Chan [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 10, 2002 3:06 PM > To: [EMAIL PROTECTED] > Subject: Insert Var in Regex Problem > &g

Re: Insert Var in Regex Problem

2002-07-10 Thread George Schlossnagle
t; > > > >> -Original Message- >> From: Connie Chan [mailto:[EMAIL PROTECTED]] >> Sent: Wednesday, July 10, 2002 3:06 PM >> To: [EMAIL PROTECTED] >> Subject: Insert Var in Regex Problem >> >> >> Hi all, >> >> Say, I have

Re: Insert Var in Regex Problem

2002-07-10 Thread Connie Chan
ednesday, July 10, 2002 3:06 PM > > To: [EMAIL PROTECTED] > > Subject: Insert Var in Regex Problem > > > > > > Hi all, > > > > Say, I have an input $x = "ABCDEF"; > > and I will try to remove $x from a string, > >

Re: Insert Var in Regex Problem

2002-07-10 Thread John W. Krahn
Connie Chan wrote: > > > > From: Connie Chan [mailto:[EMAIL PROTECTED]] > > > > > > Say, I have an input $x = "ABCDEF"; > > > and I will try to remove $x from a string, > > > what can I do ? > > > > > > Is there something like : > > > > > > $x =~ s/$x//g; > > Sorry everybody I've make a mist

Class to select/insert/delete/update

2004-06-24 Thread Rod Za
Hello, i'm trying to make a class to do select/insert/delete/update on a MySQL table (via DBI). this is a snip of code: sub query{ my $self = shift; my($sql) = @_; my @result; my $sth = $self->{dbh}->prepare($sql) or return undef; if($sql

Re: Mysql and binary data insert

2003-10-22 Thread Andrew Shitov
You have to have 'blob' filed in your database? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Insert text in HTML page...

2001-12-17 Thread Agustin Rivera
You can create a template html file, then insert a phrase in the middle that is searched-and-replaced. Such as .. INSERTTEXT Then the perl script would do.. $textfile="file.txt"; open(IN, $textfile) or die $!; while() {$text.=$_;} close(IN); ## then do the same for $htmlfile $ht

Re: Insert text in HTML page...

2001-12-17 Thread William.Ampeh
I hope you do not forget before dumping the contents of the file. -- #!/opt/local/bin/perl $my_file = "aa.txt"; open(IN, $my_file) or die "\n\ncannot open file\n\n"; @aa = ; print < @aa EOF ; __ William Ampeh (x3939) Federal Reser

Insert delimiter between number and alpha

2002-02-07 Thread Frank Newland
All, My input looks like this == 5544#1341343BORIS 6200#321BOWSER 89232652#6213VERONICA === I want to put a delimiter (#) between the rightmost number and the left most alpha Resulting in 5544#1341343#BORIS 6200#321#BOWSER 89232652#6213#VERONICA Any

RE: insert and query a db

2008-01-07 Thread Moon, John
[>>] ... Please try (not tested). Placeholders help me a lot: my $sth_insert = $dbh->prepare('Insert into info (id, name, grade, phone, cell, house, car) values (?,?,?,?,?,?,?)') or die

Re: insert and query a db

2008-01-11 Thread bbrecht56
On Jan 7, 1:50 pm, [EMAIL PROTECTED] (John Moon) wrote: > [>>] ... > > Please try (not tested). Placeholders help me a lot: > > my $sth_insert = $dbh->prepare('Insert into info (id, name, grade, > phone, cell, house, car) >values (?,?,?,?,?,

Re: insert and query a db

2008-01-11 Thread Tom Phoenix
On Jan 10, 2008 10:50 PM, <[EMAIL PROTECTED]> wrote: > Only the content of the first 2 fields is displayed: In your shoes, I would check that 'use warnings' and 'use strict' are in place, and other basics, then I'd start debugging at the database. Check out the tracing facility, documented in th

Re: insert and query a db

2008-01-16 Thread Tri Trinh
uninitialized value in printf at ./bonnerRunde.pl line 127. > house: 0 > Use of uninitialized value in printf at ./bonnerRunde.pl line 128. > car:0 > > Help is needed and highly appreciated . I would like also to know if > this is a good way to read and parse data then inse

Re: Insert value in existing record

2006-05-18 Thread Tom Phoenix
On 5/18/06, Gerald Wheeler <[EMAIL PROTECTED]> wrote: Wondering how I can insert a value: "abc|" There's more than one way to do it. One way would be a substitution (s///). Another would be to use split and join: split the line, do whatever you need to do with the el

RE: Insert value in existing record

2006-05-18 Thread Saboo, Nandakishore
Hi, As Tom Phoenix said there are many ways to do it, this is one of the way we can do it. +++ $string = "one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|"; $added = "abc|"; @tmp_array = split(/\|/,$string,4); for ($i=0;$i<$#tmp_array;$i++) {

Re: Insert value in existing record

2006-05-18 Thread John W. Krahn
Saboo, Nandakishore wrote: > Hi, Hello, > As Tom Phoenix said there are many ways to do it, this is one of the way we > can do it. > > +++ > $string = > "one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|"; > $added = "abc|"; > > @tmp_array = split(/

Re: DBI insert vs update question

2005-07-10 Thread Octavian Rasnita
Can't you use the replace sql query? Use it like you use "insert". It will insert new rows where there are no rows, and do an update where there are rows... Teddy - Original Message - From: "Peter Rabbitson" <[EMAIL PROTECTED]> To: Sent: Sunday, July

Re: DBI insert vs update question

2005-07-10 Thread Peter Rabbitson
On Sun, Jul 10, 2005 at 06:23:19PM +0300, Octavian Rasnita wrote: > Can't you use the replace sql query? > > Use it like you use "insert". It will insert new rows where there are no > rows, and do an update where there are rows... > Negative. REPLACE is j

Re: DBI insert vs update question

2005-07-10 Thread Peter Rabbitson
> I'm sure others will give you more informed answers.. But why can't > you create multiple statement handlers under the same connection? > Because you can't. One connection holds only one prepared statement (at least in MySQL). If you prepare $statement2 on the same $dbh, $statement1 automati

Re: DBI insert vs update question

2005-07-10 Thread Mads N. Vestergaard
re("SELECT * FROM ."); my $bar = $dbh->prepare("INSERT INTO ."); $foo->execute(); $foo->finish(); $bar->execute(); $bar->finish(); At least that works for me. Sorry if I misunderstood you. Mads Peter Rabbitson wrote: |>I'm sure others will give

Re: DBI insert vs update question

2005-07-10 Thread David Van Ginneken
Peter, > > Are you sure about that? > As far as I understand, what you say you can't do, is to have two > prepares for example: > > my $dbh = DBI->connect("dbi:mysql:database","user","pass"); > my $foo = $dbh->prepare("SELECT

Re: DBI insert vs update question

2005-07-10 Thread Wiggins d'Anconia
or a new record, but might provide > only a single field difference for an already existing record). This > obviously will involve a series of UPDATE and INSERT statements, mostly > in random order. As most RDBMS can hold only one prepared statement at a > time (including MySQL) I

Re: insert a . every four characters

2012-03-09 Thread Noah
On 3/9/12 8:37 PM, Noah wrote: Hi there, I am trying to insert a '.' every four characters. Say I have a $it = '123456789012' and want the result to be '1234.5678.9012' whats one of the smoothest ways to do that? okay I answered my own question. I am wonderin

Re: insert a . every four characters

2012-03-09 Thread Owen
> On 3/9/12 8:37 PM, Noah wrote: >> Hi there, >> >> I am trying to insert a '.' every four characters. Say I have a $it >> = >> '123456789012' and want the result to be '1234.5678.9012' >> >> whats one of the smoothest

Re: insert a . every four characters

2012-03-09 Thread Jim Gibson
At 8:37 PM -0800 3/9/12, Noah wrote: Hi there, I am trying to insert a '.' every four characters. Say I have a $it = '123456789012' and want the result to be '1234.5678.9012' whats one of the smoothest ways to do that? You could adapt the method suggested b

How to track the success of insert

2004-09-29 Thread Anish Kumar K.
Hi I was trying out some practice examples with DBI and CGI and kind of stuck while doing a comparison That is if I could insert successfully into a databse a script window shld come "Success". but when the insert fails a window shld come saying "Can;t insert ".. How

Re: How to Insert Array Elements Sequentially

2001-07-26 Thread Abdulaziz Ghuloum
quot;..AU:\n",wrap(" ","","$author"),"\n"; ## } ## ##} I hope this helps,,, Aziz,,, In article <[EMAIL PROTECTED]>, "Rashid Faraby" <[EMAIL PROTECTED]> wrote: > Hi Folks, > > I've been struggling with this fo

RE: Help w/ script to insert text

2003-03-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
William Voyek wrote: > Hi all, > > First of all I'm not a programmer and am completely new perl so please > be gentle with me. My problem is that I'm trying to use the script > below to insert some text into multiple files. The files are control > files for qmail, th

Re: Help w/ script to insert text

2003-03-21 Thread Rob Dixon
David --- Senior Programmer Analyst --- Wgo Wagner wrote: > > scanner. So, the text I need inserted is: > > > > > /usr/local/bin/odeiavir -r [EMAIL PROTECTED] > > > Try adding \ as [EMAIL PROTECTED] This escapes those characters > otherwise it tries to expand $EXT and possibly @$HOST. With the >

RE: Help w/ script to insert text

2003-03-21 Thread William Voyek
Thanks. This worked perfectly. William -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2003 11:58 To: [EMAIL PROTECTED] Subject: Re: Help w/ script to insert text David --- Senior Programmer Analyst --- Wgo Wagner wrote: > > scanner. So, th

Re: Class to select/insert/delete/update

2004-06-24 Thread Wiggins d Anconia
> Hello, > > i'm trying to make a class to do select/insert/delete/update on a MySQL table (via DBI). > this is a snip of code: > You haven't really shown us a class, just a method... > sub query{ > my $self = shift; > my($sql) = @_; >

  1   2   >