Use stored procedures in 4GL.

I‘ve already got a procedure in the MySQL database and I want to know, how could I call stored the procedure in my 4gl application?

You can use the ‘prepare/execute’ syntax in 4GL. For example:

PREPARE p1 FROM “EXECUTE PROCEDURE procedure_name” EXECUTE p1
This statement will be automatically translated to the MySQL syntax for procedure calls if using v4.4 of Hydra software and above versions. If you are using an older version, you will need to use the native MySQL syntax:

PREPARE NATIVE p1 FROM “CALL procedure_name()”EXECUTE p1
Notice that the ‘NATIVE’ keyword is used in the prepared statement when Informix SQL syntax is not using.
Please use the following instructions while working with SQL Server:

EXEC procedue_name <parameters> <output values>
Where output_values are numbers prefixed with ‘:’, for example:
— input values

PREPARE NATIVE p1 FROM “EXEC procedure_name ?, ?”

EXECUTE p1 USING value1, value2
— output values

PREPARE p1 FROM “EXEC procedure_name :0, :1”

EXECUTE p1 INTO output1, output2
— input and output values

PREPARE NATIVE p1 FROM “EXEC procedue_name ?, ?, :0, :1”

EXECUTE p1 INTO output1, output1 USING value1, value2

Click the link below to see
all KB articles by product.