Good morning,
Are you executing the procedure from your maintain code? Or are you executing the maintain code from a procedure? Is your procedure a straight TABLE FILE or does it execute sql?
If you open your maintain code and the execute the procedure, here is an example of something similar I currently use.
Maintain Code
MAINTAIN FILE COURSEBYLOCATION
$$Declarations
Case Top
INFER coursebylocation. COURSEBYLOCATION. FacilityCode INTO StkCourse;
COMPUTE
FacilityCode/A4 = '';
CourseCode/A4 = '';
Winform Show Form1;
EndCase
CASE selectRecords
STACK CLEAR StkCourse
-*OPTION 1 –external procedure not needed to retrieve data
REPOSITION coursebylocation. COURSEBYLOCATION. FacilityCode
FOR ALL NEXT coursebylocation. COURSEBYLOCATION. FacilityCode INTO StkCourse
WHERE coursebylocation. COURSEBYLOCATION. FacilityCode = FacilityCode
AND coursebylocation. COURSEBYLOCATION. CourseCode = CourseCode
-*OPTION 2 – execute external procedure
EXEC GetCourseByLocation
FROM FacilityCode CourseCode
INTO StkSelectAttendance;
EndCase
END
The form has 2 input fields bound to FacilityCode and CourseCode and one button. The customer enters the correct codes and then clicks the button. The onClick event code is PERFORM selectRecords.
Focexec code – (my example executes a stored procedure)
-SET &FacilityCode = &1; (parameters passed to focexec are named &1, &2, etc. I set to a logical name for simplicity)
-SET &CourseCode = &2;
ENGINE SQLMSS END SESSION
-RUN
-* CREATE SQL SESSION
SET SQLENGINE = SQLMSS
ENGINE SQLMSS SET DEFAULT_CONNECTION ConnName;
ENGINE SQLMSS SET CONVERSION LONGCHAR ALPHA
END
-RUN
SQL SQLMSS
EX dbo.storedProcName '&FacilityCode', '&CourseCode’;
TABLE FILE SQLOUT
PRINT FacilityCode, FacilityName, EffectiveDate, ExpirationDate
ON TABLE HOLD AS HOLDRSLT
END
TABLE FILE HOLDRSLT
PRINT FacilityCode, FacilityName, EffectiveDate, ExpirationDate
ON TABLE PCHOLD
END
Deana
WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf