[Solved] Oracle sql command
Hello there,
I'm trying to send a sql request to an Oracle base using progress 9.
With OE the following code can compile without any problem. Problem is that it's not working with Progress 9. I always get an error.
I need to send a sql request as the table been accessed is highly populated.
It seems that the load-into-result is not accepted.
Any help would be greatly appreciated.
Hello there,
I'm trying to send a sql request to an Oracle base using progress 9.
With OE the following code can compile without any problem. Problem is that it's not working with Progress 9. I always get an error.
I need to send a sql request as the table been accessed is highly populated.
Code:
IF DBTYPE("grh") = "ORACLE" THEN DO:
DEFINE VARIABLE tt_1 AS HANDLE NO-UNDO. /* Handle pour la copie de la table tbinterf dans table tempo */
DEFINE VARIABLE sqlreq AS CHARACTER NO-UNDO.
ASSIGN sqlreq = "SELECT * FROM tbinterf /*+ INDEX (tbinterf I-typlotident) */ "
+ "WHERE tbinterf.typinterf = 'CHRONOS_VALPLAN' "
+ "AND tbinterf.nolot < 3 "
+ "AND tbinterf.identifiant >= 'VAL|" + p_matr + "|" + STRING(YEAR(p_deb),"9999") + "/" + STRING(MONTH(p_deb),"99") + "/" + STRING(DAY(p_deb),"99") + "' "
+ "AND tbinterf.identifiant <= 'VAL|" + p_matr + "|" + STRING(YEAR(p_fin),"9999") + "/" + STRING(MONTH(p_fin),"99") + "/" + STRING(DAY(p_fin),"99") + "' "
tt_1 = TEMP-TABLE p_tbinterf:HANDLE.
RUN STORED-PROC grh.send-sql-statement LOAD-RESULT-INTO tt_1 NO-ERROR (sqlreq).
END.
Any help would be greatly appreciated.