Help with SQL and SESSION datatable

J

John Cosmas

I have a session object which stores the user specific list of records
(CASES) that they are allowed to use, which comes from a global list
(collection of CASES). I need to run a SELECT which JOINs the user
records/cases with the CASE table so I can get the APPOINTMENTS, related
specifically to the user cases. My SELECT statement should resemble
something like this.

SELECT CASES.CASEID, CASES.CASENAME, CASES.CASENUMBER, APPT.DATE, APPT.TIME,
APPT.DESC FROM CASES JOIN APPT.CASEID = CASES.CASEID..... CASES.CASEID =
USERCASES.CASEID

In this case, the USERCASES come from a DIM pdatUserCases AS NEW DATATABLE =
CTYPE(SESSION("MyUserCases"), DataTable). I've not done something unusual
like this before, so I'm not so sure how I could join a DATATABLE into a
SELECT statement. The only way I know how, is to stuff the USERCASES into a
TEMP table.

Also, I thought of passing the USERCASES into an ARRAY, and somehow using
that in the SQL statement. If someone has an example, please share.

TIA
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top