RE: Insert data in one table from Another Problem

2011-02-17 Thread Travis Ard
Here's one option to "pivot" your results: select record_id ,max(soi) as soi ,max(heading) as heading ,max(description) as description ,max(relloc) as relloc from (select record_id ,if(field_name = 'SOI', field_value, '') as soi ,if(field_name = 'Heading', field_va

Re: INSERT DATA INTO TABLE

2009-11-28 Thread mos
At 12:09 AM 11/28/2009, Krishna Chandra Prajapati wrote: Hi Mos, In the below two command does 1 is faster than 2. 1. LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet; 2. LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet LINES TERMINATED BY '\r\n' enclosed by '"'; Thanks, Krishna

Re: INSERT DATA INTO TABLE

2009-11-27 Thread Krishna Chandra Prajapati
Hi Mos, In the below two command does 1 is faster than 2. * 1. LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet;* 2. *LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet* *LINES TERMINATED BY '\r\n' enclosed by '"';* Thanks, Krishna Ch. Prajapati On Sat, Nov 28, 2009 at 3:50 AM, mos

Re: INSERT DATA INTO TABLE

2009-11-27 Thread mos
At 07:40 AM 11/27/2009, Krishna Chandra Prajapati wrote: Hi Experts, load data local infile and insert into are the two methods of inserting data into a mysql table. Out of the above two method. Is there any faster method of inserting data into mysql tables. No. Load Data is the fastest meth

Re: insert data in to columns base on the selection of the list box.

2007-04-03 Thread Carlos Proal
Can you tell us what exactly is your problem ? ie returned error, logic, or what ? My first impression es that your insert is wrong, because inserts cant have "where" conditions (it makes no sense) probably you want to do a completely new insert including the column1 or maybe you want an u

RE: insert data in to columns base on the selection of the list box.

2007-04-03 Thread Jerry Schwartz
Without knowing where the values of column2, column3, and column4 are coming from it's a little hard to say what the best technique would be. Usually one would take the POSTed value from the select control and use it to retrieve the related data from a table in your data base. Regards, Jerry Sch

RE: insert data

2005-03-05 Thread Gerald Preston
John Trammell Cc: mysql@lists.mysql.com; [EMAIL PROTECTED]; Gerald Preston Subject: Re: insert data Right. First, I think the logic is flawed. We should successfully prepare() or die. Period. If the call to prepare() failed ($sth is undef), we should not making dying conditional on yet anot

Re: insert data

2005-03-04 Thread Michael Stassen
Right. First, I think the logic is flawed. We should successfully prepare() or die. Period. If the call to prepare() failed ($sth is undef), we should not making dying conditional on yet another value. More to the point, this line is actually the cause of the problem. (Sorry I didn't see i

Re: insert data

2005-03-04 Thread Michael Stassen
Gerald Preston wrote: David, I read them and installed 4.1.10 and I am back to square one: I used the following code: my $dbh=DBI->connect( 'dbi:mysql:club', 'gjwpp88', 'x' ) or die "\n$DBI::errstr\n"; You do not specify the host, so you are connecting to the default, which is "localhos

RE: insert data

2005-03-04 Thread John Trammell
Gerals Preston wrote: [snip] > my $sth = $dbh->prepare( $sql ) or die $dbh->errstr if $dbh->err; [snip] Regardless of other problems you may be having, I think you're not doing what you want to do here. How about instead: my $sth = $dbh->prepare($sql); $sth || die "Error preparing sth from '$sql

Re: insert data

2005-03-04 Thread Roger Baklund
Gerald Preston wrote: [...] I get "DBI connect<'club','gjwpp88',..> failed; Client does not support authentication protocol requested by server" Check this: http://dev.mysql.com/doc/mysql/en/old-client.html > -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

RE: insert data

2005-03-04 Thread Gerald Preston
x27;) WHERE Host = 'local_host' AND User = 'gjwpp88'; SET PASSWORD FOR 'gjwpp88'@'local_host' = OLD_PASSWORD('x'); SELECT 'local_host', 'gjwpp88', Password FROM mysql.user WHERE LENGTH('x') > 16; FL

RE: insert data

2005-02-28 Thread Logan, David (SST - Adelaide)
8408 4259 - Fax -Original Message- From: Gerald Preston [mailto:[EMAIL PROTECTED] Sent: Tuesday, 1 March 2005 10:10 AM To: 'William R. Mussatto'; mysql@lists.mysql.com Subject: RE: insert data William, I tried " GRANT ALL ON *.* " and got error " 1064 <420

Re: insert data

2005-02-28 Thread John Doe
Hi Gerald my last try... i'm not very lucky in helping in this list... > This is the actual code except for the "": > > [...] > my $sth = $dbh->prepare( $sql ) or die $dbh->errstr if $dbh->err; Maybe this expression is the reason (combination of 'or' and 'if'). Example code: === my $no_e

RE: insert data

2005-02-28 Thread Gerald Preston
William, I tried " GRANT ALL ON *.* " and got error " 1064 <4200>: You have an error in your SQL syntax " ?? Jerry -Original Message- From: William R. Mussatto [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 3:25 PM To: mysql@lists.mysql.com Subjec

Re: insert data

2005-02-28 Thread Eamon Daly
d make sure that each of your execute parameters have some value prior to the execute. Eamon Daly - Original Message - From: "Gerald Preston" <[EMAIL PROTECTED]> To: "'Michael Stassen'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; Sent

RE: insert data

2005-02-28 Thread William R. Mussatto
re. I have been writing code on a SUN Oracle systems for > over five years. > > Regards, > > Jerry Did you 'grant' user "" access to all the tables in database club? > > -Original Message- > From: Michael Stassen [mailto:[EMAIL PROTEC

RE: insert data

2005-02-28 Thread Gerald Preston
--- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 9:29 AM To: Gerald Preston Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: insert data From perldoc DBD::mysql use DBI; $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";

Re: insert data

2005-02-28 Thread Michael Stassen
', 'a_password', {RaiseError=>1, AutoCommit=>1}) or die "$0: $DBI::errstr"; } So, try using "club" instead of "database=club", and a hostname too. greetings joe [nothing new below] -Original Message- From: John Doe [

Re: insert data

2005-02-28 Thread Michael Stassen
ame'; my $port ='1234'; $dbh=DBI->connect("DBI:mysql:$db:$host:$port", 'a_username', 'a_password', {RaiseError=>1, AutoCommit=>1}) or die "$0: $DBI::errstr"; } So, try using "club" instead of "d

Re: insert data

2005-02-27 Thread John Doe
'a_username', 'a_password', {RaiseError=>1, AutoCommit=>1}) or die "$0: $DBI::errstr"; } So, try using "club" instead of "database=club", and a hostname too. greetings joe [nothing new below] > -Original Me

RE: insert data

2005-02-27 Thread Paul DuBois
, ?, ? ) "; my $sth = $dbh->prepare( $sql ); die $dbh->errstr if $dbh->err; What am I ding wrong? Thanks, Jerry ---Original Message- From: Gerald Preston [mailto:[EMAIL PROTECTED] Sent: Sunday, February 27, 2005 5:13 AM To: 'Logan, David (SST - Adelaide)'; '

RE: insert data

2005-02-27 Thread Logan, David (SST - Adelaide)
treet, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Gerald Preston [mailto:[EMAIL PROTECTED] Sent: Monday, 28 February 2005 8:41 AM To: Logan, David (SST - Adelaide); mysql@lists.mysql.com Subject: RE: insert data D

RE: insert data

2005-02-27 Thread Gerald Preston
David (SST - Adelaide) [mailto:[EMAIL PROTECTED] Sent: Sunday, February 27, 2005 3:27 PM To: Gerald Preston; mysql@lists.mysql.com Subject: RE: insert data Hi Gerald, The only thing I can think of is that you have a syntax error in your SQL that hasn't showed up in translation to email. Are

RE: insert data

2005-02-27 Thread Logan, David (SST - Adelaide)
ECTED] Sent: Monday, 28 February 2005 7:49 AM To: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: RE: insert data The object used: my $dbh=DBI->connect( 'DBI:mysql:database=club', 'xxx, 'x', { PrintError => 0} ) or die $DBI::errstr; Jerry -Original Messag

RE: insert data

2005-02-27 Thread Gerald Preston
The object used: my $dbh=DBI->connect( 'DBI:mysql:database=club', 'xxx, 'x', { PrintError => 0} ) or die $DBI::errstr; Jerry -Original Message- From: John Doe [mailto:[EMAIL PROTECTED] Sent: Sunday, February 27, 2005 6:37 AM To: mysql@lists.mysql.c

Re: insert data

2005-02-27 Thread John Doe
Hi Gerald > I am trying to insert data for the first time using MySQL. In Oracle I > used the following: > > # my $sql = "insert into bar( group_name, me, daily, item, unit, qty, > amount, tax, total ) > > # values( ?, ?, ?, ?,?,?, ?, > ?, ? ) "; >

RE: insert data

2005-02-27 Thread Gerald Preston
David, Still the same error!. Jerry -Original Message- From: Logan, David (SST - Adelaide) [mailto:[EMAIL PROTECTED] Sent: Sunday, February 27, 2005 5:49 AM To: Gerald Preston; mysql users Subject: RE: insert data Hi Gerald, Try something like my $sth = $dbh->prepare("ins

RE: insert data

2005-02-27 Thread Logan, David (SST - Adelaide)
Sorry, Jerry -Original Message- From: Logan, David (SST - Adelaide) [mailto:[EMAIL PROTECTED] Sent: Sunday, February 27, 2005 5:09 AM To: Gerald Preston; mysql users Subject: RE: insert data Hi Gerald, If this is copied out of your perl code then you haven't put anything into the $s

RE: insert data

2005-02-27 Thread Gerald Preston
rald Preston [mailto:[EMAIL PROTECTED] Sent: Sunday, February 27, 2005 5:13 AM To: 'Logan, David (SST - Adelaide)'; 'mysql users' Subject: RE: insert data David, The actual code is uncommented: my $sql = "insert into bar( group_

RE: insert data

2005-02-27 Thread Gerald Preston
e) [mailto:[EMAIL PROTECTED] Sent: Sunday, February 27, 2005 5:09 AM To: Gerald Preston; mysql users Subject: RE: insert data Hi Gerald, If this is copied out of your perl code then you haven't put anything into the $sql variable. Try uncommenting the 2 lines above. Regards David

RE: insert data

2005-02-27 Thread Logan, David (SST - Adelaide)
Hi Gerald, If this is copied out of your perl code then you haven't put anything into the $sql variable. Try uncommenting the 2 lines above. Regards David Logan Database Administrator HP Managed Services 148 Frome Street, Adelaide 5000 Australia +61 8 8408 4273 - Work +61 417 268 665 - Mobil

RE: Insert data if not duplicate based on order

2004-06-21 Thread John McCaskey
I don't think its possible in one query. One thing you can do is lock the table when you select the 20 rows and determine whether to do the insert. Then unlock when done. This avoids the concurrency issue you are having, but it may cause unacceptable perfomance if you have a lot of queries hitti

Re: INSERT data into multiple tables

2003-09-24 Thread Antony Dovgal
On Wed, 24 Sep 2003 14:23:04 -0500 "Dan J. Rychlik" <[EMAIL PROTECTED]> wrote: > Hello, > > I have a question about INSERTing data into 2 different tables with one statement. > Can you do this? > > INSERT INTO table1 (name,address,phone) VALUES ( ' USER ', ' USERADDY ',' > USERPHONE') AND tab