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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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. 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
---
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";
',
'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 [
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
'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
, ?, ? ) ";
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)'; '
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
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
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
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
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( ?, ?, ?, ?,?,?, ?,
> ?, ? ) ";
>
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
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
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_
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
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
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
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
34 matches
Mail list logo