handling multiple values in ODBC

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf handling multiple values in ODBC

  • Creator
    Topic
  • #52355
    Doug Stelley
    Participant

      seems easy enough but I’m a bit stumped in formatting a statement.

      a nice easy SQL command:

      set docid [sql “SELECT DoctorFacility.ListName FROM

      blah blah

      works fine.

      question is

      how do I retrieve multiple values?

      IF I need to run a SQL like :

      SELECT DoctorFacility.ListName,DoctorFacility.facilityId  ?

      how do I set that up to get them both?

    Viewing 1 reply thread
    • Author
      Replies
      • #73892
        Doug Stelley
        Participant

          Maybe I figured it out (by accident?)

          I think perhaps the result comes back as a TCL list correct?

          so $docid in my for-instance might be simply {“Samual Jones DDS” 24453}

          I’m just talking to myself…

          the first (Listname) could be

          set DrId [lindex $docid 0]

          and the second (FacilityId) could be

          set DrFacId [lindex $docid 1]

          correct?

        • #73893
          Doug Stelley
          Participant

            nah, I was wrong again for those keeping score!

            The result coming back is:

            $docid =

            {{Jones, George} 466}

            so my code needs to be

            set drId [lindex [lindex $docid 0] 0]

            set DrCode [lindex [lindex $docid 0] 1]

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