Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Dotan Cohen
On Mon, Sep 19, 2011 at 04:00, Hank hes...@gmail.com wrote: I agree with Brandon's suggestions, I would just add when using numeric types in PHP statements where you have a variable replacement, for instance: $sql=INSERT into table VALUES ('$id','$val'); where $id is a numeric variable in

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Dotan Cohen
On Mon, Sep 19, 2011 at 07:47, Reindl Harald h.rei...@thelounge.net wrote: what ugly style - if it is not numeric and you throw it to the database you are one of the many with a sql-injection because if you are get ivalid values until there you have done no sanitize before and do not here

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Hank
what ugly style - if it is not numeric and you throw it to the database you are one of the many with a sql-injection because if you are get ivalid values until there you have done no sanitize before and do not here It's a matter of opinion. I never said the data wasn't sanitized (it is).

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Reindl Harald
Am 19.09.2011 16:55, schrieb Hank: what ugly style - if it is not numeric and you throw it to the database you are one of the many with a sql-injection because if you are get ivalid values until there you have done no sanitize before and do not here It's a matter of opinion. I never said

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Dotan Cohen
On Mon, Sep 19, 2011 at 18:11, Reindl Harald h.rei...@thelounge.net wrote: it is not because it is clear that it is sanitized instead hope and pray thousands of layers somewhere else did it - for a inline-query the best solution, if you are using a framework you will never have the insert into

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Hank
Best of both worlds: $username=$_POST['username']; // do some stuff with username here $M=array(); // Array of things to be inserted into MySQL $M[username]=mysql_real_escape_string($username); // Everything that goes into $M is escaped $query=INSERT INTO table (username) VALUES

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Dotan Cohen
On Tue, Sep 20, 2011 at 01:11, Hank hes...@gmail.com wrote: Best of both worlds: $username=$_POST['username']; // do some stuff with username here $M=array();  // Array of things to be inserted into MySQL $M[username]=mysql_real_escape_string($username); // Everything that goes into $M is

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Reindl Harald
Am 20.09.2011 00:39, schrieb Dotan Cohen: On Tue, Sep 20, 2011 at 01:11, Hank hes...@gmail.com wrote: Best of both worlds: $username=$_POST['username']; // do some stuff with username here $M=array(); // Array of things to be inserted into MySQL

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Hank
I want to be sure that all variables in the query are escaped. I don't trust myself or anyone else to do this to every variable right before the query: $someVar=mysql_real_escape_string($someVar); But you're doing exactly that right before the query anyway with:

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Dotan Cohen
On Tue, Sep 20, 2011 at 02:09, Hank hes...@gmail.com wrote: I want to be sure that all variables in the query are escaped. I don't trust myself or anyone else to do this to every variable right before the query: $someVar=mysql_real_escape_string($someVar); But you're doing exactly that

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Dotan Cohen
On Tue, Sep 20, 2011 at 01:48, Reindl Harald h.rei...@thelounge.net wrote: i would use a samll class holding the db-connection with insert/update-methods pass the whole record-array, lokk what field types are used in the table and use intval(), doubleval() or mysql_real_escape-String so you

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Dotan Cohen
On Tue, Sep 20, 2011 at 01:48, Reindl Harald h.rei...@thelounge.net wrote: i would use a samll class holding the db-connection with insert/update-methods pass the whole record-array, lokk what field types are used in the table and use intval(), doubleval() or mysql_real_escape-String By the

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-19 Thread Reindl Harald
Am 20.09.2011 01:23, schrieb Dotan Cohen: On Tue, Sep 20, 2011 at 01:48, Reindl Harald h.rei...@thelounge.net wrote: i would use a samll class holding the db-connection with insert/update-methods pass the whole record-array, lokk what field types are used in the table and use intval(),

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-18 Thread Brandon Phelps
fields in quotes as well, although it is not necessary: UPDATE mytable SET int_field = '5' WHERE id = '3'; On 9/18/11 5:00 AM, Dotan Cohen wrote: I am somewhat confused as to the proper way to place quotes around arguments in INSERT and SELECT statements. I also don't see where this is made explicit

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-18 Thread Dotan Cohen
On Sun, Sep 18, 2011 at 17:44, Brandon Phelps bphe...@gls.com wrote: Personally I don't use any quotes for the numeric types, and single quotes for everything else.  Ie: Thanks, Brandon. I understand then that quote type is a matter of taste. I always use double quotes in PHP and I've only

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-18 Thread Hank
On Sun, Sep 18, 2011 at 12:28 PM, Dotan Cohen dotanco...@gmail.com wrote: On Sun, Sep 18, 2011 at 17:44, Brandon Phelps bphe...@gls.com wrote: Personally I don't use any quotes for the numeric types, and single quotes for everything else. Ie: Thanks, Brandon. I understand then that

Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP

2011-09-18 Thread Reindl Harald
Am 19.09.2011 03:00, schrieb Hank: I agree with Brandon's suggestions, I would just add when using numeric types in PHP statements where you have a variable replacement, for instance: $sql=INSERT into table VALUES ('$id','$val'); where $id is a numeric variable in PHP and a numeric field

INSERT INTO ... SELECT not inserting all rows

2009-06-11 Thread Müller Andreas
Dear All I'm trying to insert a bunch of data from TableA in TableB by doing SELECT INTO TableB (fieldA, fieldB, ...) SELECT fieldA, fieldB, ... FROM TableA GROUP BY fieldA, fieldC, ... ON DUPLICATE KEY UPDATE fieldZ = VALUES(fieldZ); On my PC this works fine. But on the Server, not all rows

spurious select ERROR 1191 when insert into ... select * is done on fulltext table

2008-04-03 Thread schoenfr
Description: copying a table with a fulltext index via insert into ft1 select * from ft2; into a identical table sometimes leads to select error 1191 when concurrent select's are running. this happens in an enviroment where the searched table

INSERT using SELECT results

2007-02-18 Thread Miguel Vaz
Hi, I have a table LOCAIS with: id typedesc 1 t1 blah blah 2 t1 uihuih 3 t2 pokpokp I want to list only the distinct types and create a table with those results. I know how to list the

Re: INSERT using SELECT results

2007-02-18 Thread Anoop kumar V
This may help you: mysql create table locais( - id int, - type varchar(2), - `desc` varchar(10)); Query OK, 0 rows affected (0.12 sec) mysql select * from locais; +--+--+---+ | id | type | desc | +--+--+---+ |1 | t1 | sk| |2 | t2 | dsk | |

Re: INSERT using SELECT results

2007-02-18 Thread Afan Pasalic
INSERT INTO ztipos (type) VALUES (SELECT DISTINCT type FROM locais) ? -afan Miguel Vaz wrote: Hi, I have a table LOCAIS with: idtypedesc 1t1blah blah 2t1uihuih 3t2pokpokp I want to list only the distinct types and create a

INSERT into select ... ON DUPLICATE KEY??

2006-09-03 Thread Chris Jones
I am tying to dupilicate a set of records changing only one field. That field is part of a UNIQUE key. So far I copy the records into themselves and keep the same number of records: insert ignore into user_projects select * from user_projects where user_id=[EMAIL PROTECTED] and

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
Hi, I am hoping you meen this: You have to use the fields in your into -statement and select statement, not including the field having the auto-numbering so if e.g. field1 has autonumbering - insert into table1 (field2, field3) select (field2, field3) from table1; autonumbering will

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
That is the effect that I am looking for, but exactly the method that I am trying to avoid. If I type the column names into my INSERT... SELECT and someone later adds a column to the table, I would have to go back into my program and update the statement. I am looking for a way to do

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
the column names into my INSERT... SELECT and someone later adds a column to the table, I would have to go back into my program and update the statement. I am looking for a way to do it dynamically in order to avoid maintenance of the statement in my program later. Rob Danny Stolle [mailto:[EMAIL

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: That is the effect that I am looking for, but exactly the method that I am trying to avoid. If I type the column names into my INSERT... SELECT and someone later adds a column to the table, I would have to go back into my program

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
: That is the effect that I am looking for, but exactly the method that I am trying to avoid. If I type the column names into my INSERT... SELECT and someone later adds a column to the table, I would have to go back into my program and update the statement. I am looking for a way to do it dynamically

Re: insert into... select... duplicate key

2005-09-25 Thread Michael Stassen
: That is the effect that I am looking for, but exactly the method that I am trying to avoid. If I type the column names into my INSERT... SELECT and someone later adds a column to the table, I would have to go back into my program and update the statement. I am looking for a way to do it dynamically in order

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
Subject: Re: insert into... select... duplicate key Relevant bits of the conversation so far, with my thoughts at the end: Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: Here is the problem that I am having. I am trying to make a copy of a full record in a table that has a primary key

insert into... select... duplicate key

2005-09-24 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
Here is the problem that I am having. I am trying to make a copy of a full record in a table that has a primary key with auto-increment. The real problem is that I want the statement to use SELECT * so that if columns ever get added to the table the statement will still work for the full record. I

Re: slow insert into select statement

2004-05-27 Thread nyem
Thanks for all the feedback. Here's my latest attempt: SELECT @start:=NOW(); SELECT @date1:=DATE_SUB( CURDATE(), INTERVAL 1 MONTH); SELECT @date2:=CURDATE(); LOCK TABLES rptPricingTEST READ, rptPricingTEST a READ; CREATE TEMPORARY TABLE tmpLatestDates SELECT commodity,

Re: slow insert into select statement

2004-05-27 Thread SGreen
: Fax to: 05/27/2004 05:01 Subject: Re: slow insert into select statement AM

slow insert into select statement

2004-05-26 Thread nyem
I have this insert statement that took a long time to execute: INSERT INTO priceLast5 SELECT DISTINCT a.commodity, a.PricingDt FROM rptPricingTEST a WHERE a.PricingDt = ( SELECT MAX(PricingDt) FROM

RE: slow insert into select statement

2004-05-26 Thread Victor Pendleton
If you do the math a large result set will be created. You could rewriting your query or adding more indexes to see if this speeds up the process. -Original Message- From: nyem To: [EMAIL PROTECTED] Sent: 5/26/04 2:57 AM Subject: slow insert into select statement I have this insert

RE: slow insert into select statement

2004-05-26 Thread Andrew Braithwaite
Hi, I would start with finding out if it's the select or the insert that's taking a long time... Does the priceLast5 table have heavy indexes to build? Try running the select seperately and see how long it takes... Andrew -Original Message- From: Victor Pendleton [mailto:[EMAIL

RE: slow insert into select statement

2004-05-26 Thread SGreen
only once for the entire table and not once per row (per row, per row,...) CREATE TEMPORARY TABLE tmpLatestDates SELECT commodity, MAX(PricingDt) as MaxDate FROM rptPricingTEST WHERE PricingDt @date1 AND PricingDt = @date2 GROUP BY commodity INSERT INTO priceLast5 SELECT DISTINCT a.commodity

Re: INSERT INTO ... SELECT

2004-04-01 Thread Egor Egorov
int data_colocacaodate cod_componenteint (FK references another table) I get an erro saying that i cannot use that table in the select, the table is a InnoDB. Can i use the same table in the insert

INSERT INTO ... SELECT

2004-03-31 Thread Ricardo Lopes
date cod_componenteint (FK references another table) I get an erro saying that i cannot use that table in the select, the table is a InnoDB. Can i use the same table in the insert into select? do i have to use a temporary table? If anybody have

INSERT INTO SELECT

2004-03-04 Thread Jacque Scott
Table ProductSums has not been created. Can you create this table when you insert data into it? INSERT INTO ProductSums SELECT DISTINCTROW IndenturedList.NSIPartNumber, Sum(tblInvTransaction.Qty) AS SumOfQty FROM IndenturedList;

Re: INSERT INTO SELECT

2004-03-04 Thread Jacque Scott
OK, I found the answer. CREATE TABLE ProductSums SELECT DISTINCTROW IndenturedList.NSIPartNumber, Sum(tblInvTransaction.Qty) AS SumOfQty FROM IndenturedList;

[Q] INSERT INTO ... SELECT

2004-02-03 Thread Riaan Oberholzer
Is there a limit on the number of rows that can be inserted in this way? Ie, at what point should I start worrying about out of memory errors or something similar? So, how many rows can/should be returned by the SELECT clause? __ Do you Yahoo!? Yahoo! SiteBuilder

Re: [Q] INSERT INTO ... SELECT

2004-02-03 Thread Krasimir_Slaveykov
Hello Riaan, RO Is there a limit on the number of rows that can be RO inserted in this way? Ie, at what point should I start RO worrying about out of memory errors or something RO similar? RO So, how many rows can/should be returned by the SELECT clause? I had a similar case. Difference is that

Re: [Q] INSERT INTO ... SELECT

2004-02-03 Thread Egor Egorov
Riaan Oberholzer [EMAIL PROTECTED] wrote: Is there a limit on the number of rows that can be inserted in this way? Ie, at what point should I start worrying about out of memory errors or something similar? So, how many rows can/should be returned by the SELECT clause? There is no

RE: INSERT INTO () SELECT...

2002-11-21 Thread Jennifer Goodie
PROTECTED] Subject: INSERT INTO () SELECT... Hi, This should work, I think, but doesn't INSERT INTO holds (ord_num) SELECT orders.ord_num FROM orders LEFT JOIN holds ON orders.ord_num = holds.ord_num WHERE holds.ord_num IS NULL I have some order numbers that are not in holds that are in orders. I

Re: INSERT INTO () SELECT...

2002-11-21 Thread Mirza Muharemagic
Hi Eric, thats oracle function INSERT INTO ... SELECT. it doesn't work in mysql. Mirza [EMAIL PROTECTED] __ 21.11.2002 22:13 Hi, This should work, I think, but doesn't INSERT INTO holds (ord_num) SELECT orders.ord_num FROM orders

Re: INSERT INTO () SELECT...

2002-11-21 Thread Jocelyn Fournier
Hi, Yes it works, but you can't insert and select data from the same table with this syntax. Regards, Jocelyn - Original Message - From: Mirza Muharemagic [EMAIL PROTECTED] To: Eric [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, November 22, 2002 12:30 AM Subject: Re: INSERT

INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
Hello, I recently stumbled upon the INSERT INTO..SELECT abilities. Basically what I'm doing is archiving records into another table before deleting them (inventory information). However, I'd like to have the archive table to have one more field than the original table: a date_archived function

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
stumbled upon the INSERT INTO..SELECT abilities. Basically what I'm doing is archiving records into another table before deleting them (inventory information). However, I'd like to have the archive table to have one more field than the original table: a date_archived function. So, for example

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Matthew Baranowski
Assessment University of Washington - Original Message - From: Greg Macek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 14, 2002 8:06 AM Subject: INSERT INTO ... SELECT question Hello, I recently stumbled upon the INSERT INTO..SELECT abilities. Basically what I'm

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
, Office of Educational Assessment University of Washington - Original Message - From: Greg Macek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 14, 2002 8:06 AM Subject: INSERT INTO ... SELECT question Hello, I recently stumbled upon the INSERT

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Paul DuBois
At 11:15 -0600 11/14/02, Greg Macek wrote: Thanks for the tip! Looks like I can change my date_archived field to timestamp(8), since all I care about for this is the date information (actual time is useless to me). My sql query all of a sudden got a lot simpler. Thanks again for the help!

INSERT INTO ... SELECT not creating indexes ?

2002-10-05 Thread BAUMEISTER Alexandre
are not up to date after the insert into ... select query ? Thanks for you enlightenment :) Kinds regards, Alex. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com

Re: How to retrieve Insert Into Select From records effected

2002-09-09 Thread Gerald Clark
insert ignore into select from will skip duplicates. Karl J. Stubsjoen wrote: Hello, How can I determin what erros occur from an Insert into select from statement? Namely, I'm looking for any duplicate record errors. It is important to inform the user (in a web browser) whether

How to retrieve Insert Into Select From records effected

2002-09-08 Thread Karl J. Stubsjoen
Hello, How can I determin what erros occur from an Insert into select from statement? Namely, I'm looking for any duplicate record errors. It is important to inform the user (in a web browser) whether or not a particular insert would fail. Must I perform a lookup first, or is there a way

WG: problem with null values by insert into .. select ..from .. join

2002-08-22 Thread Ferdinand, Dieter
-Ursprüngliche Nachricht- Von: Ferdinand, Dieter Gesendet am: Donnerstag, 22. August 2002 10:56 An: '[EMAIL PROTECTED]' Betreff: problem with null values by insert into .. select ..from .. join hello, i have one problem with insert into ... select ... from .. join

Re: INSERT INTO ..... SELECT

2002-05-01 Thread Dave
This was resolved by adding an auto-increment column. MySQL does not seem capable of coping with the situation below. - Original Message - From: Dave [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 30, 2002 5:36 PM Subject: INSERT INTO . SELECT I am having problems

Re: INSERT DELAYED...SELECT... doesn't delay?

2002-04-30 Thread Rob Shearer
What analysis are you performing which causes you to conclude that nothing is being delayed? I'd probably check this by creating an insert...select which takes at least a few seconds to execute, and then have my test application log the time, make the call to MySQL, and log the time again. I

INSERT INTO ..... SELECT

2002-04-30 Thread Dave
I am having problems with this INSERT INTO, below is a example. The SQL is built in an ASP page and ASPVariable is, well the variable in the ASP page. For some reason this will only insert the first row. In my test data the SELECT alone returns 3 rows, but when added to the INSERT INTO only

INSERT DELAYED...SELECT... doesn't delay?

2002-04-29 Thread Emery Lapinski
Hello, I'm trying to use the DELAYED keyword with an INSERT ... SELECT statement but it seems to ignore the DELAYED. Does anyone know if this is or is not supposed to work? Exmple: session 1 session 2

Query problem with insert into....select

2002-04-17 Thread Inandjo Taurel
hi, i have 2 tables: currencyrates +-+++ | code char(3)|| currency char(3) | | name varchar(10)|| rate double| | bcurrency char(1) |

insert into select failing and read only tables

2002-04-11 Thread inandjot
condition in the where clause. 2) i have a read only table! error message when i try to execute a insert into ...select from a program. How can i check this status of the table?? Is there a command to tell me which table is read only at a particular time

Insert from select

2002-03-16 Thread David McInnis
I think that I saw a similar query last week some time but I cannot remember the sql syntax. Is it possible to insert from a select. Something like insert into table_a from select * from table_b where blah=somevalue Thanks, David McInnis

Re: Insert from select

2002-03-16 Thread Kittiphum Worachat
- Original Message - From: David McInnis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 16, 2002 3:26 PM Subject: Insert from select I think that I saw a similar query last week some time but I cannot remember the sql syntax. Is it possible to insert from a select

Re: Insert from select

2002-03-16 Thread Georg Richter
On Saturday, 16. March 2002 09:26, David McInnis wrote: I think that I saw a similar query last week some time but I cannot remember the sql syntax. Is it possible to insert from a select. See http://www.mysql.com/doc/I/N/INSERT_SELECT.html Regards Georg

insert and select

2002-03-15 Thread Javier Gloria
Hi: how i can insert and select information at the same time. first i want to insert the information relative to the client and after that i need to select the same information on the same query. that is possible _ Do You Yahoo

Re: insert and select

2002-03-15 Thread c.smart
Hi No you can't. if you are using and AUTO_INCREMENT field as a key you could follow the INSERT with a select statement like: SELECT * FROM tablename WHERE keyfield = LAST_INSERT_ID() See the manual: LAST_INSERT_ID() http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html

insert into.. select from mult. tables

2002-02-12 Thread Justin H Deming
Hello, I'm relatively new to mysql and I've come across a problem while trying to insert values from multiple tables into a single, existing table. Here's the syntax that I'm using: insert into table1 (col1,col2,col3,col4) select Foo.col1, Foo.col2, Bar.col3, Bunk.col4 from table2 as Foo,

insert into.. select from mult. tables

2002-02-05 Thread Justin H Deming
Hello, I'm relatively new to mysql and I've come across a problem while trying to insert values from multiple tables into a single, existing table. Here's the syntax that I'm using: insert into table1 (col1,col2,col3,col4) select Foo.col1, Foo.col2, Bar.col3, Bunk.col4 from table2 as Foo,

AW: INSERT with SELECT on same table

2001-11-15 Thread Votteler Marc
Thanks for the response, but doing this results in : ERROR 1093: INSERT TABLE 'myTable' isn't allowed in FROM table list marc -Ursprüngliche Nachricht- Von: Nathan [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 14. November 2001 19:05 An: Votteler Marc Betreff: Re: INSERT with SELECT

RE: INSERT with SELECT on same table

2001-11-15 Thread Votteler Marc
-Ursprüngliche Nachricht- Von: Rick Emery [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 14. November 2001 19:46 An: Votteler Marc; [EMAIL PROTECTED] Betreff: RE: INSERT with SELECT on same table If one of the table's fields is defined as UNIQUE or PRIMARY KEY, it will allow the insertion

RE: INSERT with SELECT on same table

2001-11-15 Thread Jon Gardiner
insert-select on the same table is not allowed in MySQL. If I remember right it isn't allowed in ANSI SQL either, supposedly because it could lead to infinite loops if implemented poorly. Jon Gardiner. -Original Message- From: Votteler Marc [mailto:[EMAIL PROTECTED]] Sent: Thursday

RE: INSERT with SELECT on same table

2001-11-15 Thread Carsten H. Pedersen
insert-select on the same table is not allowed in MySQL. If I remember right it isn't allowed in ANSI SQL either, supposedly because it could lead to infinite loops if implemented poorly. Jon Gardiner. Core SQL support does not require the DBMS to support it; enhanced SQL support allows

INSERT with SELECT on same table

2001-11-14 Thread Votteler Marc
Hi there, I am currently facing the following problem and hope someone can help me. I want to make an INSERT into a Table only if I haven't done this before. This is because the INSERT can be done by several Programs and the record should only be inserted once. I have found the following

RE: INSERT with SELECT on same table

2001-11-14 Thread Rick Emery
? -Original Message- From: Votteler Marc [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 14, 2001 11:01 AM To: [EMAIL PROTECTED] Subject: INSERT with SELECT on same table Hi there, I am currently facing the following problem and hope someone can help me. I want to make an INSERT

Re: INSERT INTO SELECT ??

2001-10-03 Thread Paul DuBois
At 12:53 PM +0800 10/3/01, chong wee siong wrote: Hi DBAs: I want to copy TableA in DatabaseA to TableB in DatabaseB with changes in the attributes of the tables, what options do I have? I tried these: a) insert into TableB (id) select (id) from DatabaseA.TableA; this works b) insert into

INSERT INTO SELECT ??

2001-10-02 Thread chong wee siong
Hi DBAs: I want to copy TableA in DatabaseA to TableB in DatabaseB with changes in the attributes of the tables, what options do I have? I tried these: a) insert into TableB (id) select (id) from DatabaseA.TableA; this works b) insert into TableB (id,data) select (id,data) from

Problem with INSERT INTO ... SELECT

2001-08-20 Thread Michiel Leegwater
Hello, This is the situation: Table1: ID Startnr TijdAfstand SlagDatum Opmerking CRvan CRtot PR Categorie Table2: Identical columns. What is the problem? I'm trying to append all the values from table2 to table1. I was trying this SQL query: insert into table1

RE: Problem with INSERT INTO ... SELECT

2001-08-20 Thread Cord Thomas
- From: Michiel Leegwater [mailto:[EMAIL PROTECTED]] Sent: Monday, August 20, 2001 3:25 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Problem with INSERT INTO ... SELECT Hello, This is the situation: Table1: ID Startnr TijdAfstand SlagDatum Opmerking CRvan CRtot PR

Re: Problem with INSERT INTO ... SELECT

2001-08-20 Thread Philip Mak
On Mon, 20 Aug 2001, Michiel Leegwater wrote: insert into table1 select Startnr, Tijd, Afstand, Slag, Datum, Opmerking, CRvan,CRtot,PR,Categorie from table2; This doesn't work, it says Column count doesn't match value count at row 1 I understand the problem. But I can't use my ID column

Lock with update,insert and select

2001-02-14 Thread chchen
hi all. i have a problem. i use mysql-3.23.32 on FreeBSD4.2-release my project need to update/insert some datas into mysql every 5mins. but sometims these datas are lots. so i need to reduce the update/insert time as short as possible, prevent it run over 5mins. i found out that if i use