User bio
404 bio not found
Member since May 9
Replies:

It gives same error with/without semicolon.

Queries work 100% from within DBVisualizer.

Seems issue lies with the Fetch section in Class ....ReportStoredProcs Extends %RegisteredObject 
 

The insert works 100%, but below fetch only returns 3 rows instead of 7, if I remove Quit $$$OK , then I get 7 rows, but of course it returns an error

    // Prepare and execute the final query to fetch data from the temporary table
    rsFetchTempData = ##class(%ResultSet).%New()
    sc = rsFetchTempData.Prepare("SELECT * FROM TableA")
    if 'sc sc
    sc = rsFetchTempData.Execute()
    if 'sc sc
    qHandle = rsFetchTempData
    Quit $$$OK


ClassMethod ListPersonsFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = ListPersonsExecute ]
{
sc = qHandle.Next()
    
    if (qHandle.Next())
    {
    // Fetch the current row
     Row = $LB(qHandle.Get("Col1"), qHandle.Get("Col2"), qHandle.Get("Col3"), qHandle.Get("Col4"), qHandle.Get("Col5"), qHandle.Get("Col6"), qHandle.Get("Col7"))
    }
    else
    {
        AtEnd = 1
        Row = ""
    }
Quit $$$OK
}

Certifications & Credly badges:
KEVIN has no Certifications & Credly badges yet.
Global Masters badges:
KEVIN has no Global Masters badges yet.
Followers:
KEVIN has no followers yet.
Following:
KEVIN has not followed anybody yet.