@@ -63,7 +63,7 @@ export class ResultSetPanelProvider implements WebviewViewProvider {
63
63
if ( message . id && message . update && message . bindings ) {
64
64
console . log ( message ) ;
65
65
try {
66
- const result = await JobManager . runSQL ( message . update , { parameters : message . bindings } ) ;
66
+ const result = await JobManager . runSQL ( message . update , { parameters : message . bindings } ) ;
67
67
postCellResponse ( message . id , true ) ;
68
68
} catch ( e ) {
69
69
// this.setError(e.message);
@@ -98,7 +98,7 @@ export class ResultSetPanelProvider implements WebviewViewProvider {
98
98
99
99
if ( this . currentQuery . getState ( ) !== "RUN_DONE" ) {
100
100
setCancelButtonVisibility ( true ) ;
101
-
101
+
102
102
let queryResults = this . currentQuery . getState ( ) == "RUN_MORE_DATA_AVAILABLE" ? await this . currentQuery . fetchMore ( ) : await this . currentQuery . execute ( ) ;
103
103
104
104
const jobId = this . currentQuery . getHostJob ( ) . id ;
@@ -184,63 +184,73 @@ export class ResultSetPanelProvider implements WebviewViewProvider {
184
184
this . loadingState = false ;
185
185
await this . focus ( ) ;
186
186
187
- let updatable : html . UpdatableInfo | undefined ;
187
+ let updatable : html . UpdatableInfo | undefined ;
188
188
189
189
if ( ref ) {
190
190
const schema = ref . object . schema || ref . object . system ;
191
191
if ( schema ) {
192
- const tableInfo = await Table . getItems (
193
- Statement . delimName ( schema , true ) ,
194
- Statement . delimName ( ref . object . name , true )
195
- ) ;
196
-
197
- if ( tableInfo . length > 0 ) {
198
- let currentColumns : html . BasicColumn [ ] | undefined ;
199
-
200
- currentColumns = tableInfo . map ( ( column ) => ( {
201
- name : column . COLUMN_NAME ,
202
- jsType : column . NUMERIC_PRECISION ? `number` : `asString` ,
203
- useInWhere : column . IS_IDENTITY === `YES` ,
204
- maxInputLength : column . CHARACTER_MAXIMUM_LENGTH
205
- } ) ) ;
206
-
207
- if ( ! currentColumns . some ( c => c . useInWhere ) ) {
208
- const cName = ref . alias || `t` ;
209
-
210
- // Support for using a custom column list
211
- const selectClauseStart = basicSelect . toLowerCase ( ) . indexOf ( `select ` ) ;
212
- const fromClauseStart = basicSelect . toLowerCase ( ) . indexOf ( `from` ) ;
213
- let possibleColumnList : string | undefined ;
214
-
215
- possibleColumnList = `${ cName } .*` ;
216
- if ( fromClauseStart > 0 ) {
217
- possibleColumnList = basicSelect . substring ( 0 , fromClauseStart ) ;
218
- if ( selectClauseStart >= 0 ) {
219
- possibleColumnList = possibleColumnList . substring ( selectClauseStart + 7 ) ;
220
-
221
- if ( possibleColumnList . trim ( ) === `*` ) {
222
- possibleColumnList = `${ cName } .*` ;
192
+ const goodSchema = Statement . delimName ( schema , true ) ;
193
+ const goodName = Statement . delimName ( ref . object . name , true ) ;
194
+
195
+ const isPartitioned = await Table . isPartitioned ( goodSchema , goodName ) ;
196
+ if ( ! isPartitioned ) {
197
+ const tableInfo = await Table . getItems (
198
+ goodSchema ,
199
+ goodName
200
+ ) ;
201
+
202
+ const uneditableTypes = [ `VARBIN` , `BINARY` , `ROWID` , `DATALINK` , `DBCLOB` , `BLOB` , `GRAPHIC` ]
203
+
204
+ if ( tableInfo . length > 0 ) {
205
+ let currentColumns : html . BasicColumn [ ] | undefined ;
206
+
207
+ currentColumns = tableInfo
208
+ . filter ( ( column ) => ! uneditableTypes . includes ( column . DATA_TYPE ) )
209
+ . map ( ( column ) => ( {
210
+ name : column . COLUMN_NAME ,
211
+ jsType : column . NUMERIC_PRECISION ? `number` : `asString` ,
212
+ useInWhere : column . IS_IDENTITY === `YES` ,
213
+ maxInputLength : column . CHARACTER_MAXIMUM_LENGTH
214
+ } ) ) ;
215
+
216
+ if ( ! currentColumns . some ( c => c . useInWhere ) ) {
217
+ const cName = ref . alias || `t` ;
218
+
219
+ // Support for using a custom column list
220
+ const selectClauseStart = basicSelect . toLowerCase ( ) . indexOf ( `select ` ) ;
221
+ const fromClauseStart = basicSelect . toLowerCase ( ) . indexOf ( `from` ) ;
222
+ let possibleColumnList : string | undefined ;
223
+
224
+ possibleColumnList = `${ cName } .*` ;
225
+ if ( fromClauseStart > 0 ) {
226
+ possibleColumnList = basicSelect . substring ( 0 , fromClauseStart ) ;
227
+ if ( selectClauseStart >= 0 ) {
228
+ possibleColumnList = possibleColumnList . substring ( selectClauseStart + 7 ) ;
229
+
230
+ if ( possibleColumnList . trim ( ) === `*` ) {
231
+ possibleColumnList = `${ cName } .*` ;
232
+ }
223
233
}
224
234
}
225
- }
226
235
227
- // We need to override the input statement if they want to do updatable
228
- const whereClauseStart = basicSelect . toLowerCase ( ) . indexOf ( `where` ) ;
229
- let fromWhereClause : string | undefined ;
236
+ // We need to override the input statement if they want to do updatable
237
+ const whereClauseStart = basicSelect . toLowerCase ( ) . indexOf ( `where` ) ;
238
+ let fromWhereClause : string | undefined ;
230
239
231
- if ( whereClauseStart > 0 ) {
232
- fromWhereClause = basicSelect . substring ( whereClauseStart ) ;
233
- }
240
+ if ( whereClauseStart > 0 ) {
241
+ fromWhereClause = basicSelect . substring ( whereClauseStart ) ;
242
+ }
234
243
235
244
236
- basicSelect = `select rrn(${ cName } ) as RRN, ${ possibleColumnList } from ${ schema } .${ ref . object . name } as ${ cName } ${ fromWhereClause || `` } ` ;
237
- currentColumns = [ { name : `RRN` , jsType : `number` , useInWhere : true } , ...currentColumns ] ;
238
- }
245
+ basicSelect = `select rrn(${ cName } ) as RRN, ${ possibleColumnList } from ${ schema } .${ ref . object . name } as ${ cName } ${ fromWhereClause || `` } ` ;
246
+ currentColumns = [ { name : `RRN` , jsType : `number` , useInWhere : true } , ...currentColumns ] ;
247
+ }
239
248
240
- updatable = {
241
- table : schema + `.` + ref . object . name ,
242
- columns : currentColumns
243
- } ;
249
+ updatable = {
250
+ table : schema + `.` + ref . object . name ,
251
+ columns : currentColumns
252
+ } ;
253
+ }
244
254
}
245
255
}
246
256
}
0 commit comments