Loading ...
Sorry, an error occurred while loading the content.

FW: Re: How to set the length of column when creating the tables?

Expand Messages
  • alx@whoever.com
    Just thought people would be interested in an update, I tried to implement this to no evail, against MS Access 2000. Continued to run into the same error,
    Message 1 of 4 , Oct 15, 2001
    • 0 Attachment
      Just thought people would be interested in an update, I tried to
      implement this to no evail, against MS Access 2000. Continued to run
      into the same error, then I check the type that was being returned,
      and it turned out to be VARCHAR and never LONGVARCHAR type. Also the
      p.setAsciiStream had 2 hardcoded for the index, and it should have
      been the variable number.


      > case Types.CHAR:
      > case Types.VARCHAR:
      > p.setString(number, value);
      > break;
      >
      > case Types.LONGVARCHAR:
      > ByteArrayInputStream inputStream = new
      > ByteArrayInputStream(value.getBytes());
      > p.setAsciiStream(2, inputStream, value.length());
      > break;

      to

      case Types.CHAR:
      case Types.VARCHAR:
      case Types.LONGVARCHAR:
      ByteArrayInputStream inputStream = new
      ByteArrayInputStream(value.getBytes());
      p.setAsciiStream(number, inputStream, value.length());
      break;


      The tables require MEMO fields instead of TEXT fields, which are the
      default statements generated by the package for creating tables. You
      need to make sure your create Table statements are creating MEMO
      fields instead of the Text fields (255 limitation). A simple
      substitution in the statement before executing it to create the
      tables is sufficient.

      Thought this might be useful to others.

      Alex
    • Ronald Bourret
      Thanks for the update and the fix. For those of you who don t know, this is in reply to: http://groups.yahoo.com/group/xml-dbms/message/518 -- Ron ... --
      Message 2 of 4 , Oct 15, 2001
      • 0 Attachment
        Thanks for the update and the fix. For those of you who don't know, this
        is in reply to:

        http://groups.yahoo.com/group/xml-dbms/message/518

        -- Ron

        alx@... wrote:
        >
        > Just thought people would be interested in an update, I tried to
        > implement this to no evail, against MS Access 2000. Continued to run
        > into the same error, then I check the type that was being returned,
        > and it turned out to be VARCHAR and never LONGVARCHAR type. Also the
        > p.setAsciiStream had 2 hardcoded for the index, and it should have
        > been the variable number.
        >
        >
        > > case Types.CHAR:
        > > case Types.VARCHAR:
        > > p.setString(number, value);
        > > break;
        > >
        > > case Types.LONGVARCHAR:
        > > ByteArrayInputStream inputStream = new
        > > ByteArrayInputStream(value.getBytes());
        > > p.setAsciiStream(2, inputStream, value.length());
        > > break;
        >
        > to
        >
        > case Types.CHAR:
        > case Types.VARCHAR:
        > case Types.LONGVARCHAR:
        > ByteArrayInputStream inputStream = new
        > ByteArrayInputStream(value.getBytes());
        > p.setAsciiStream(number, inputStream, value.length());
        > break;
        >
        > The tables require MEMO fields instead of TEXT fields, which are the
        > default statements generated by the package for creating tables. You
        > need to make sure your create Table statements are creating MEMO
        > fields instead of the Text fields (255 limitation). A simple
        > substitution in the statement before executing it to create the
        > tables is sufficient.
        >
        > Thought this might be useful to others.
        >
        > Alex
        >
        >
        > To post a message, send it to: xml-dbms@yahoogroups.com
        > To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
        > Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-dbms
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

        --
        Ronald Bourret
        Programming, Writing, and Training
        XML, Databases, and Schemas
        http://www.rpbourret.com
      Your message has been successfully submitted and would be delivered to recipients shortly.