NetTalk Central

Author Topic: In-Memory Example  (Read 3222 times)

Neil Porter

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
In-Memory Example
« on: March 22, 2012, 09:57:20 AM »
Bruce has mentioned several times on this forum that he doesn't support the browsing of queues becasue they aren't thread safe. He always suggests that we should use a Memory table.

I have the In-Memory driver, but I have to be honest and say that I've never used it becaseu I can't quite get my head around how it works.

I would love to be able to populate a queue from SQL and then use a NetWeb browse to allow my user to select a record from this queue.

Does anyone have an example that they could point me towards, or maybe some code snips that would get me going.

I just don't know where to start.

TIA,

Neil Porter.

C8 NT 6.25
Clarion 11.0.13244
NetTalk 11.04

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: In-Memory Example
« Reply #1 on: March 22, 2012, 02:50:10 PM »
Hi Neil,

what sort of information did you want to populate as Memory Tables eg Post Codes, Suppliers etc?

any reason you want to do it this way and not just serving up the data straight from SQL?

Cheers,

Kevin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: In-Memory Example
« Reply #2 on: March 22, 2012, 11:33:59 PM »
>> I have the In-Memory driver, but I have to be honest and say that I've never used it because I can't quite get my head around how it works.

I think you are expecting it to be something it is not.

It is a file structure - no different to a TPS or SQL file structure. It works in exactly the same way. If you want data in the file you add it with ADD or INSERT. If you want data out you use a View, or FETCH or GET or whatever.

The memory driver is a plain, and simple, file driver. If you understand a SQL driver, or TPS driver then you understand the memory driver.

If you were going to populate a Queue with data from a table, then you'd read the table, loop through the records and ADD to the queue. A Memory table is no different. A temp TPS file is no different either.

In the WebServer context remember to make the SESSIONID a field in the table - because multiple people will be sharing the same table.

Cheers
Bruce