SQL Server

  • Creator
    Topic
  • #55216
    Cory Cole
    Participant

      Can anybody provide me with the necessary commands to connect to a Sql Server database through Cloverleaf TCL?

    Viewing 4 reply threads
    • Author
      Replies
      • #84596
        Jim Kosloskey
        Participant

          Are you using Data Integrator (I think that is the correct title) which are the DataDirect ODBC drivers?

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #84597
          Cory Cole
          Participant

            I found some commands on line but I get an invalid command error. I want to make sure that I am using the correct commands.

          • #84598
            Peter Heggie
            Participant

              There are ODBC commands, available on UNIX through a separate purchased package from INFOR (or free if on Windows), which Jim is referring to.

              ex:

              package require odbc

              # initialize ODBC environment

              set result [odbc SQLAllocHandle SQL_HANDLE_ENV SQL_NULL_HANDLE henv]

              There are also newer commands to perform table lookups to SQL Server or Oracle in TCL.

              ex:

              set flags [dblookup -metacolumnname patientflags.tbl $ecd $encounter]

              or simply:

              set flag [dblookup “tablex.tbl” “$encounter”]

              Peter

              Peter Heggie

            • #84599
              Cory Cole
              Participant

                We are using Cloverleaf 6.0 and we have SQL Server database.  We have the ODBC drivers loaded. What I need is an example of the connection command and an example of a stored procedure call (insert statement will work.  I can alter it to a stored procedure)

              • #84600
                Jim Kosloskey
                Participant

                  email me and I will send you a proc which calls a Stored Procedure using the ODBC Drivers.

                  Essentially the proc is argument driven and simply connects to the indicated DB and invokes the Stored Procedure presenting the message as an argument to the Stored Procedure. All appropriate error handling vis-

                  email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

              Viewing 4 reply threads
              • The forum ‘Tcl Library’ is closed to new topics and replies.