![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
9.0.2 Build 3575 When assigning the date value to the "INJ_DATE" field in an Update, I receive... Runtime error -191 SQLE_CANNOT_MODIFY ULINJURYtable.UpdateBegin UNINJURYtable.Column("INJ_DATE").StringValue = "11/6/2007" The INJ_DATE field is part of an index in the table schema. Why am I getting this error? Thanks, Jeff. |
#3
| |||
| |||
|
|
You can not update a column in the index that the table object is using. By default table objects use the primary key, but they can be opened using any index on the table. Your options to get around this are... - Open a table object on a different index. - Use a sql update statement. Mike Jeff> wrote in message news:47308132.314e.1681692777 (AT) sybase (DOT) com... 9.0.2 Build 3575 When assigning the date value to the "INJ_DATE" field in an Update, I receive... Runtime error -191 SQLE_CANNOT_MODIFY ULINJURYtable.UpdateBegin UNINJURYtable.Column("INJ_DATE").StringValue = "11/6/2007" The INJ_DATE field is part of an index in the table schema. Why am I getting this error? Thanks, Jeff. |
#4
| |||
| |||
|
|
Thanks Mike.. I tried to use the sql update and I now receive -187 SQLE_CURSORDROP_NOT_ALLOWED It's almost like that field is locked since I opened a connection to the table when I start the application. ULINJURYtable.Open "idx_inj_date" You can not update a column in the index that the table object is using. By default table objects use the primary key, but they can be opened using any index on the table. Your options to get around this are... - Open a table object on a different index. - Use a sql update statement. Mike Jeff> wrote in message news:47308132.314e.1681692777 (AT) sybase (DOT) com... 9.0.2 Build 3575 When assigning the date value to the "INJ_DATE" field in an Update, I receive... Runtime error -191 SQLE_CANNOT_MODIFY ULINJURYtable.UpdateBegin UNINJURYtable.Column("INJ_DATE").StringValue = "11/6/2007" The INJ_DATE field is part of an index in the table schema. Why am I getting this error? Thanks, Jeff. |
#5
| |||
| |||
|
|
Are you doing a cursor update using a result set? If so I'd guess that you were missing an UpdateBegin() call. Alternatively you can update with out a cursor using the following SQL update ULINJURY set INJ_DATE = "11/6/2007" where id = ? If that doesn't help, please post the lines of code that you used to do the update. Mike Jeff> wrote in message news:47308bac.326b.1681692777 (AT) sybase (DOT) com... Thanks Mike.. I tried to use the sql update and I now receive -187 SQLE_CURSORDROP_NOT_ALLOWED It's almost like that field is locked since I opened a connection to the table when I start the application. ULINJURYtable.Open "idx_inj_date" You can not update a column in the index that the table object is using. By default table objects use the primary key, but they can be opened using any index on the table. Your options to get around this are... - Open a table object on a different index. - Use a sql update statement. Mike Jeff> wrote in message news:47308132.314e.1681692777 (AT) sybase (DOT) com... 9.0.2 Build >> 3575 When assigning the date value to the "INJ_DATE" field in >> > an Update, I receive... Runtime error -191 SQLE_CANNOT_MODIFY ULINJURYtable.UpdateBegin UNINJURYtable.Column("INJ_DATE").StringValue = "11/6/2007" The INJ_DATE field is part of an index in the table schema. Why am I getting this error? Thanks, Jeff. |
#6
| |||
| |||
|
|
This app was written prior to UL9 - this is why I am not using dynamic SQL. The TREATMENT table updates perfectly even though its defined the exact same way as the INJURY table. When I do the INJURY table update, I receive.. -191 SQLE_CANNOT_MODIFY. If I code in some dynamic SQL and try the same thing.. I get the -187 SQL_CURSOROP_NOT_ALLOWED. Original Code ULTREATMENTtable.MoveBeforeFirst ULTREATMENTtable.FindBegin ULTREATMENTtable.Column("TREAT_DATE").StringValue = CurrentTreatmentDate ULTREATMENTtable.Column("TREATMENT_ID").DoubleValu e = CurrentTreatmentID ULTREATMENTtable.FindFirst ULTREATMENTtable.UpdateBegin ULTREATMENTtable.Column("TREAT_DATE").StringValue = lblTreatDate.Caption ULTREATMENTtable.Update ULINJURYtable.MoveBeforeFirst ULINJURYtable.FindBegin ULINJURYtable.Column("INJ_DATE").StringValue = CurrentInjuryDate ULINJURYtable.Column("INJURY_ID").DoubleValue = CurrentInjuryID ULINJURYtable.FindFirst ULINJURYtable.UpdateBegin ULINJURYtable.Column("INJ_DATE").StringValue = lblInjDate.Caption ULINJURYtable.Update Both tables are opened with the date and id index. The indexes and tables are defined the same way in the schema. ULTREATMENTtable.Open "idx_treat_date" ULINJURYtable.Open "idx_inj_date" Replaced Dynamic SQL CODE Set UpdatePS = Connection.PrepareStatement( _ "UPDATE injury set inj_date=? where injury_id = ?") UpdatePS.SetStringParameter 1, lblInjDate.Caption UpdatePS.SetDoubleParameter 2, CurrentInjuryID UpdatePS.ExecuteStatement ULINJURYtable.Update Are you doing a cursor update using a result set? If so I'd guess that you were missing an UpdateBegin() call. Alternatively you can update with out a cursor using the following SQL update ULINJURY set INJ_DATE = "11/6/2007" where id = ? If that doesn't help, please post the lines of code that you used to do the update. Mike Jeff> wrote in message news:47308bac.326b.1681692777 (AT) sybase (DOT) com... Thanks Mike.. I tried to use the sql update and I now receive -187 SQLE_CURSORDROP_NOT_ALLOWED It's almost like that field is locked since I opened a connection to the table when I start the application. ULINJURYtable.Open "idx_inj_date" You can not update a column in the index that the table object is using. By default table objects use the primary key, but they can be opened using any index on the table. Your options to get around this are... - Open a table object on a different index. - Use a sql update statement. Mike Jeff> wrote in message news:47308132.314e.1681692777 (AT) sybase (DOT) com... 9.0.2 Build >> 3575 When assigning the date value to the "INJ_DATE" field in >> > an Update, I receive... Runtime error -191 SQLE_CANNOT_MODIFY ULINJURYtable.UpdateBegin UNINJURYtable.Column("INJ_DATE").StringValue = "11/6/2007" The INJ_DATE field is part of an index in the table schema. Why am I getting this error? Thanks, Jeff. |
![]() |
| Thread Tools | |
| Display Modes | |
| |