Setup (running OE 10.2b):
DEFINE BUFFER EMPemployee FOR employee.
DEFINE BUFFER EMPdepartment FOR department.
DEFINE QUERY qryEmployee FOR EMPemployee, EMPdepartment.
DEFINE DBTable AS CHAR.
...
DBTable = QUERY qryEmployee:HANDLE:GET-BUFFER-HANDLE (1):<WHAT GOES HERE>.
QUESTION:
What I am ultimately trying to retrieve is the name of the DB tables ('Employee', 'Department') referenced by the buffers in the query object. For example, if I use QUERY qryEmployee:HANDLE:GET-BUFFER-HANDLE (1):NAME, the output value is 'EMPemployee'. I am not concerned with the name of the associated buffer, rather the name of the underlying DB table.
Thanks in advance for any advice you care to share.
AH, that's easy. Take a look at buffer-handle:TABLE-HANDLE or buffer-handle:TABLE for a name (the Buffer Object Handle in the Help).
But in your example you have the db table buffer handle already.
Handle to the DB table makes no sense. Is it the name of the DB table that you want?
Yes.
>hdlDBTable = QUERY qryEmployee:HANDLE:GET-BUFFER-HANDLE (1):<WHAT GOES HERE>.
Nothing goes here...
--------------------
DEFINE var hdlDBTable AS HANDLE.
hdlDBTable = QUERY qryEmployee:HANDLE:GET-BUFFER-HANDLE (1).
---------
Or
----
hdlDBTable = QUERY qryEmployee:HANDLE:GET-BUFFER-HANDLE ("EMPemployee").
-----
Thank you for the reply hdaniels. As Dr. Mercer-Hursh astutely pointed out in his previous post, I am not looking for a handle to the buffer defined by the query object, rather, I am attempting to discern the name of the db table that this buffer references.
EMPemployee and EMPdepartment are both buffers on the DB table. As are employee and department (ie you never talk to a database table without going through a buffer).
So Get-buffer-handle(n) gets you what you're asking for.
If you want another buffer on the database table that has a different name, use
DEF VAR hNamedEmpBuffer as handle. create buffer hNamedEmpBuffer for table Employee buffer-name 'AnotherEmployee'.
The buffer-name modifier is vital here.
-- peter
I think the point is that he would like to query the handle of EMPemployee and find out that it is a buffer for employee.
Thomas is correct. I apologize for the confusion I have caused. I have updated the original question in light of my ignorance.
AH, that's easy. Take a look at buffer-handle:TABLE-HANDLE or buffer-handle:TABLE for a name (the Buffer Object Handle in the Help).
But in your example you have the db table buffer handle already.
Thank you to everyone that replied. Peter has provided the answer I was looking for to this question. I appreciate the mentoring, gentlemen.