Avatar of LYekelchik2007
LYekelchik2007
Flag for United States of America asked on

EXEC " & procedureName

I have this script code in Lotus notes
sqlString = "EXEC " & procedureName$ & "'LeadUID'"
      
      qry.SQL = sqlString
      result.Execute
      
      If result.IsResultSetAvailable Then
            If result.NumRows = DB_ROWSUNKNOWN Then
                  rows$ = "Not determined yet"
            Else
                  rows$ = Cstr(result.NumRows)
            End If
            
      Else
            Messagebox "Result set not available",,      "No result set"
      End If
      
The Line "If result.IsResultSetAvailable" give me  a Messagebox "Result set not available",,      "No result set"
So I am able to execuate  this line from SQL "EXEC " & procedureName$ & "'LeadUID'" and get result ..So need return Integer form Column"2" .. Where my problem    
Lotus IBM

Avatar of undefined
Last Comment
behenderson

8/22/2022 - Mon
behenderson

I use this function

Function GetNumResults(dataResults As ODBCResultSet ) As Long
      ' This function looks at and ODBCresultset and returns the number of records in the result
 On  Error  Goto ErrorTime
 Dim status As  Long                ' For checking ODBC status
 GetNumResults = 0
 If (dataResults Is Nothing) Then Goto TheEnd
      '----- Count the number of records in the result set
 Call dataResults.LastRow
 GetNumResults = dataResults.CurrentRow
 If (dataResults.NumRows = DB_ROWSUNKNOWN And GetNumResults > 0) Then
  GetNumResults = 0
  status = dataResults.GetError
  If status <> DBstsSUCCESS Then
   Print con.GetExtendedErrorMessage & "  " &  con.GetError & " " & con.GetErrorMessage
  Else
   Print "connected"
  End If
  Goto TheEnd
 End If
      '----- Log the number of records found
TheEnd:
 Exit Function
ErrorTime:
 GetNumResults = 0
 Resume TheEnd
End Function
LYekelchik2007

ASKER
sorry .. Need to use Store Procedure
sqlString = "EXEC " & procedureName$ & "'LeadUID'" .. That why .. I can use it .. but need use it
 
marilyng

You don't specify which version of Notes you are using.  But here are a few examples:

http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/e64cba9fc26a49a08525691b0047f9c9?OpenDocument

For 4.6 and R5:
http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/dd51bc4528f9048005256838003790b1?OpenDocument

You could also try the execProcedure method of the ODBCResultClass.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
qwaletee

First off, LSXODBS is deprecated.  You should really be using the Lotus COnnector classes instead (*lsxlc).

If yo inist tho... Marilyn's last comment is key -- the driver cn get confused by additional info returned by a TSQL EXEC call if you don't tell it that you are using SP.  That's what execProcedure is for.

In addition, certain datatypes confuse the older driver.  You might try grabbing the TSQL of the SP, breaking it down, and seeing what happens when you call the various pieces. You should be able to at leats experiment with this in dev, even if the SQL prod security requires that everything be done via SP.
marilyng

Agreed!
ASKER CERTIFIED SOLUTION
qwaletee

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
behenderson

If the cleanup rules don't allow an expert to self assign points from time to time then that is really a bad deal for people who do that work.  The question really should be does marilyng take advantage of that to enrich herself and if you look at the evidence the answer is a real resounding no.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
qwaletee

Hey, wasn't accusing, just wondering.
qwaletee

Marilyn, why did split onto me?  I thought you were gong with you and behenderson?
behenderson

The split is fine with me.. I know that you were not trying to grab the points, that clearly was not your intent.  I also know that you add insight and expertise to this forum so it is good that they did go to you.  call it serendipity, which is nice when it happens.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy