Announcement

Collapse
No announcement yet.

Database resultset - problem reading field of datatype varchar(max) - erialClob

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Database resultset - problem reading field of datatype varchar(max) - erialClob

    We're calling a sproc on SQL Server 2005 that's returning a resultset with 3 columns: bigint, varchar(20), and varchar(MAX).

    We are keeping hl7 v2 in this varchar(max) field.

    When calling the sproc and reading the results, there's no exception being thrown. When enumerating the resultset:
    Code:
    var hl7v2 = resultSet.getString("HL7");
    but rather a string value being returned, the value is


    Any idea how to get the real value of the field? Calling another method other than getString() maybe?

  • #2
    // Something like the following might work:
    var clob = resultSet.getClob("HL7");
    var clobLength = clob.length();
    var hl7v2 = clob.getSubString(0,clobLength);
    Daniel Svanstedt
    Software Engineer
    Mirth Corporation

    Want professional services, support, and enterprise or virtual appliances? It's all available from the Mirth Corporation:
    Mirth Support | Mirth Training | Mirth Appliances | Online Training | Developer Q&A

    Don't forget, Mirth Support gives you access to all of our online training videos, and silver support gives you access to developer Q&As!

    Comment


    • #3
      Thank you Dans,

      That did it. Though I found that clobs index starting at 1, not 0.

      Cheers,

      Colin

      Comment

      Working...
      X