Hey all. I'm trying to write my own dw service. As one of the functions of the service, I need to go through and set the values of one (computed) column in every row. I've tried to do this two ways: Way 1: long ll_rowcount, ll_set[] ll_rowcount = idw_Requestor.RowCount() ll_set[ll_rowcount+1] = 0 idw_Requestor.Object.Data.computed_column[1, ll_rowcount] = ll_set Way 2: long ll_rowcount, ll_index DWObject ldwo_compute ldwo_compute = idw_Requestor.Object.computed_column ll_rowcount = idw_Requestor.RowCount() FOR ll_index = 1 to ll_rowcount ldwo_compute.primary[ll_index] = 0 NEXT Both ways compile fine, but give me error when the function is run: Error: Error accessing external object property computed_column at line 27 in function of_resetdisplay of object n_mydwsrv_update. computed_column is, as the name suggests, a computed column. My service actually creates this column in the datawindow when the service is requested, and that part seems to work; at least, I don't get any errors there. Can someone tell me what I'm doing wrong, or suggest some alternatives? Thanks! : jay Jay Schmidgall SunGard Securities Systems
![]() |
0 |
![]() |
Jay, To address a column using dot notation, you need to further qualify the object dw_Control.Object.Column.Primary.Current [ RowNumber ] Or you could use GetItem... ( RowNumber, ColumnName ) HTH Sanjiv Das [ TeamPS ] Jay Schmidgall wrote in message <[email protected]>... >Hey all. I'm trying to write my own dw service. As one of >the functions of the service, I need to go through and set >the values of one (computed) column in every row. > >I've tried to do this two ways: > >Way 1: > > long ll_rowcount, ll_set[] > > ll_rowcount = idw_Requestor.RowCount() > ll_set[ll_rowcount+1] = 0 > idw_Requestor.Object.Data.computed_column[1, ll_rowcount] = ll_set > >Way 2: > > long ll_rowcount, ll_index > DWObject ldwo_compute > > ldwo_compute = idw_Requestor.Object.computed_column > ll_rowcount = idw_Requestor.RowCount() > > FOR ll_index = 1 to ll_rowcount > ldwo_compute.primary[ll_index] = 0 > NEXT > >Both ways compile fine, but give me error when the function is >run: > > Error: Error accessing external object property > computed_column at line 27 in function of_resetdisplay > of object n_mydwsrv_update. > >computed_column is, as the name suggests, a computed column. My >service actually creates this column in the datawindow when the >service is requested, and that part seems to work; at least, I >don't get any errors there. > >Can someone tell me what I'm doing wrong, or suggest some >alternatives? Thanks! > >: jay >Jay Schmidgall >SunGard Securities Systems >
![]() |
0 |
![]() |
Sanjiv Das [TeamPS] wrote: > Jay, > > To address a column using dot notation, you need to further qualify > the > object > > dw_Control.Object.Column.Primary.Current [ RowNumber ] > > Or you could use GetItem... ( RowNumber, ColumnName ) Okay, I tried this, and got this error: Error: Name not found accessing external property current at line... Is this because the column is a computd column? Is there another way to do this sort of thing for a computed column? I do note that when I type the word 'Current', it gets highlighted like a keyword, but 'Original' doesn't, if that makes any difference. : jay
![]() |
0 |
![]() |
Sanjiv Can you set the value of a computed column ? Can you set the value of a computed field ? incidentally whats the diff between computed column & field TIA On Thu, 29 Jan 1998 02:04:37 -0800, "Sanjiv Das [TeamPS]" <[email protected]> wrote: >Jay, > >To address a column using dot notation, you need to further qualify the >object > >dw_Control.Object.Column.Primary.Current [ RowNumber ] > >Or you could use GetItem... ( RowNumber, ColumnName ) > >HTH > >Sanjiv Das [ TeamPS ] > > > >Jay Schmidgall wrote in message <[email protected]>... >>Hey all. I'm trying to write my own dw service. As one of >>the functions of the service, I need to go through and set >>the values of one (computed) column in every row. >> >>I've tried to do this two ways: >> >>Way 1: >> >> long ll_rowcount, ll_set[] >> >> ll_rowcount = idw_Requestor.RowCount() >> ll_set[ll_rowcount+1] = 0 >> idw_Requestor.Object.Data.computed_column[1, ll_rowcount] = ll_set >> >>Way 2: >> >> long ll_rowcount, ll_index >> DWObject ldwo_compute >> >> ldwo_compute = idw_Requestor.Object.computed_column >> ll_rowcount = idw_Requestor.RowCount() >> >> FOR ll_index = 1 to ll_rowcount >> ldwo_compute.primary[ll_index] = 0 >> NEXT >> >>Both ways compile fine, but give me error when the function is >>run: >> >> Error: Error accessing external object property >> computed_column at line 27 in function of_resetdisplay >> of object n_mydwsrv_update. >> >>computed_column is, as the name suggests, a computed column. My >>service actually creates this column in the datawindow when the >>service is requested, and that part seems to work; at least, I >>don't get any errors there. >> >>Can someone tell me what I'm doing wrong, or suggest some >>alternatives? Thanks! >> >>: jay >>Jay Schmidgall >>SunGard Securities Systems >> > >
![]() |
0 |
![]() |
Jay, The datawindow buffers are maintained for columns that are a part of the data source of the DW. For an external DW, this would be the columns defined by the developer in the Data Source. For DWs with SQL Statements, these columns would be part of the SQL Statement. Computed fields ( defined in the DW painter using the 'Compute' button or selecting 'Computed Field' from the 'Objects' menu in the DW painter ) are not part of the result set as seen by the DW. They are computations based on the result set. To get values of computed fields, you could use the GetItem... ( ) functions or you could use the Describe ( ) function with the Evaluate... clause to dynamically evaluate the value. HTH Sanjiv Das [TeamPS] Jay Schmidgall wrote in message <[email protected]>... >Sanjiv Das [TeamPS] wrote: > >> Jay, >> >> To address a column using dot notation, you need to further qualify >> the >> object >> >> dw_Control.Object.Column.Primary.Current [ RowNumber ] >> >> Or you could use GetItem... ( RowNumber, ColumnName ) > >Okay, I tried this, and got this error: > > Error: Name not found accessing external property current at line... > >Is this because the column is a computd column? Is there another way to >do this sort of thing for a computed column? > >I do note that when I type the word 'Current', it gets highlighted like >a >keyword, but 'Original' doesn't, if that makes any difference. > >: jay >
![]() |
0 |
![]() |
Sanjay, A computed field is defined in the DW painter using the 'Compute' button or by selecting 'Computed Field' from the 'Objects' menu. A computed field is not part of the datawindow result set but is dynamically calculated on the front end after the result set is populated ( or as it is being populated ). A computed column is part of the result set of the DW. This is defined in the SQL statement. For example, you could use a SQL statement such as Select EmployeeName, EmployeeTitle, 0 'RowVisible' from Employee This would create a result set with the first two columns based on values in the database, and a third column which would be numeric - and the value would be zero for all rows in the result set. This third column could be set based on some business rules and used as a flag to filter the DW result set. You could then create a computed field in the DW with the expression EmployeeName + ' : ' + EmployeeTitle ( not sure why, but you could <g> ). You can set the value of a computed column but not of a computed field. As far as the DW is concerned, the computed column is like any other column from the database. The computed field, on the other hand, is a calculation done at the client based on values in the result set. To change the value of a computed field, you would just change the value of one or more of the columns that make up that computed field. HTH Sanjiv Das [TeamPS] Sanjay Minni wrote in message <[email protected]>... >Sanjiv > >Can you set the value of a computed column ? >Can you set the value of a computed field ? > >incidentally whats the diff between computed column & field > >TIA > >On Thu, 29 Jan 1998 02:04:37 -0800, "Sanjiv Das [TeamPS]" ><[email protected]> wrote: > >>Jay, >> >>To address a column using dot notation, you need to further qualify the >>object >> >>dw_Control.Object.Column.Primary.Current [ RowNumber ] >> >>Or you could use GetItem... ( RowNumber, ColumnName ) >> >>HTH >> >>Sanjiv Das [ TeamPS ] >> >> >> >>Jay Schmidgall wrote in message <[email protected]>... >>>Hey all. I'm trying to write my own dw service. As one of >>>the functions of the service, I need to go through and set >>>the values of one (computed) column in every row. >>> >>>I've tried to do this two ways: >>> >>>Way 1: >>> >>> long ll_rowcount, ll_set[] >>> >>> ll_rowcount = idw_Requestor.RowCount() >>> ll_set[ll_rowcount+1] = 0 >>> idw_Requestor.Object.Data.computed_column[1, ll_rowcount] = ll_set >>> >>>Way 2: >>> >>> long ll_rowcount, ll_index >>> DWObject ldwo_compute >>> >>> ldwo_compute = idw_Requestor.Object.computed_column >>> ll_rowcount = idw_Requestor.RowCount() >>> >>> FOR ll_index = 1 to ll_rowcount >>> ldwo_compute.primary[ll_index] = 0 >>> NEXT >>> >>>Both ways compile fine, but give me error when the function is >>>run: >>> >>> Error: Error accessing external object property >>> computed_column at line 27 in function of_resetdisplay >>> of object n_mydwsrv_update. >>> >>>computed_column is, as the name suggests, a computed column. My >>>service actually creates this column in the datawindow when the >>>service is requested, and that part seems to work; at least, I >>>don't get any errors there. >>> >>>Can someone tell me what I'm doing wrong, or suggest some >>>alternatives? Thanks! >>> >>>: jay >>>Jay Schmidgall >>>SunGard Securities Systems >>> >> >> >
![]() |
0 |
![]() |