Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange fatal error with Select
Message
De
26/02/2008 09:24:50
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01296229
Message ID:
01296395
Vues:
10
>We have been experiencing a rather bizarre issue with FoxPro 9 SP1. The code is as follows:
>
>
>LOCAL lnTableAPrimary_ID AS Integer
>
>SELECT TableA
>
>IF USED("csrPrimaryID")
>      USE IN csrPrimaryID
>ENDIF
>
>IF USED("csrSecondaryID")
>      USE IN csrSecondaryID
>ENDIF
>
>SCAN
>      lnTableAPrimary_ID = TableA.Primary_ID
>
>      SELECT TOP 1 TableC.Primary_ID FROM TableC WITH(BUFFERING = .T.)  INNER JOIN TableB WITH(BUFFERING = .T.) ON TableC.Primary_ID == TableB.TableC_FK_ID;
>       WHERE UPPER(ALLTRIM(TableC.Type)) == "PRIMARY" AND TableB.TableA_FK_ID == lnTableAPrimary_ID ORDER BY TableB.BeginDate DESC INTO CURSOR csrPrimaryID
>
>      IF RECCOUNT("csrPrimaryID") > 0
>            GO TOP IN csrPrimaryID
>            REPLACE TableC_ID_1 WITH csrPrimaryID.Primary_ID IN TableA
>      ENDIF
>ENDSCAN
>
>
>
>SCAN
>      lnTableAPrimary_ID = TableA.Primary_ID
>      SELECT TOP 1 TableC.Primary_ID FROM TableC WITH(BUFFERING = .T.) INNER JOIN TableB WITH(BUFFERING = .T.) ON TableC.Primary_ID == TableB.TableC_FK_ID;
>       WHERE UPPER(ALLTRIM(TableC.Type)) == "SECONDARY" AND TableB.TableA_FK_ID == lnTableAPrimary_ID ORDER BY TableB.BeginDate DESC INTO CURSOR csrSecondaryID
>
>      IF RECCOUNT("csrSecondaryID") > 0
>            GO TOP IN csrSecondaryID
>            REPLACE TableC_ID_2 WITH csrSecondaryID.Primary_ID IN TableA
>      ENDIF
>ENDSCAN
>
>IF USED("csrPrimaryID")
>      USE IN csrPrimaryID
>ENDIF
>
>IF USED("csrSecondaryID")
>      USE IN csrSecondaryID
>ENDIF
>
>
>Tables A, B and C are all remote views to a Microsoft SQL Server database. All the records in each of these remote views have been added since the last call to TableUpdate. When I attempt to run this code, the error generally occurs in the same place, but occasionally blows up on different records. (This code is part of a larger batch load and is executed on every item being loaded. It will sometimes run on hundreds of records before blowing up. When it blows up, it blows up on one of the two select statements, generally the first, but not always. It also will generally blow up with a windows fatal exception followed by the FoxPro fatal exception dialog, however it also sometimes does a windows fatal exception followed by a FoxPro internal consistency error, or sometimes simply hangs and does not blow up at all. I have not been able to identify any errors in this code and the results returned are valid for the rows that it works on.
>

Seems to me that if A, B and C are remote views, you don't need "WITH Buffering=.T." because there's no disk presence to go back to.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform