Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: How do I define a Nullable DateTime variable in Visual COBOL ?

$
0
0

What are you using to access your database in Visual COBOL?

If you are using OpenESQL for embedded SQL support for ADO.NET then you would simply set your null indicator variable to -1 to indicate that a null should be inserted.

Example:

           EXEC SQL 
             CONNECT TO 'SQLADO32' 
           END-EXEC 
           move -1 to my-table-mydate-null
           move "chris" to my-table-item-a
           EXEC SQL 
              UPDATE MY_TABLE  
                SET MYDATE = :MY-TABLE-MYDATE:MY-TABLE-MYDATE-NULL
                   WHERE (ITEM_A = :MY-TABLE-ITEM-A)
           END-EXEC 
           exec sql commit end-exec

If you are accessing the ADO.NET Framework cl;asses directly then Null values are represented by DBNull.Value


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>