PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Embedded IO procs/RDB  (Read 697 times)

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Embedded IO procs/RDB
« on: August 15, 2022, 02:59:01 PM »
We have made significant use of embedded IO procedures with the native file set. As we look to extend to using RDBs (like MSSQL), how can we leverage those embedded IO procedures? I thought maybe using SETDEV(chan)PROGRAM "MYPROC" after opening a table on <chan> would enable us to use the existing IO procs but that doesn't seem to work. Do we have to create database triggers that replicate our embedded IO? (Not even sure how we would do that but just looking for a direction).

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Embedded IO procs/RDB
« Reply #1 on: August 15, 2022, 03:07:06 PM »
Using the SETDEV (nn) PROGRAM should work on a database, however since the file is already open there will not be any "Open" event which is often where a lot of the processing for embedded IO is done.

What I would suggest is that you use a PREFIX file to open the database and include a IOPROG=xxxxxx option in the Prefix file entry in order to have the IO program involved during the OPEN sequence.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: Embedded IO procs/RDB
« Reply #2 on: August 15, 2022, 03:25:50 PM »
Mike,
Thanks for the reply - I'll dig in a little deeper then. Related question, if I use the database conversion utility in the data dictionary to update a prefix file, will it include the IOPROG= option if the IO proc is specified in the data dictionary definition?

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Embedded IO procs/RDB
« Reply #3 on: August 15, 2022, 03:34:40 PM »
The Database convert utility does not bring across the IO program into the option string.

We don't just assume that the IO program would apply since quite often the IO program is used for data replication onto a database.  Including this type of logic when migrating to a relational database makes no sense.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

ChrisKCAi

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
Re: Embedded IO procs/RDB
« Reply #4 on: August 15, 2022, 04:21:24 PM »
Well, it wouldn't be the first time I made no sense  ;)
Although we do currently use embedded IO to facilitate replicating data to relational databases, that is governed by an on/off parameter within our software.
We would force that parameter "off" when using a prefix file so we can take advantage of the rest of the embedded IO logic.
We will just add it to the additional options on the conversion utility panel when updating the prefix file.

Thanks.