Updating a Long VarChar field

Ask a Question related to Informix, Design and Development.

  1. #1

    Default Updating a Long VarChar field

    Hi,
    I'm having problems to update a LONG VARCHAR field.
    Suppose I have a table with two fields (the key field named TheKey, and a
    long varchar field, named LongVarChar)

    I use this sql sentence for updation: UPDATE TEST SET LongVarChar='Test'
    but I get the following message:

    java.sql.SQLException: A blob data type must be supplied within this
    context.
    at com/informix/jdbc/IfxSqli.errorDone (IfxSqli.java)
    at com/informix/jdbc/IfxSqli.receiveError (IfxSqli.java)
    at com/informix/jdbc/IfxSqli.receiveMessage (IfxSqli.java)
    ...
    ...

    Is there any way to do this update. I have tried to update in a row-by-row
    basis, and it seems to work, but I want to update all the rows at once.
    Am I missing something ? Any hints would be appreciated.

    Regards,
    G. Brown




    Gustavo Brown Guest

  2. Similar Questions and Discussions

    1. #25544 [Ver->Bgs]: Only 255 characters returned from varchar field
      ID: 25544 Updated by: abies@php.net Reported By: snick at getart dot ru -Status: Verified +Status: ...
    2. #25544 [Bgs->Opn]: Only 255 characters returned from varchar field
      ID: 25544 Updated by: abies@php.net Reported By: snick at getart dot ru -Status: Bogus +Status: Open...
    3. #25544 [Opn->Bgs]: Only 255 characters returned from varchar field
      ID: 25544 Updated by: iliaa@php.net Reported By: snick at getart dot ru -Status: Open +Status: Bogus...
    4. #25544 [NEW]: Only 255 characters returned from varchar field
      From: snick at getart dot ru Operating system: Windows 2003 Server PHP version: 4.3.2 PHP Bug Type: MSSQL related Bug...
    5. Varchar (8000)...long XML String??
      Hello, I have get a XML String that has 30,000 characters in a SQL SP. How can I do that taking under consideration that I can't use a text...
  3. #2

    Default Re: Updating a Long VarChar field

    When I said 'LONG VARCHAR' field I really meant 'TEXT field', i.e. the field
    I am having trouble to update is a TEXT field.

    Regards,
    G.Brown



    "Gustavo Brown" <alegusTakeOffThisAndThisadinet.com.uy@QuitThisToo .Now>
    wrote in message news:bh8obm$m9$1@newsreader.mailgate.org...
    > Hi,
    > I'm having problems to update a LONG VARCHAR field.
    > Suppose I have a table with two fields (the key field named TheKey, and a
    > long varchar field, named LongVarChar)
    >
    > I use this sql sentence for updation: UPDATE TEST SET
    LongVarChar='Test'
    > but I get the following message:
    >
    > java.sql.SQLException: A blob data type must be supplied within this
    > context.
    > at com/informix/jdbc/IfxSqli.errorDone (IfxSqli.java)
    > at com/informix/jdbc/IfxSqli.receiveError (IfxSqli.java)
    > at com/informix/jdbc/IfxSqli.receiveMessage (IfxSqli.java)
    > ...
    > ...
    >
    > Is there any way to do this update. I have tried to update in a row-by-row
    > basis, and it seems to work, but I want to update all the rows at once.
    > Am I missing something ? Any hints would be appreciated.
    >
    > Regards,
    > G. Brown












    Gustavo Brown Guest

  4. #3

    Default Re: Updating a Long VarChar field

    Gustavo Brown wrote:
    > When I said 'LONG VARCHAR' field I really meant 'TEXT field', i.e. the field
    > I am having trouble to update is a TEXT field.

    That's a big difference!

    Fundamentally, there are no blob (BYTE or TEXT - or BLOB or CLOB)
    literals. That is a pain (big pain), but so. It means your only
    chance of getting it to work is to replace the SQL with:

    UPDATE Test SET TextColumn = ?

    You then have to supply the value of the TEXT column when you execute
    the statement. You probably have to set it up, too. And at that
    point, my limited knowledge of JDBC shows -- I don't know what the
    steps are to create a BYTE or TEXT host variable are in Java/JDBC.
    > Gustavo Brown wrote:
    >> I'm having problems to update a LONG VARCHAR field.
    >>Suppose I have a table with two fields (the key field named TheKey, and a
    >>long varchar field, named LongVarChar)
    >>
    >>I use this sql sentence for updation: UPDATE TEST SET
    >
    > LongVarChar='Test'
    >
    >>but I get the following message:
    >>
    >>java.sql.SQLException: A blob data type must be supplied within this
    >>context.
    >> at com/informix/jdbc/IfxSqli.errorDone (IfxSqli.java)
    >> at com/informix/jdbc/IfxSqli.receiveError (IfxSqli.java)
    >> at com/informix/jdbc/IfxSqli.receiveMessage (IfxSqli.java)
    >> ...
    >> ...
    >>
    >>Is there any way to do this update. I have tried to update in a row-by-row
    >>basis, and it seems to work, but I want to update all the rows at once.
    >>Am I missing something ? Any hints would be appreciated.


    --
    Jonathan Leffler #include <disclaimer.h>
    Email: [email]jleffler@earthlink.net[/email], [email]jleffler@us.ibm.com[/email]
    Guardian of DBD::Informix v2003.04 -- [url]http://dbi.perl.org/[/url]

    Jonathan Leffler Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139