Hi Himlar
I think the code gets executed twice because the initialisation process trys to determine the type of the field for the resulting cursor.
I am trying to create a single remote view that will return my nextid and update it in the remote database without having to requery.
Regards
Geoff
>>Hi Hilmar
>>
>
SELECT IIF(not table='CUSTPAYMENT',999999999999,newid('CUSTPAYMENT')) as nextid ;
>> FROM ids WHERE table='CUSTPAYMENT' INTO CURSOR tNextId
>
>
>I don't know why the SP gets executed twice.
>
>How about a two-step selection, would that solve the problem?
>
>
>SELECT (fieldlist) from ids where WHERE table='CUSTPAYMENT';
> INTO CURSOR tNextId nofilter
>select *, IIF(not table='CUSTPAYMENT',999999999999,newid('CUSTPAYMENT')) as nextid;
> from tNextId into cursor tNextId
>
May all your weeds be wildflowers