Mur
User
 Platinum Boarder
| Posts: 116 |   | Karma: 0 |
|
RE: NOE171/UPS Record has been deleted by another user - parameters ???
|
|
Posted: 2002/08/15 10:12 |
|
|
|
|
Did you mean Col2 instead of Tab2 in your select statement? You need to select ROWID or primary key columns to be able to update dataset. MainFORM.OCIQuery2.SQL.Text:='select col1, rowid from tab1 WHERE col2= aram'; or MainFORM.OCIQuery2.SQL.Text:='select col1, id_col from tab1 WHERE col2= aram'; MainFORM.OCIQuery2.FieldByName('id_col').ProviderFlags := [pfInKey]; If col1 is primary key and you want to update it, simply call MainFORM.OCIQuery2.FieldByName('col1').ProviderFlags := [pfInKey]; In your code call to Refresh after Open is redundant By the way you can repalce all your code with single line: Database.ExecSql('update tab1 set col1='+IntTOStr(y)+' where col1='+IntoToStr(x)); Or use this more 'elegant' code: Query2.SQL.Text := 'update tab1 set col1=:y where col1= ' Query2.ParamByName('x').AsInteger := x; Query2.ParamByName('y').AsInteger := y; Query2.ExecSQL;
|
|