Does anybody know how to call a stored-procedure from within HMG?
I now have a procedure:
Code: Select all
CREATE PROCEDURE GET_ALL_P0001()
BEGIN
SELECT * FROM P0001;
END
Allready stored in MySQL and then I try to call it:
Code: Select all
IF SQL_Connect(qHST,qUSR,qPAW,qDBN) == Nil
MSGINFO('SQL_CONNECT_ERROR' ,'NOK' )
RETURN
ENDIF
cQuery2 := 'CALL GET_ALL_P0001()'
cQuery2 := dbo:Query( cQuery2 )
IF cQuery2:NetErr() // hier fout
? PROCNAME() + '2 ' + cQuery2:Error()
MSGINFO(cQuery2:Error(), pNOK )
RETURN
ENDIF
FOR j := 1 To cQuery2:LastRec()
aCurRowj := cQuery2:GetRow(j)
c1 := ALLTRIM(aCurRowj:fieldGet(1))
c2 := ALLTRIM(aCurRowj:fieldGet(2))
? C1
? C2
NEXT
sql_disconnect()
Code: Select all
PROCEDURE GET_ALL_P0001 can't return a result set in the given context
Any help or suggestion is appreciated!
Serge