9 messages in com.mysql.lists.win32Re: Getting column counter as part of...| From | Sent On | Attachments |
|---|---|---|
| Greg Quinn | 20 Jun 2005 07:17 | |
| Reggie Burnett | 21 Jun 2005 08:49 | |
| Greg Quinn | 21 Jun 2005 10:31 | |
| Greg Quinn | 22 Jun 2005 03:03 | |
| emma...@lutecia.info | 22 Jun 2005 05:12 | |
| Markus Grossrieder | 22 Jun 2005 06:19 | |
| Ignatius Reilly | 22 Jun 2005 06:30 | |
| Greg Quinn | 22 Jun 2005 06:39 | |
| jbon...@sola.com.au | 22 Jun 2005 15:51 |
| Subject: | Re: Getting column counter as part of query![]() |
|---|---|
| From: | Ignatius Reilly (igna...@free.fr) |
| Date: | 06/22/2005 06:30:16 AM |
| List: | com.mysql.lists.win32 |
Many drawbacks:
1. risks of conflict if two users want to do the same concurrently (table scope is global) 2. obliges you to grant the CREATE / DROP TABLE rights to the mysql account - not recommended
Ignatius
Markus Grossrieder wrote:
Depending on how you access the MyODBC driver, you could SPLIT your requests
That works for me in Access/ODBC
However, maybe a more simple solution would be to omit the "temporary" keyword in your create table query; instead add a 3rd query who deletes the table afterwards.
HTH, Markus
----- Original Message ----- From: <emma...@lutecia.info> To: "'Greg Quinn'" <gr...@officium.co.za>; <win...@lists.mysql.com> Sent: Wednesday, June 22, 2005 2:13 PM Subject: RE: Getting column counter as part of query
The MyODBC driver cannot handle more than one SQL request at a time - thus the "syntax error" after ";". The temporary table is only available for the CURRENT connection - thus the "table does not exist" error.
Depending on how you access the MyODBC driver, you could SPLIT your requests in 2 strings (CREATE than INSERT/SELECT), open a connection, execute both requests and than close the connection. However, if you use a control and can't customize the ODBC access... I guess you're stuck...
E.
-----Message d'origine----- De : Greg Quinn [mailto:gr...@officium.co.za] Envoyé : mercredi 22 juin 2005 12:04 À : win...@lists.mysql.com Objet : Re: Getting column counter as part of query
Thanks,
I have tried this in my program, but when I try to insert into T it says the table does not exist.
If I run this query directly in MySQLCC it works, but in my app, If I run the query on 2 different database connections it does not work. Is this query supposed to run on one connection?
I have tried running both queries at once but I am told there uis a problem with my syntax after the first queries semi colon (;)
What am I doing wrong? Thanks
----- Original Message ----- From: "Ignatius Reilly" <igna...@free.fr> To: "Greg Quinn" <gr...@officium.co.za> Sent: Tuesday, June 21, 2005 8:32 PM Subject: Re: Getting column counter as part of query
you can create a temporary table with an autoincrement field, and select your data to extract into this table
CREATE TEMPORARY TABLE T( id int auto_increment, first_name varchar(40), ..., PRIMARY KEY ( id ) ) ;
INSERT INTO T SELECT 0, first_name, ... FROM mytable
Now you can use T to extract your data
Ignatius
Greg Quinn wrote:
How does one do this in mySQL?
Basically I am binding directly to a control, in the control I need a column stating the record #. i.e
# Name 1 Bob 2 John 3 Mary
How do I get the actual record counter as part of a query?




