Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: TSQLQuery and update of data

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 0 Threads: [ Previous | Next ]
Mats karlsson

Posts: 64
Registered: 11/8/99
TSQLQuery and update of data  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2016 1:33 PM
I have a db containing notes for say customers. The db design involve one table for notes, a link table customer_note and a customers table.
The query to obtain the notes for a selected customer is:
SELECT * FROM note n 
INNER JOIN customer_note cn 
ON (cn.note_id = 
WHERE customer_id = :customerID 
ORDER BY created_on ASC

The query is executed in an event where the customers database is scrolled, i.e.
	int cID = customerCDS->FieldByName("id")->AsInteger;
	customerNotesQ->Params->ParamByName("customerID")->AsInteger = bID;
    //Get notes
	string note = stdstr(customerNotesQ->FieldByName("note")->AsString);
    Log(lInfo) << "Note is: "<<note;

The query is referenced by a DataSetProvider, a ClientDataSet and a DataSource component. On the UI a TDBLookupListbox is receiving the data.

Problem is, the TDBLookpListbox shows ALL notes for all customers. Any idea what is going on??
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02