Board index » delphi » SQL Syntax Question

SQL Syntax Question

Please can someone help me with an example of updating a single line in a
record.

I have run a select statement and now i want to update just one line but the
records
can be all the same so a where will not work to well as it could update a
number of fields

I see there is a current of command but can not work out how to use it.

Any examples will be appreciated :-

1. Already run a select and displaying it in a grid.
2. User must be able to change an individual record field.
3. Data in rows can all be the same so where won't work (or will it ?)

Regards

Tim

 

Re:SQL Syntax Question


Quote
Tim Horn wrote:

> Please can someone help me with an example of updating a single line in a
> record.

> I have run a select statement and now i want to update just one line but the
> records
> can be all the same so a where will not work to well as it could update a
> number of fields

Then you can't do that.  How can IB find a single record when you have no
uniqueness by which to find it.  Add a primary key.

Quote
> I see there is a current of command but can not work out how to use it.

> Any examples will be appreciated :-

> 1. Already run a select and displaying it in a grid.
> 2. User must be able to change an individual record field.
> 3. Data in rows can all be the same so where won't work (or will it ?)

> Regards

> Tim

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The fool escaped from paradise will look over his shoulder and cry
Sit and chew on daffodils and struggle to answer why?
As you grow up and leave the playground
Where you kissed your Prince and found your frog
Remember the jester that showed you tears, the script for tears. (Fish)

Re:SQL Syntax Question


Quote
"Woody \(TMW\)" <woody....@ih2000.net> wrote:

>You can't do this with a query but it will work using a TIBTable,
>although I don't advise using that as it's more for backward
>compatilbilty than anything else. Why not just add a non-seen
>field and use a generator to keep the rows unique?

Until you meantioned IBTable I didn't even think of this, but
you can ask for RDB$DB_KEY as one of the columns returned in SQL.  
This will allow the refresh of EXISTING records, but as this
value is not returned on an insert you would not be able to
refresh anything inserted in the current result set without a
unique key of some sort.

--
Jeff Overcash (TeamB)

Other Threads