cancel
Showing results for 
Search instead for 
Did you mean: 

Rowscopy Question

Former Member
0 Kudos

I have 2 datawindows that I wanted to copy and move rows between. Its failing with a -1

They both have exactly the same column list but the big difference is one is built using a Select statement and the other is a External Datawindow.

I'm wanting to copy rows from the DW_1 Select statement to the external datawindow dw_2 without using a getitem and setitem but by using the rowscopy function.

Will the rowscopy and rowsmove work if the underlying data source is different but the columns are exactly the same ?

Thanks for any help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Richard;

  The Data Source for the DWO's does not make a difference for the RowsCopy method to work. What RowsCopy is assuming though is that the two DWO primary buffers are of the identical declaration. that is to say ...

1) The number of columns are the same.

2) Each corresponding column's data type is the same.

3) Each corresponding column's data length is the same.

4) The columns must be in the same order.

    (ie: columns A,B,C in DW#1 will not work with columns declared as A,C,B in DW#2)

HTH

Regards ... Chris

Former Member
0 Kudos

Chris,

This is valuable information. I will now spend the time to see what is actually different.

From you answer, must still be something

Thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Richard,

I'm wondering why do you have an external DWO that is identical to a DWO created with a select statement. You can use the same DWO in both controls (dw_1 & dw_2) and after retrieving the data for dw_1 do the rowscopy.

Former Member
0 Kudos

Its complicated.

The second datawindow is populated from multiple datawindows not just dw_1. dw_1 is only one of many sources.

The second dw is not related to a sql statement and does not need to be

Thanks

Richard

Former Member
0 Kudos

FWIW: Other good reasons to use another DWO could be ...

1) Used to produce XML, TAB, CSV, etc using a different XML schema and or file factors.

2) Used for printing where the format is quite different than the source DWO.

3) Used to export to a spreadsheet using / adding different characteristics.

4) Designed for specialized filtering & sorting - way beyond the source DWO.

etc