List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:December 11 2003 2:09pm
Subject:Re: How to READ/WRITE directly on MyISAM data files ?
View as plain text  
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

Thread
How to READ/WRITE directly on MyISAM data files ?Stéphane Bischoff11 Dec
  • Re: How to READ/WRITE directly on MyISAM data files ?Martijn Tonies11 Dec
  • Re: How to READ/WRITE directly on MyISAM data files ?Stephen Brownlow12 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Stéphane Bischoff11 Dec
  • Re: How to READ/WRITE directly on MyISAM data files ?Martijn Tonies11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Jay Blanchard11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Stéphane Bischoff11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Jay Blanchard11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Dan Greene11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Stéphane Bischoff11 Dec
  • Re: How to READ/WRITE directly on MyISAM data files ?Martijn Tonies11 Dec
  • RE: How to READ/WRITE directly on MyISAM data files ?Matt Griffin11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Jay Blanchard11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Stéphane Bischoff11 Dec
RE: How to READ/WRITE directly on MyISAM data files ?Dan Greene11 Dec