Are these remote views? If so...
Are either of the views parameterized?
Are they sharing a connection?
If so, are you using any progressive fetching. I don't think select will use the views that you have already opened. Have you tried to remove the USE commands and see what happens. Since I think the select is going to run the views' SQL again, perhaps if you are using progressive fecthing then the first view fetch will block the second. But...
I don't know why code would run differently in a method or a form, but, how are you looking at the data after the method executes?
Now, real stupid questions, why not use SPT or create a view that has the join in it inheriently? Doing the join at the client seems very inefficient.
Another thing to try:
USE rv1 in 0
USE rv2 in 0
cRV1 = dbf('rv1')
cRV2 = dbf('rv2')
SELECT v1.*, v2.* from (cRV1) v1 ;
left outer join (cRV2) v2 on v1.IDField = v2.IDField ;
into cursor curTemp
********************
Just some ideas...
BOb
>Hi everyone,
>I have a strange situation with a cursor formed from 2 remote views. Data from the second view doesn't show up when I run the code in a method, but does when I run the same code in a PRG.
>
>USE rv1 in 0
>
>USE rv2 in 0
>
>SELECT rv1.*, rv2.* from rv1 ;
> left outer join rv2 on rv1.IDField = rv2.IDField ;
> into cursor curTemp
>curTemp shows NULL values for all the rv2 fields in my form method, but shows the correct data when the exact same code is run from a PRG. I know the LOJ is running correctly, because one of the 4 result records doesn't have a link to rv2.
>
>I tried the same code using a WHERE clause linking the two tables. Three records showed the correct rv1 data, but again nulls for the rv2 data in the form method. The record without a link to rv2 was missing as expected in this version.
>
>Anybody see what I'm missing? Or what the difference could be between PRG and form method?
>
>TIA,
>Barbara
>TIA,
>Barbara