Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query doesn't return up to date data first time
Message
From
13/02/2008 00:25:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
12/02/2008 13:07:36
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01291747
Message ID:
01292037
Views:
25
Frank,

what I dont understand is, that it will pull data from the old record. AFAIK the m.liPaymentId should point to the new one?
I would understand if the first select results in nothing.

What is the way you move the ID from one user to the other?

Have you tried to FLUSH the data on comp 1 and purge memo on comp 2 SYS(1104)?

Agnes
>Agnes,
>
>>so the record in question is written via tableupdate or is SET('SQLBUFFERING') ON?
>>
>
>There is a lot of framework code involved, but yes, ultimately a TABLEUPDATE() is performed (and is successful, otherwise the invoice would not hav ebeen visible when the receipt was being created).
>
>>Does c_PaymentsReport exists before the SELECT?
>>
>no, it does not exist prior to the SQL and it gets created by the select.
>
>>If you simplfy the SELECT (i.e. just getting single records from single tables NOFILTER) do you get the result you expect?
>>
>
>I'll try that, but it's one of these hard to reproduce bugs :(
>
>>HTH
>>Agnes
>>
>>AFK
>>>Hi Agnes,
>>>
>>>>do you use buffering? Are you shure that the INTO clause will nothing mix up?
>>>>
>>>
>>>yes, I use buffering.
>>>
>>>>Maybe you provide the full SELECT command.
>>>>
>>>
>>>This is the SQL:
>>>
>>>
>>>m.liPaymentId = c_Payments.iPaymentid && the correct ID is returned here
>>>
>>>select Payments.IPAYMENTID, Payments.DPAID, Payments.IPATIENTID, Payments.IPAYTYPEID, Payments.NAMOUNT, ;
>>>  Payments.CCHEQUENO, Payments.DDEPOSITED, Payments.CPOSTREF, Payments.CRECEIPTNO,;
>>>  PaymentsDetails.NAMOUNT as PayDetAmount, IPAYDETID, sales.cinvoiceno, Sales.dSale, ;
>>>  Sales.nVat, Sales.nTotal, Sales.nBalance, PaymentsDetails.nBalDue,;
>>>  Patients.cSurname, Patients.cFirstName, Patients.cMidName, Patients.cTitle,  atients.cPatientNo, ;
>>>  PADR(ALLTRIM(Patients.cSurname) + "," + ALLTRIM(Patients.cFirstName) + " " + ALLTRIM(Patients.cMidName), 100) as cPatient,;
>>>  PayTypes.cDesc as cType, PatientAddresses.cAddress1, PatientAddresses.cAddress2, PatientAddresses.cTown,;
>>>  PatientAddresses.cPostCode, PatientAddresses.cCountry,;
>>>  SalesDetails.cCode, SalesDetails.cdesc, SalesDetails.cDiscount, SalesDetails.cIntDesc,;
>>>  SalesDetails.cVATCode, SalesDetails.iQty, SalesDetails.nAmount as nDetAmount, SalesDetails.nDiscAmt, ;
>>>  SalesDetails.nPrice, SalesDetails.nVATAmount, SalesDetails.nVATRate, sales.iSaleId,;
>>>  Sales.cInvoiceTo, Sales.cInvoiceToAddress, Sales.cInvoiceToPhone;
>>> FROM Payments;
>>>  inner join PaymentsDetails ON Payments.iPaymentId = PaymentsDetails.iPaymentId;
>>>  inner join Sales ON PaymentsDetails.iSaleId = sales.iSaleId;
>>>  inner join SalesDetails ON Sales.iSaleId = salesDetails.iSaleId;
>>>  INNER JOIN Patients ON Payments.iPatientId = Patients.iPatientId;
>>>  INNER JOIN Lookups as PayTypes ON Payments.IPAYTYPEID = PayTypes.ILookupID;
>>>  LEFT OUTER JOIN PatientAddresses ON Payments.iPatientId = PatientAddresses.iPatientid ;
>>> WHERE Payments.iPaymentId = m.liPaymentId;
>>> ORDER BY cInvoiceNo ;
>>> INTO CURSOR c_PaymentsReport
>>>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform