Legacy Application Modernization: Key Steps, Benefits & Best Practices
This blog post was co-authored with Riaz Merchant, President and CEO at Mertech. In the fast-paced software world, 'legacy' often signals a warning.
The DataFlex date format isn't compatible with MS SQL. You must change the way an argument is passed and/or is received.
Take a look at this sample program. You may see that the variable is declared as a string, but should be date. I'm changing the date format before call stored procedure:
//SAMPLE PROGRAM //
#include mertech.inc
//
//CREATE PROCEDURE TEST @@dDateIN DATETIME, @@dDateOUT DATETIME OUTPUT //AS
// SELECT @@dDateOUT = DATEADD(dd,40,@@dDateIN)
//GO
//
string dDateIN //both variables should be date but...
string dDateOUT //
SET_ATTRIBUTE DF_DATE_FORMAT TO DF_DATE_USA
sysdate4 dDateIN
//changing to format yyyy-mm-dd
move ((mid(dDateIN,4,7)) + "-" + (mid(dDateIN,2,1)) + "-" +
(mid(dDateIN, 2,4))) to dDateIN
move dDateIN to dDateOUT
showIn "Arguments:"
showIn " dDateIN =" dDateIN
showIn " dDateOUT=" dDateOUT
login "localhost" "sa" "xxx" "SQL_DRV"
CALL_SQLSERVER_PROCEDURE "test.dbo.TEST" PASSING dDateIN dDateOUT SQLOUT
showIn "Returns:"
showIn " dDateOUT = " dDateOUT
showIn
showIn "Done!"
inkey strlen
abort
//END OF SAMPLE //
This blog post was co-authored with Riaz Merchant, President and CEO at Mertech. In the fast-paced software world, 'legacy' often signals a warning.
This post was co-authored with Riaz Merchant, President/CEO at Mertech Data Systems, Inc.
Shifting from your traditional legacy systems to the Cloud can be a game changer, as the benefits of cloud migration are numerous. Cloud computing...