Re: insert in perl tk

2012-08-24 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 = 'left', -expand=1); $t-insert(end

Re: insert in perl tk

2012-08-24 Thread Shekar
Try this. $t-insert(end, gettime); -- Shekar On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed irfan_sayed2...@yahoo.comwrote: 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

Re: insert in perl tk

2012-08-24 Thread Irfan Sayed
thanks. it worked! regards irfan From: Shekar c.shekar1...@gmail.com To: Irfan Sayed irfan_sayed2...@yahoo.com Cc: Jim Gibson jimsgib...@gmail.com; Perl Beginners beginners@perl.org Sent: Friday, August 24, 2012 12:23 PM Subject: Re: insert in perl tk Try this. $t-insert(end, gettime

Re: insert in perl tk

2012-08-24 Thread Shlomi Fish
Hi Shekar, On Fri, 24 Aug 2012 12:23:21 +0530 Shekar c.shekar1...@gmail.com 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-calls * https

Re: insert in perl tk

2012-08-24 Thread Shekar
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-calls * https://www.socialtext.net/perl5/subroutines_called_with_the_ampersand Instead write: $t

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

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
can someone please suggest ? regards irfan From: Irfan Sayed irfan_sayed2...@yahoo.com To: beginners@perl.org 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

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() method properly, you

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 line , so , i thought , i should

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 contents of array but on the same line I

Re: insert in perl tk

2012-08-23 Thread Shawn H Corey
on each line? If so: $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.perl.org

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
@perl.org Cc: Irfan Sayed irfan_sayed2...@yahoo.com 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 irfan_sayed2...@yahoo.com wrote: i need to print the contents of array on separate line , so , i thought , i should write

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

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:$!; return

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

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

Re: insert

2012-05-07 Thread lina
On Mon, May 7, 2012 at 7:52 PM, Shawn H Corey shawnhco...@gmail.com 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. I can only write some

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 shawnhco...@gmail.com 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

Re: insert

2012-05-07 Thread timothy adigun
Hi lina On Mon, May 7, 2012 at 8:36 AM, lina lina.lastn...@gmail.com 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: #!/usr/bin/perl use warnings; use strict; my

Re: insert

2012-05-07 Thread John W. Krahn
timothy adigun wrote: On Mon, May 7, 2012 at 8:36 AM, linalina.lastn...@gmail.com 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

Re: insert

2012-05-07 Thread timothy adigun
On Mon, May 7, 2012 at 11:29 PM, John W. Krahn jwkr...@shaw.ca wrote: timothy adigun wrote: On Mon, May 7, 2012 at 8:36 AM, linalina.lastn...@gmail.com 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

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 For additional commands, e-mail

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 wondering if there is a different way

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 ways to do that? okay I answered my own question. I am wondering if there is a different

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 by 'perldoc -q commas' How can I

How Do I insert a password into a PDF

2011-11-25 Thread Ramprasad Prasad
I am generating pdf files with http://code.google.com/p/wkhtmltopdf/ I want to password protect the PDF's .. How can I do this ?

PERL MYSQL query IF EXISTS then UPDATE else INSERT

2010-10-20 Thread S Pratap Singh
Hello, I want to update my database if the key value is already there then it will update the required field else it will insert the new row in the same table. Insert query works fine but I am not able to figure out how to achieve this IF EXISTS then UPDATE else INSERT using a one liner MYSQL

Re: PERL MYSQL query IF EXISTS then UPDATE else INSERT

2010-10-20 Thread Uri Guttman
SPS == S Pratap Singh kdari...@gmail.com writes: SPS Insert query works fine but I am not able to figure out how to SPS achieve this IF EXISTS then UPDATE else INSERT using a one SPS liner MYSQL statement . If someone can give me an example to SPS write such query and execute it from

Re: PERL MYSQL query IF EXISTS then UPDATE else INSERT

2010-10-20 Thread Chris Knipe
Just use SQL? INSERT INTO tbl, VALUES ('11','22','33') ON DUPLICATE KEY http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html On Wed, Oct 20, 2010 at 9:23 AM, Uri Guttman u...@stemsystems.com wrote: SPS == S Pratap Singh kdari...@gmail.com writes: SPS Insert query works

Re: PERL MYSQL query IF EXISTS then UPDATE else INSERT

2010-10-20 Thread Peter Scott
On Wed, 20 Oct 2010 12:07:03 +0530, S Pratap Singh wrote: I want to update my database if the key value is already there then it will update the required field else it will insert the new row in the same table. Insert query works fine but I am not able to figure out how to achieve

RE: PERL MYSQL query IF EXISTS then UPDATE else INSERT

2010-10-20 Thread Mimi Cafe
This is the wrong list for MySQL questiosn, but I believe you are probably looking to replace the matching record, use MySQL INSERT REPLACE INTO tablename. Mimi = -Original Message- = From: S Pratap Singh [mailto:kdari...@gmail.com] = Sent: 20 October 2010 07:37 = To: beginners

how to insert records into table in oracle database.

2009-01-17 Thread Sureshkumar M (HCL Financial Services)
Hi, Can some one help me how to insert records into oracle database tables using Perl script? Regards, Suresh DISCLAIMER: --- The contents of this e-mail and any

Re: how to insert records into table in oracle database.

2009-01-17 Thread Owen
Hi, Can some one help me how to insert records into oracle database tables using Perl script? perldoc DBI is worth the read, then read the driver documentation for Oracle (it would be something like DBD::Oracle) Owen -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org

Re: insert keyword

2008-11-11 Thread Chas. Owens
, 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 that this happens only in debug mode. The regular output is: onex twox three I don't know what

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/\s/x /g; In this case, I am trying to insert x where there is a space. one two three should

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 should become

Re: insert and query a db

2008-01-16 Thread Tri Trinh
and highly appreciated . I would like also to know if this 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

Re: user arguments, oracle - insert, delete and drop!

2008-01-14 Thread perlmunky
= (); for (@gi_column_names) { $genuine_columns{${$_}[0]} = 1; } for (@well_column_names) { $genuine_columns{${$_}[0]} = 1; } #I dont think I need the {1,} if ($current_text =~ /\:{1,}|\--{1,}|\#{1,}|\;|insert|drop|create|^$/ig) { my $tc = ulliInvalid Input (: ; --; #)/li/ul; $c-res-body($tc

Re: user arguments, oracle - insert, delete and drop!

2008-01-14 Thread John W. Krahn
of the duplication by doing it like this: my %genuine_columns = map { $_-[0] = 1 } map @{ _get_column_names( $c, $_ ) }, qw/T1 T2/; #I dont think I need the {1,} if ($current_text =~ /\:{1,}|\--{1,}|\#{1,}|\;|insert|drop|create|^$/ig) The characters

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 (?,?,?,?,?,?,?)') or die DBI-errstr; while

Re: user arguments, oracle - insert, delete and drop!

2008-01-11 Thread Tom Phoenix
On Jan 11, 2008 6:11 AM, perlmunky [EMAIL PROTECTED] wrote: I realise that this is not smart, at least without any parameter checking. I need a way of making the information 'safe' - avoid sql injections etc. hints, tips and solutions accepted :) Have you tried writing Perl code to do the

Re: user arguments, oracle - insert, delete and drop!

2008-01-11 Thread Chris Charley
- Original Message - From: perlmunky [EMAIL PROTECTED] Newsgroups: perl.beginners To: beginners@perl.org Sent: Friday, January 11, 2008 9:11 AM Subject: user arguments, oracle - insert, delete and drop! Hi List, I am in the process of making a web service which will (at some point

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 the

Re: user arguments, oracle - insert, delete and drop!

2008-01-11 Thread Tom Phoenix
On Jan 11, 2008 9:43 AM, [EMAIL PROTECTED] wrote: I have written some stuff - I am just concerned that people on the big bad web know far more about these things (oracle - perl) than I and that they will, with little trouble, side-step my parameter checking. So, show us your code; and we'll

user arguments, oracle - insert, delete and drop!

2008-01-11 Thread perlmunky
Hi List, I am in the process of making a web service which will (at some point) query an oracle DB with some user supplied text. Currently the page allows the user to select the information in the insert from a tick box, the tables from a list and the conditional they can choose and then enter

insert and query a db

2008-01-07 Thread bbrecht56
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; #--# # Create the table info

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 DBI-errstr; while (DATA

Re: Tk question about -command=sub{} and Text Insert()

2007-11-19 Thread Panda-X
2007/11/19, zentara [EMAIL PROTECTED]: On Mon, 19 Nov 2007 00:14:29 +0800, [EMAIL PROTECTED] (Panda-X) wrote: Hi all, Below is my code. With this code, 12345 will show at once after 5 seconds I click the button. But what I want is to insert() each number per second. Is that something I

Tk question about -command=sub{} and Text Insert()

2007-11-18 Thread Panda-X
Hi all, Below is my code. With this code, 12345 will show at once after 5 seconds I click the button. But what I want is to insert() each number per second. Is that something I can do like $| = 1 in such case ? At least, could anybody tell this is the behavior of insert () ? or it's the behavior

Re: Tk question about -command=sub{} and Text Insert()

2007-11-18 Thread Tom Phoenix
On 11/18/07, Panda-X [EMAIL PROTECTED] wrote: But what I want is to insert() each number per second. sub RollText{ for ( 1..5 ) { $_[0] -{mw}{box} - insert ( 'end', $_ ) ; sleep 1; } } You probably don't want sleep() there; the after() method is generally the way

Re: Tk question about -command=sub{} and Text Insert()

2007-11-18 Thread Panda-X
2007/11/19, Tom Phoenix [EMAIL PROTECTED]: On 11/18/07, Panda-X [EMAIL PROTECTED] wrote: But what I want is to insert() each number per second. sub RollText{ for ( 1..5 ) { $_[0] -{mw}{box} - insert ( 'end', $_ ) ; sleep 1; } } You probably don't want sleep

Re: Tk question about -command=sub{} and Text Insert()

2007-11-18 Thread Tom Phoenix
On 11/18/07, Panda-X [EMAIL PROTECTED] wrote: Any more clues ? This is a forum for Perl beginners, but there are forums available specifically for all of the major modules used with Perl. Some modules have more than one forum. As you might expect, you'll generally get better answers faster by

how to insert rows into database from array/hash using DBI

2007-10-23 Thread petelink1
I'm trying to grab data from an MS-Access log file and put it into a fast, read-only database. (I'm thinking SQL Lite at this point.) The code below is working. Now I need to put the identical data and structure into an SQL Lite table. Any suggestions on where to look for examples? (or if you

Re: how to insert rows into database from array/hash using DBI

2007-10-23 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: I'm trying to grab data from an MS-Access log file and put it into a fast, read-only database. (I'm thinking SQL Lite at this point.) The code below is working. Now I need to put the identical data and structure into an SQL Lite table. Any suggestions on where to look

Re: how to insert rows into database from array/hash using DBI

2007-10-23 Thread Matthew Whipple
[EMAIL PROTECTED] wrote: I'm trying to grab data from an MS-Access log file and put it into a fast, read-only database. (I'm thinking SQL Lite at this point.) Make sure that's it's only read-only after it's written to. Depending on what you're doing with the data it may be easiest and

Re: How to insert data onto an existing XML file

2007-10-08 Thread Jenda Krynicky
Jenda Krynicky wrote: On 2 Oct 2007 at 10:54, Matthew Whipple wrote: You can't really strictly append to a well-formed XML without breaking the syntax. You need the properly closed top level element at the very least, in addition to whatever nesting may be going on.

Re: How to insert data onto an existing XML file

2007-10-03 Thread Jenda Krynicky
and rewrite something to insert something in the middle is something that can't be helped, but reparsing and recreating everything for APPEND? The requirement of a root tag in XML is ... yet another lovely misfeature of the format. Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz

RE: How to insert data onto an existing XML file

2007-10-03 Thread Bob McConnell
-Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 03, 2007 6:12 AM To: beginners@perl.org Subject: Re: How to insert data onto an existing XML file On 2 Oct 2007 at 10:54, Matthew Whipple wrote: An ugly solution would be to chop off

Re: How to insert data onto an existing XML file

2007-10-03 Thread Ken Foskey
On Wed, 2007-10-03 at 00:42 +0800, Steven Sim wrote: Gurus; Sorry if this is not the proper forum. I've successfully written a Perl script to create a specific XML file. The problem comes when I attempt to run the script again and append XML entries onto the XML file. Using

Re: How to insert data onto an existing XML file

2007-10-03 Thread Matthew Whipple
enough files, but is simply crazy for anything longer. Parse and rewrite something to insert something in the middle is something that can't be helped, but reparsing and recreating everything for APPEND? If you're dealing with long enough XML files that recreating them isn't efficient

How to insert data onto an existing XML file

2007-10-02 Thread Steven Sim
Gurus; Sorry if this is not the proper forum. I've successfully written a Perl script to create a specific XML file. The problem comes when I attempt to run the script again and append XML entries onto the XML file. Using XML::Writer, I am unable to perform a proper append. (The append IO

Re: How to insert data onto an existing XML file

2007-10-02 Thread Matthew Whipple
for your specific XML scheme which will ensure that the document syntax is what is expected, and then insert the elements in the proper location (most likely using another module in place of or in addition to XML::Writer). Steven Sim wrote: Gurus; Sorry if this is not the proper forum. I've

Re: How to insert data onto an existing XML file

2007-10-02 Thread Tom Phoenix
On 10/2/07, Steven Sim [EMAIL PROTECTED] wrote: I've successfully written a Perl script to create a specific XML file. The problem comes when I attempt to run the script again and append XML entries onto the XML file. Using XML::Writer, I am unable to perform a proper append. (The append

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 line after line. I

Re: database insert algorithm

2007-09-24 Thread Rob Coops
the 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 addition

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: http

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 database and inserting line

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

How to insert an array in to the middle of another array after a certain pattern

2007-04-13 Thread Typos
Hello everyone, I'm a Perl beginner and I've been trying for a while to to insert an array in to the middle of another array after a certain pattern. Here is what I'm trying to do...I have the Linux Iptables configuration file, which has a custom chain called MAC which hold all the IP to MAC

Re: How to insert an array in to the middle of another array after a certain pattern

2007-04-13 Thread John W. Krahn
Typos wrote: Hello everyone, Hello, I'm a Perl beginner and I've been trying for a while to to insert an array in to the middle of another array perldoc -f splice after a certain pattern. More difficult. You first have to determine at what array index the pattern exists. Here is what

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

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: 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 modify

Insert value in existing record

2006-05-18 Thread Gerald Wheeler
Wondering how I can insert a value: abc| w/o the quotes) immediately after the third | (pipe character) in file xyz.txt. Each record within the file has 14 fields separated by the pipe character. Example: Before: one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen

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| w/o the quotes) immediately after the third | (pipe character) in file xyz.txt. There's more than one way to do it. One way would be a substitution (s///). Another would be to use split and join

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 =

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' for table 'rcpt

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: DBD::mysql::st execute failed: INSERT command

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 command denied to user 'abc'@'192.168.3.10

Re: mysql insert errors

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

DBI insert vs update question

2005-07-10 Thread Peter Rabbitson
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 have 2 ways to do this that look somewhat efficient: 1. Sweep

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: beginners@perl.org Sent: Sunday, July 10, 2005 18:09 PM

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 just a shortcut for DELETE FROM... INESERT

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

Re: DBI insert vs update question

2005-07-10 Thread Mads N. Vestergaard
(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 you more informed answers.. But why can't |you create multiple statement handlers under the same

Re: DBI insert vs update question

2005-07-10 Thread David Van Ginneken
do, is to have two prepares for example: my $dbh = DBI-connect(dbi:mysql:database,user,pass); my $foo = $dbh-prepare(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

Re: DBI insert vs update question

2005-07-10 Thread Wiggins d'Anconia
, 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 have 2 ways to do this that look

using Perl to insert footer into PDF files?

2005-03-29 Thread Alex Walker
I'm a little new at PDF manipulation in Perl and I'm not completely convinced that what I want to do is even possible. Basically what i want to do is take a multi-page PDF file and insert a footer onto the bottom of every page along with sequential page numbers. I've been tinkering with the PDF

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 will I track

RE: How to track the success of insert

2004-09-29 Thread NYIMI Jose \(BMB\)
-Original Message- From: Anish Kumar K. [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 9:28 AM To: beginners perl Subject: How to track the success of insert Hi I was trying out some practice examples with DBI and CGI and kind of stuck while doing

RE: How to track the success of insert

2004-09-29 Thread NYIMI Jose \(BMB\)
-Original Message- From: Anish Kumar K. [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 9:28 AM To: beginners perl Subject: How to track the success of insert Hi I was trying out some practice examples with DBI and CGI and kind of stuck while doing

RE: insert data with Perl into multiple MySQL tables

2004-09-17 Thread Bob Showalter
Maxipoint Rep Office wrote: How insert data with Perl into multiple MySQL tables? You need multiple INSERT statements. Use a transaction if they all need to complete or fail together. I don't use MySQL, so I don't know how transactions work for it specifically, but typically you just use

insert data with Perl into multiple MySQL tables

2004-09-16 Thread Maxipoint Rep Office
How insert data with Perl into multiple MySQL tables? I can not find any clear advice.. this is for TABLE1: # Connect to the database. my $dbh = DBI-connect(DBI:mysql:database=;host=localhost, username, pass, {'RaiseError' = 1}); # now first

RE: create connection from html form into insert MySQL data script

2004-09-08 Thread Maxipoint Rep Office
-Original Message- From: Eduardo Vázquez Rodríguez [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 2:02 AM To: Maxipoint Rep Office Cc: Charles K. Clarkson; [EMAIL PROTECTED] Subject: Re: create connection from html form into insert MySQL data script I think he is from

RE: create connection from html form into insert MySQL data script

2004-09-08 Thread Charles K. Clarkson
: : an HTML form? Is that what you want to use CGI.pm for? : : RE: yes, I wish delete it in script and that form send same : values using CGI.pm and HTMP::template [snip] : : : $dbh-do(INSERT INTO portal (turistobjekt, adresa, brojgrada, : : : grad, manjemjesto, otok, regija, ime, prezime, tel, mob, fax

create connection from html form into insert MySQL data script

2004-09-07 Thread Maxipoint Rep Office
I am successful insert data in MySQL with code below: #!/usr/bin/perl -w use strict; use DBI(); use CGI; use HTML::Template; # Connect to the database. my $dbh = DBI-connect(DBI:mysql:database=MYDABASE;host=localhost, MYDBUSERNAME, MYPASS

RE: create connection from html form into insert MySQL data script

2004-09-07 Thread Charles K. Clarkson
Maxipoint Rep Office [EMAIL PROTECTED] wrote: : I am successful insert data in MySQL with code below: I am having trouble understanding your message. I assume English is not your first language. : #!/usr/bin/perl -w : use strict; Great start! : use DBI(); : use CGI; : use HTML

RE: create connection from html form into insert MySQL data script

2004-09-07 Thread Maxipoint Rep Office
-Original Message- From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 1:06 AM To: 'Maxipoint Rep Office'; [EMAIL PROTECTED] Subject: RE: create connection from html form into insert MySQL data script Maxipoint Rep Office [EMAIL PROTECTED] wrote

  1   2   >