Written by

Sr Application Development Analyst at The Ohio State University Wexner Medical Center
Question Scott Roth · Dec 20, 2024

MaxRowsToGet on EnsLib.SQL.InboundAdapter

I have a query that returns around 6000 records that I need to go through and update another MS SQL Table. I would like to execute this once a day. How do you set MaxRowsToGet on a EnsLib.SQL.InboundAdapter service?

Thanks

Scott

Product version: IRIS 2024.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:06:39 EDT [HealthConnect:7.2.0-1.r1]

Comments

Chandrasekar Angaiah · Dec 23, 2024

you have to create new class Extends EnsLib.SQL.InboundAdapter

Overwrite OnInit()

Set ..%Row.MaxRowsToGet=-1 [get all records]

0
Scott Roth  Jan 6, 2025 to Chandrasekar Angaiah

@Chandrasekar Angaiah 

My Init is as follows..

Method OnInit() As%Status

{

  Set..InitDSN = ..Adapter.DSN

  //Set ..Adapter.ConnectAttrs = "QueryTimeout:45" ; try this too just in case...

  Set ..%Row.MaxRowsToGet = -1

  Quit$$$OK

}

When I try to compile, I am getting a %Row does not exist in this class.

0
Enrico Parisi  Jan 6, 2025 to Scott Roth

As @Chandrasekar Angaiah pointed out you need to create a new class that extends EnsLib.SQL.InboundAdapter and then you use the new class instead of EnsLib.SQL.InboundAdapter.

Within that new class override OnInit(), something like:

Class My.SQL.InboundAdapter Extends EnsLib.SQL.InboundAdapter
{
Method OnInit() As%Status
{
    Set sc=##super()
    If$$$ISOK(sc) Set ..%Row.MaxRowsToGet=-1Quit sc
}
}
0