Cloveleaf-ODBC SQL Server Interface – Data Type Issue

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Cloveleaf-ODBC SQL Server Interface – Data Type Issue

  • Creator
    Topic
  • #48521
    Kannan Varadharajan
    Participant

      Hello All,

      Our Platform :

        Cloverleaf 5.3 Release 3

        Data Integrator 5.3 (ODBC) with DataConnect 4.2

        AIX5.2

      Problem: When I try to insert a Date (String Data Type) into SQL Server 2000 Table using ODBC TCL extensions, it is not inserting correctly.

      For example: Date 2006-04-25 is inserted as  1905-06-01 in the SQL Server Table.  

      Data Type of the Date in the SQL Server Table is DateTime.  

      If anybody has worked with different Data Types using Cloverleaf ODBC Interface with SQL Server, please let me know how do I insert the data using ODBC TCL Proc for different data type other than String/Numeric.

      Appreciate your help.

      Thank You

      Kannan V

    Viewing 1 reply thread
    • Author
      Replies
      • #58864
        Charlie Bursell
        Participant

          In SQL Server the DateTime format is like:

              January 1, 2000

          You need an insert statement like:

             insert into mytable values (‘January 1, 2000’)

          In Tcl try:

          set dt 2006-04-25

          set fmtDt [clock format [clock scan $dt] -format “‘%B %d, %Y'”]

          # Note the returned date already has the single quotes around it

          Then just insert the $fmtDt

        • #58865
          Kannan Varadharajan
          Participant

            Thank you so much.

            Regards

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.