Re: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Martijn Tonies
Hi,

 I would like to know how to write directly to MyISAM files, without
passing
 by SELECT or UPDATE queries.

 I believe this info can be found in the files myisam.h and myisammrg.h,
but
 I am not shure if its safe and
 how to do it.

I guess it will only be safe if you're sure you've got all bugs out, like
in the MySQL engine.

So the question would be: WHY?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server.
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Good question,

I am not shure if I need to.

Here's why I am asking:

I have a table that does not have a primary key and I need to update only
one row.
This complicates my Update Query since I cannot specify a Where clause.

I did had a primary key RowID (AUTO INCREMENT) to be sble to specify a row
in my query.
But this Field (RowID) can now be seen when I do a SELECT query. I did not
find a
way to hide this field.

So my first question should be : Is there a way to hide a field ??

Best Regards,

Stéphane.

-Original Message-
From: Martijn Tonies [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 08:22
To: MySQL (E-mail)
Subject: Re: How to READ/WRITE directly on MyISAM data files ?


Hi,

 I would like to know how to write directly to MyISAM files, without
passing
 by SELECT or UPDATE queries.

 I believe this info can be found in the files myisam.h and myisammrg.h,
but
 I am not shure if its safe and
 how to do it.

I guess it will only be safe if you're sure you've got all bugs out, like
in the MySQL engine.

So the question would be: WHY?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server.
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Jay Blanchard
[snip]
So my first question should be : Is there a way to hide a field ??
[/snip]

SELECT only the information you want. Let's say I have

RowID 
Name
Address
City

And I only want Name Address  and City

SELECT Name, Address, City FROM table WHERE RowID = 'foo'
UPDATE table SET Name = 'foo' WHERE RowID = '12'

etcetera

A good book on SQL basics will get you a long way on things like this.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Martijn Tonies
Hi,

 I am not shure if I need to.

 Here's why I am asking:

 I have a table that does not have a primary key and I need to update only
 one row.
 This complicates my Update Query since I cannot specify a Where clause.

Well, as you have figured out, without some kind of unique ID, it's
pretty much impossible to update a row.

 I did had a primary key RowID (AUTO INCREMENT) to be sble to specify a row
 in my query.
 But this Field (RowID) can now be seen when I do a SELECT query. I did not
 find a
 way to hide this field.

 So my first question should be : Is there a way to hide a field ??

Well, that depends on how you are displaying the data, doesn't it :-)

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server.
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Thank you, but I already know the basics of SQL SELECT statements.

What I am trying to say is, if a User writes a SELECT clause, I do not want
him to
see the RowID field. I do not want him to write a long SELECT statement,
especially if my
table has 20 FIELDS or more. (Can you imagine the user writing these queries
all the time).

I want him to be able to write SELECT * FROM ATABLE.

Thank you,

Stéphane.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 08:41
To: Stéphane Bischoff; Martijn Tonies; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?


[snip]
So my first question should be : Is there a way to hide a field ??
[/snip]

SELECT only the information you want. Let's say I have

RowID 
Name
Address
City

And I only want Name Address  and City

SELECT Name, Address, City FROM table WHERE RowID = 'foo'
UPDATE table SET Name = 'foo' WHERE RowID = '12'

etcetera

A good book on SQL basics will get you a long way on things like this.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Jay Blanchard
[snip]
Thank you, but I already know the basics of SQL SELECT statements.

What I am trying to say is, if a User writes a SELECT clause, I do not want
him to
see the RowID field. I do not want him to write a long SELECT statement,
especially if my
table has 20 FIELDS or more. (Can you imagine the user writing these queries
all the time).

I want him to be able to write SELECT * FROM ATABLE.
[/snip]

Well, that pretty much misses the point then, doesn't it? Are your records not unique? 
There is no way that you can write an update statement that would perform the 
operation on the proper record? Can you show us a bit of the table? With more 
information we can help.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Dan Greene
Without a unique identifier, the only way you're gonna get to update right is to use 
other data in the row to identifiy the record...

so with a table structure of 

name
address
state

your users can select anything they want, filtering w/ a where clause.

If you grant them update on the table, then they'll just have to:

update your_table
set name = 'Dan'
where name = 'Daniel'
and address = '55 main'
and state = 'Virginia';


I don't agree with this approach, mind you, it breaks all kinds of best practices

maybe it would help if you explained _why_ you don't want your users to see a 
numerical id field for each record


 -Original Message-
 From: Stéphane Bischoff [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 11, 2003 8:43 AM
 To: 'Jay Blanchard'; MySQL (E-mail)
 Subject: RE: How to READ/WRITE directly on MyISAM data files ?
 
 
 
 Thank you, but I already know the basics of SQL SELECT statements.
 
 What I am trying to say is, if a User writes a SELECT clause, 
 I do not want
 him to
 see the RowID field. I do not want him to write a long SELECT 
 statement,
 especially if my
 table has 20 FIELDS or more. (Can you imagine the user 
 writing these queries
 all the time).
 
 I want him to be able to write SELECT * FROM ATABLE.
 
 Thank you,
 
 Stéphane.
 
 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]
 Sent: 11 décembre, 2003 08:41
 To: Stéphane Bischoff; Martijn Tonies; MySQL (E-mail)
 Subject: RE: How to READ/WRITE directly on MyISAM data files ?
 
 
 [snip]
 So my first question should be : Is there a way to hide a field ??
 [/snip]
 
 SELECT only the information you want. Let's say I have
 
 RowID 
 Name
 Address
 City
 
 And I only want Name Address  and City
 
 SELECT Name, Address, City FROM table WHERE RowID = 'foo'
 UPDATE table SET Name = 'foo' WHERE RowID = '12'
 
 etcetera
 
 A good book on SQL basics will get you a long way on things like this.
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]
 
 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Hello,

Here's an example :


I have a table named Product.

TABLE : PRODUCT
+-+-+-+-+-+
|RowID| Name|  Company| Price   |   Warranty  |

| | | | | |
+-+-+-+-+-+
|   1 |   PC 1000   |  MyCom Inc. |  1000.00|   1 year|

|   2 |   PC 1000   |  MyCom Inc. |  1200.00|   2 year|

|   3 |   PC 1000   |  MyCom Inc. |  1300.00|   3 year|

|   4 |   PC 2000   |  MyCom Inc. |  1200.00|   1 year|

|   4 |   PC 2000   |  MyCom Inc. |  1300.00|   2 year|

|   4 |   PC 2000   |  MyCom Inc. |  1400.00|   3 year|

|   4 |   PC 3000   |  MyCom Inc. |  1500.00|   1 year|

|   4 |   PC 3000   |  MyCom Inc. |  1600.00|   2 year|

|   4 |   PC 3000   |  MyCom Inc. |  1700.00|   3 year|

|   4 |   PC AR3|  SPCom Inc. |  1200.00|   2 year|

|   4 |   PC AR3|  SPCom Inc. |  1300.00|   3 year|

|   4 |   PC AR4|  SPCom Inc. |  1400.00|   4 year|

+-+-+-+-+-+

From My Server Side Application (C code)

I can Update my Rows using my RowID.

Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;


But For My Client Side Applications :

User logs in my Client app.
User types in SELECT * FROM product.
User does NOT WANT TO SEE RowID numbers.
User wants to see this output :

+-+-+-+-+
| Name|  Company| Price   |   Warranty  |   
| | | | |
+-+-+-+-+
|   PC 1000   |  MyCom Inc. |  1000.00|   1 year|
|   PC 1000   |  MyCom Inc. |  1200.00|   2 year|   
|   PC 1000   |  MyCom Inc. |  1300.00|   3 year|   
|   PC 2000   |  MyCom Inc. |  1200.00|   1 year|   
|   PC 2000   |  MyCom Inc. |  1300.00|   2 year|   
|   PC 2000   |  MyCom Inc. |  1400.00|   3 year|   
|   PC 3000   |  MyCom Inc. |  1500.00|   1 year|   
|   PC 3000   |  MyCom Inc. |  1600.00|   2 year|   
|   PC 3000   |  MyCom Inc. |  1700.00|   3 year|   
|   PC AR3|  SPCom Inc. |  1200.00|   2 year|   
|   PC AR3|  SPCom Inc. |  1300.00|   3 year|   
|   PC AR4|  SPCom Inc. |  1400.00|   4 year|   
+-+-+-+-+

I know there are ways to bypass this problem, but it involves much more
coding in my Delphi applications
on my Client side.

So my question is, Is there a way to hide a field from select statements.

Of course, if my user wrote SELECT RowId, Name, Company, Price, Warranty
FROM product
he would get the RowId in his query output.

Best Regards,

Stéphane.


 


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 08:49
To: Stéphane Bischoff; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?


[snip]
Thank you, but I already know the basics of SQL SELECT statements.

What I am trying to say is, if a User writes a SELECT clause, I do not want
him to
see the RowID field. I do not want him to write a long SELECT statement,
especially if my
table has 20 FIELDS or more. (Can you imagine the user writing these queries
all the time).

I want him to be able to write SELECT * FROM ATABLE.
[/snip]

Well, that pretty much misses the point then, doesn't it? Are your records
not unique? There is no way that you can write an update statement that
would perform the operation on the proper record? Can you show us a bit of
the table? With more information we can help.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Martijn Tonies
Hi Stéphane,

 Here's an example :


 I have a table named Product.

 TABLE : PRODUCT
 +-+-+-+-+-+
 |RowID   | Name|  Company| Price   |   Warranty  |

 | | | | | |
 +-+-+-+-+-+
 | 1   |   PC 1000   |  MyCom Inc. |  1000.00|   1 year|

 | 2   |   PC 1000   |  MyCom Inc. |  1200.00|   2 year|

 | 3   |   PC 1000   |  MyCom Inc. |  1300.00|   3 year|

 | 4   |   PC 2000   |  MyCom Inc. |  1200.00|   1 year|

 | 4   |   PC 2000   |  MyCom Inc. |  1300.00|   2 year|

 | 4   |   PC 2000   |  MyCom Inc. |  1400.00|   3 year|

 | 4   |   PC 3000   |  MyCom Inc. |  1500.00|   1 year|

 | 4   |   PC 3000   |  MyCom Inc. |  1600.00|   2 year|

 | 4   |   PC 3000   |  MyCom Inc. |  1700.00|   3 year|

 | 4   |   PC AR3|  SPCom Inc. |  1200.00|   2 year|

 | 4   |   PC AR3|  SPCom Inc. |  1300.00|   3 year|

 | 4   |   PC AR4|  SPCom Inc. |  1400.00|   4 year|

 +-+-+-+-+-+

 From My Server Side Application (C code)

 I can Update my Rows using my RowID.

 Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;


 But For My Client Side Applications :

 User logs in my Client app.
 User types in SELECT * FROM product.

Why?? In what application do you allow users to construct their own SQL
statement and run UPDATE SQL statements? I never do that and I see
no reason why I should.

 User does NOT WANT TO SEE RowID numbers.

Why not?

 User wants to see this output :

 +-+-+-+-+
 | Name|  Company| Price   |   Warranty  |
 | | | | |
 +-+-+-+-+
 |   PC 1000   |  MyCom Inc. |  1000.00|   1 year|

--8--

 |   PC AR4|  SPCom Inc. |  1400.00|   4 year|
 +-+-+-+-+

 I know there are ways to bypass this problem, but it involves much more
 coding in my Delphi applications
 on my Client side.

You can do this in the after open event, I think.

 So my question is, Is there a way to hide a field from select statements.

 Of course, if my user wrote SELECT RowId, Name, Company, Price, Warranty
 FROM product
 he would get the RowId in his query output.

How do you expect your users to update rows without an unique ID?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server.
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Jay Blanchard
[snip]
|   4 |   PC AR3|  SPCom Inc. |  1200.00|   2 year|

|   4 |   PC AR3|  SPCom Inc. |  1300.00|   3 year|

|   4 |   PC AR4|  SPCom Inc. |  1400.00|   4 year|

+-+-+-+-+-+

From My Server Side Application (C code)

I can Update my Rows using my RowID.

Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;
[/snip]

Yes, but if you use RowID 4 you'll be updating multiple rows

[snip]
But For My Client Side Applications :

I know there are ways to bypass this problem, but it involves much more
coding in my Delphi applications
on my Client side.
[/snip]

So?

[snip]
So my question is, Is there a way to hide a field from select statements.

Of course, if my user wrote SELECT RowId, Name, Company, Price, Warranty
FROM product
he would get the RowId in his query output.
[/snip]

Does the user know all of the columns? If so, and he chose to see them that would be 
his choice, no?

Really, it is just bad database design. Each row should have a unique identifier.  
What is the big deal about the user seeing the RowID?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Just wanted to know if it was possible to hide fields for whatever reason.
Judging by your response, the answer is no.

Therefore, I will look at other alternatives.

Thanks,

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 09:09
To: Stéphane Bischoff; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?


[snip]
|   4 |   PC AR3|  SPCom Inc. |  1200.00|   2 year|

|   4 |   PC AR3|  SPCom Inc. |  1300.00|   3 year|

|   4 |   PC AR4|  SPCom Inc. |  1400.00|   4 year|

+-+-+-+-+-+

From My Server Side Application (C code)

I can Update my Rows using my RowID.

Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;
[/snip]

Yes, but if you use RowID 4 you'll be updating multiple rows

[snip]
But For My Client Side Applications :

I know there are ways to bypass this problem, but it involves much more
coding in my Delphi applications
on my Client side.
[/snip]

So?

[snip]
So my question is, Is there a way to hide a field from select statements.

Of course, if my user wrote SELECT RowId, Name, Company, Price, Warranty
FROM product
he would get the RowId in his query output.
[/snip]

Does the user know all of the columns? If so, and he chose to see them that
would be his choice, no?

Really, it is just bad database design. Each row should have a unique
identifier.  What is the big deal about the user seeing the RowID?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Dan Greene
So if I follow you, you allow your clients to execute direct sql on the database, both 
select and update, but _they_ simply don't want to see the row id data?

If that's the case, then too bad for them if they are capable of writing sql, then 
they have to handle the result, or omit the field from the query.  The only other 
option is for you to truss up your application interface, so that you give them an 
interface that shows just the fields _you_ want them to see.  They can't have their 
cake and eat it too.



 -Original Message-
 From: Stéphane Bischoff [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 11, 2003 9:00 AM
 To: 'Jay Blanchard'; MySQL (E-mail)
 Subject: RE: How to READ/WRITE directly on MyISAM data files ?
 
 
 
 Hello,
 
 Here's an example :
 
 
 I have a table named Product.
 
 TABLE : PRODUCT
 +-+-+-+-+-
 +
 |RowID  | Name|  Company| Price   |   
 Warranty  |
 
 | | | | | 
 |
 +-+-+-+-+-
 +
 | 1 |   PC 1000   |  MyCom Inc. |  1000.00|   
 1 year|
 
 | 2 |   PC 1000   |  MyCom Inc. |  1200.00|   
 2 year|
 
 | 3 |   PC 1000   |  MyCom Inc. |  1300.00|   
 3 year|
 
 | 4 |   PC 2000   |  MyCom Inc. |  1200.00|   
 1 year|
 
 | 4 |   PC 2000   |  MyCom Inc. |  1300.00|   
 2 year|
 
 | 4 |   PC 2000   |  MyCom Inc. |  1400.00|   
 3 year|
 
 | 4 |   PC 3000   |  MyCom Inc. |  1500.00|   
 1 year|
 
 | 4 |   PC 3000   |  MyCom Inc. |  1600.00|   
 2 year|
 
 | 4 |   PC 3000   |  MyCom Inc. |  1700.00|   
 3 year|
 
 | 4 |   PC AR3|  SPCom Inc. |  1200.00|   
 2 year|
 
 | 4 |   PC AR3|  SPCom Inc. |  1300.00|   
 3 year|
 
 | 4 |   PC AR4|  SPCom Inc. |  1400.00|   
 4 year|
 
 +-+-+-+-+-
 +
 
 From My Server Side Application (C code)
 
 I can Update my Rows using my RowID.
 
 Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;
 
 
 But For My Client Side Applications :
 
 User logs in my Client app.
 User types in SELECT * FROM product.
 User does NOT WANT TO SEE RowID numbers.
 User wants to see this output :
 
 +-+-+-+-+
 | Name|  Company| Price   |   Warranty  | 
 | | | | |
 +-+-+-+-+
 |   PC 1000   |  MyCom Inc. |  1000.00|   1 year|
 |   PC 1000   |  MyCom Inc. |  1200.00|   2 year| 
 |   PC 1000   |  MyCom Inc. |  1300.00|   3 year| 
 |   PC 2000   |  MyCom Inc. |  1200.00|   1 year| 
 |   PC 2000   |  MyCom Inc. |  1300.00|   2 year| 
 |   PC 2000   |  MyCom Inc. |  1400.00|   3 year| 
 |   PC 3000   |  MyCom Inc. |  1500.00|   1 year| 
 |   PC 3000   |  MyCom Inc. |  1600.00|   2 year| 
 |   PC 3000   |  MyCom Inc. |  1700.00|   3 year| 
 |   PC AR3|  SPCom Inc. |  1200.00|   2 year| 
 |   PC AR3|  SPCom Inc. |  1300.00|   3 year| 
 |   PC AR4|  SPCom Inc. |  1400.00|   4 year| 
 +-+-+-+-+
 
 I know there are ways to bypass this problem, but it involves 
 much more
 coding in my Delphi applications
 on my Client side.
 
 So my question is, Is there a way to hide a field from select 
 statements.
 
 Of course, if my user wrote SELECT RowId, Name, Company, 
 Price, Warranty
 FROM product
 he would get the RowId in his query output.
 
 Best Regards,
 
 Stéphane.
 
 
  
 
 
 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]
 Sent: 11 décembre, 2003 08:49
 To: Stéphane Bischoff; MySQL (E-mail)
 Subject: RE: How to READ/WRITE directly on MyISAM data files ?
 
 
 [snip]
 Thank you, but I already know the basics of SQL SELECT statements.
 
 What I am trying to say is, if a User writes a SELECT clause, 
 I do not want
 him to
 see the RowID field. I do not want him to write a long SELECT 
 statement,
 especially if my
 table has 20 FIELDS or more. (Can you imagine the user 
 writing these queries
 all the time).
 
 I want him to be able to write SELECT * FROM ATABLE.
 [/snip]
 
 Well, that pretty much misses the point then, doesn't it? Are 
 your records
 not unique? There is no way that you can write an update 
 statement that
 would perform the operation on the proper record? Can you 
 show us a bit of
 the table? With more information we can help.
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com

RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Matt Griffin
There's no way to hide a row.  However, I can think of a zany solution.
Update your tables using a hash of all the data in the row.  That way you
don't need an id field.
Fair warning: this is not a GOOD solution but it does address the problem.

Matt

-Original Message-
From: Stéphane Bischoff [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 9:00 AM
To: 'Jay Blanchard'; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?



Hello,

Here's an example :


I have a table named Product.

TABLE : PRODUCT
+-+-+-+-+-+
|RowID| Name|  Company| Price   |   Warranty  |

| | | | | |
+-+-+-+-+-+
|   1 |   PC 1000   |  MyCom Inc. |  1000.00|   1 year|

|   2 |   PC 1000   |  MyCom Inc. |  1200.00|   2 year|

|   3 |   PC 1000   |  MyCom Inc. |  1300.00|   3 year|

|   4 |   PC 2000   |  MyCom Inc. |  1200.00|   1 year|

|   4 |   PC 2000   |  MyCom Inc. |  1300.00|   2 year|

|   4 |   PC 2000   |  MyCom Inc. |  1400.00|   3 year|

|   4 |   PC 3000   |  MyCom Inc. |  1500.00|   1 year|

|   4 |   PC 3000   |  MyCom Inc. |  1600.00|   2 year|

|   4 |   PC 3000   |  MyCom Inc. |  1700.00|   3 year|

|   4 |   PC AR3|  SPCom Inc. |  1200.00|   2 year|

|   4 |   PC AR3|  SPCom Inc. |  1300.00|   3 year|

|   4 |   PC AR4|  SPCom Inc. |  1400.00|   4 year|

+-+-+-+-+-+

From My Server Side Application (C code)

I can Update my Rows using my RowID.

Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;


But For My Client Side Applications :

User logs in my Client app.
User types in SELECT * FROM product.
User does NOT WANT TO SEE RowID numbers.
User wants to see this output :

+-+-+-+-+
| Name|  Company| Price   |   Warranty  |
| | | | |
+-+-+-+-+
|   PC 1000   |  MyCom Inc. |  1000.00|   1 year|
|   PC 1000   |  MyCom Inc. |  1200.00|   2 year|
|   PC 1000   |  MyCom Inc. |  1300.00|   3 year|
|   PC 2000   |  MyCom Inc. |  1200.00|   1 year|
|   PC 2000   |  MyCom Inc. |  1300.00|   2 year|
|   PC 2000   |  MyCom Inc. |  1400.00|   3 year|
|   PC 3000   |  MyCom Inc. |  1500.00|   1 year|
|   PC 3000   |  MyCom Inc. |  1600.00|   2 year|
|   PC 3000   |  MyCom Inc. |  1700.00|   3 year|
|   PC AR3|  SPCom Inc. |  1200.00|   2 year|
|   PC AR3|  SPCom Inc. |  1300.00|   3 year|
|   PC AR4|  SPCom Inc. |  1400.00|   4 year|
+-+-+-+-+

I know there are ways to bypass this problem, but it involves much more
coding in my Delphi applications
on my Client side.

So my question is, Is there a way to hide a field from select statements.

Of course, if my user wrote SELECT RowId, Name, Company, Price, Warranty
FROM product
he would get the RowId in his query output.

Best Regards,

Stéphane.





-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 08:49
To: Stéphane Bischoff; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?


[snip]
Thank you, but I already know the basics of SQL SELECT statements.

What I am trying to say is, if a User writes a SELECT clause, I do not want
him to
see the RowID field. I do not want him to write a long SELECT statement,
especially if my
table has 20 FIELDS or more. (Can you imagine the user writing these queries
all the time).

I want him to be able to write SELECT * FROM ATABLE.
[/snip]

Well, that pretty much misses the point then, doesn't it? Are your records
not unique? There is no way that you can write an update statement that
would perform the operation on the proper record? Can you show us a bit of
the table? With more information we can help.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stephen Brownlow
Hello Stephane,

I use myisam for reading.

I now use SQL for updating. When I used myisam for updating, tables
sometimes corrupted, and I was unable to work out why.

Currently I am changing programs to use HANDLER syntax not myisam for
reading. This will:
- Save the need for table locking.
- Allow the use of InnoDB etc.
- Allow mysqld to have full control.

I recommend you just use SQL for everything.

Regards,
Stephen

- Original Message -
From: Stéphane Bischoff [EMAIL PROTECTED]
To: MySQL (E-mail) [EMAIL PROTECTED]
Sent: Friday, December 12, 2003 12:15 AM
Subject: How to READ/WRITE directly on MyISAM data files ?



Hello,

I would like to know how to write directly to MyISAM files, without passing
by SELECT or UPDATE queries.

I believe this info can be found in the files myisam.h and myisammrg.h, but
I am not shure if its safe and
how to do it.

I would very much like to have an example of this code (C code).

thank you

Stéphane.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]