Skip to the main content.
Downloads Thriftly Login
Downloads Thriftly Login
Group 762

Migrate and run DataFlex applications with Oracle, MS SQL Server, PostgreSQL, MySQL &  MariaDB.

flex2Crystal

Stuck in Crystal XI?  Upgrade and use the latest versions of Crystal Reports with DataFlex applications. 

BTR2SQL

Seamlessly convert from Btrieve transactional database to PostgreSQL, Oracle, and MS SQL Server.

thriftly-1

Quickly build multi-protocol web services with the same API. Supports JSON-RPC, REST, SOAP,  Thrift, and gRPC.

 Group 671-1

 

Why Mertech?

1 min read

Calling a Stored Procedure Passing and Receiving a Date

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 //

 

 

Why Migrate from Btrieve to PostgreSQL and other Relational Databases?

Why Migrate from Btrieve to PostgreSQL and other Relational Databases?

Introduction Many independent software vendors (ISV) and corporate users still rely on applications that use a category of database collective called...

Read More
Four Challenges in Converting COBOL Applications from ISAM Databases to Relational Databases

Four Challenges in Converting COBOL Applications from ISAM Databases to Relational Databases

COBOL applications are the foundation of numerous essential business functions, especially within the banking, insurance, and government sectors....

Read More
Application Modernization 101: Ultimate Guide to Digital Transformation

Application Modernization 101: Ultimate Guide to Digital Transformation

Imagine breaking free from the constraints of old, monolithic systems and embracing the agility and innovation of cloud-based solutions.

Read More