Problem reading a blob field in oracle (no, just converting it)

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Problem reading a blob field in oracle (no, just converting it)

    Hi,
    I read a blob field from oracle using the
    recordser("FIELD").GetChunk....... I get the good value out of it. The
    problem is that this data must be used as text, so I want to convert it, but
    I always get a Type mismatch (I tought there was no types in asp) Here is
    the code I use to convert it, it fails on line 10:

    Public Sub ConvertBytesToString(ByRef abBytes(), ByRef strString)
    Dim lCpt
    Dim bTempChar
    Dim NbChars

    NbChars = UBound(abBytes) +1
    strString = ""
    For lCpt = 0 To NbChars - 1
    ' It fails right after this line.
    bTempChar = chr(abBytes(lCpt))

    'Do not convert chr(0) if it's the last char
    If (abBytes(lCpt) = 0) And (lCpt = (NbChars - 1)) Then
    'Do Nothing
    Else
    strString = strString & CStr(bTempChar)
    End If
    Next 'lCpt
    End Sub

    Can someone point me what is wrong and what could be a solution?

    thanks

    ThunderMusic


    ThunderMusic Guest

  2. Similar Questions and Discussions

    1. How to Display A Stored TIF Blob field in SQL Server
      Does anybody know how to display a TIF blob field in SQL Server? :confused;
    2. insert blob in oracle (CF_SQL_BLOB) not working
      I've the following code that is supposed to upload an image as a BLOB in the oracle 9i db (I am using cf mx 7) <cffile action='readbinary'...
    3. Setting the value of an Informix v7.3 BLOB field using ADO, VFP and OLEDB
      Hi everyone, I'm trying to replace an Informix v7.3 BLOB field in an existing record with a .PDF file and it's giving me fits! I've adapted the...
    4. PHP + Firebird problem with blob field size
      Hello people, First: sorry my weak english. I´m brazilian. I have the fallow blob field in my database: CREATE DOMAIN DM_TEXT AS BLOB SUB_TYPE 1...
    5. How to Insert documents to a BLOB field
      Hi, I have an Access Front-End application and an Oracle Back-End for my tables. I have a BLOB field in one of the tables. I use Access form to...
  3. #2

    Default Re: Problem reading a blob field in oracle (no, just converting it)

    On what line?

    "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    news:ekInfUmYDHA.1644@TK2MSFTNGP10.phx.gbl...
    >> I always get a Type mismatch

    Ray at Guest

  4. #3

    Default Re: Problem reading a blob field in oracle (no, just converting it)

    come on, read the code, it's written. it fails on bTempChar =
    chr(abBytes(lCpt))

    Public Sub ConvertBytesToString(ByRef abBytes(), ByRef strString)
    Dim lCpt
    Dim bTempChar
    Dim NbChars

    NbChars = UBound(abBytes) +1
    strString = ""
    For lCpt = 0 To NbChars - 1
    ' It fails right after this line.
    bTempChar = chr(abBytes(lCpt))

    'Do not convert chr(0) if it's the last char
    If (abBytes(lCpt) = 0) And (lCpt = (NbChars - 1)) Then
    'Do Nothing
    Else
    strString = strString & CStr(bTempChar)
    End If
    Next 'lCpt
    End Sub

    thanks

    ThunderMusic

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:OYDrk%23mYDHA.1680@tk2msftngp13.phx.gbl...
    > On what line?
    >
    > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > news:ekInfUmYDHA.1644@TK2MSFTNGP10.phx.gbl...
    > >> I always get a Type mismatch
    >
    >

    ThunderMusic Guest

  5. #4

    Default Re: Problem reading a blob field in oracle (no, just converting it)

    oh oh... the problem is bigger than I thought. event if I do this, it
    fails:

    dim value
    value = abBytes(lcpt) 'It fails on this line with a type mismatch

    Would it be possible that the array is just not passed at all in parameter?
    Would there be another way to pass it?

    thanks

    ThunderMusic


    "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    news:%23ZGuErnYDHA.1748@TK2MSFTNGP12.phx.gbl...
    > ok, I get a type mismatch anyway. I remarked all the lines within the for
    > and put your line and I get a type mismatch on your line. if I replace
    your
    > line by response.write(lcpt), I get the lcpt values (that's ok), so the
    > length of my thing is not 0. technically the values it should get from the
    > db is "8987 MB" that's what is contained into the abBytes (as a string
    > converted to blob, then read by GetChunk).
    >
    > What's happening with that? because when I try to read it in VB, with
    > exactly the same sub as the first one posted, it shows perfectly. but not
    in
    > asp (probably due to the fact that there is not types).
    >
    > thanks, any other solution?
    >
    > ThunderMusic
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:ut$7RinYDHA.2236@TK2MSFTNGP10.phx.gbl...
    > > Does your abBytes array contain any non-numeric values? See the line I
    > > added below:
    > >
    > > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > > news:eSJ0yBnYDHA.2464@TK2MSFTNGP09.phx.gbl...
    > > > come on, read the code, it's written. it fails on bTempChar =
    > > > chr(abBytes(lCpt))
    > > >
    > > > Public Sub ConvertBytesToString(ByRef abBytes(), ByRef strString)
    > > > Dim lCpt
    > > > Dim bTempChar
    > > > Dim NbChars
    > > >
    > > > NbChars = UBound(abBytes) +1
    > > > strString = ""
    > > > For lCpt = 0 To NbChars - 1
    > > > ' It fails right after this line.
    > > RESPONSE.WRITE ABBYTES(LCPT) & " - "
    > > > bTempChar = chr(abBytes(lCpt))
    > > >
    > > > 'Do not convert chr(0) if it's the last char
    > > > If (abBytes(lCpt) = 0) And (lCpt = (NbChars - 1)) Then
    > > > 'Do Nothing
    > > > Else
    > > > strString = strString & CStr(bTempChar)
    > > > End If
    > > > Next 'lCpt
    > > > End Sub
    > > >
    > > > thanks
    > > >
    > > > ThunderMusic
    > > >
    > > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
    message
    > > > news:OYDrk%23mYDHA.1680@tk2msftngp13.phx.gbl...
    > > > > On what line?
    > > > >
    > > > > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > > > > news:ekInfUmYDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > > > >> I always get a Type mismatch
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    ThunderMusic Guest

  6. #5

    Default Re: Problem reading a blob field in oracle (no, just converting it)

    abBytes is supposed to be an array. So, is it actually equivalent to
    Array("8","9","8","7"," ","M","B")?

    If so, you will get a type mismatch when you try to do chr on " ".

    What does this code do?

    Public Sub TEST(ByRef abBytes(), ByRef strString)
    Dim lCpt
    Dim bTempChar
    Dim NbChars

    NbChars = UBound(abBytes) +1
    strString = ""
    For lCpt = 0 To NbChars - 1
    RESPONSE.WRITE ABBYTES(LCPT) & "<BR>"
    Next 'lCpt
    End Sub


    If you get a type mismatch on that, something's up with your array. BTW,
    why are you using ByRef on the array?

    Ray at work





    "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    news:%23ZGuErnYDHA.1748@TK2MSFTNGP12.phx.gbl...
    > ok, I get a type mismatch anyway. I remarked all the lines within the for
    > and put your line and I get a type mismatch on your line. if I replace
    your
    > line by response.write(lcpt), I get the lcpt values (that's ok), so the
    > length of my thing is not 0. technically the values it should get from the
    > db is "8987 MB" that's what is contained into the abBytes (as a string
    > converted to blob, then read by GetChunk).
    >
    > What's happening with that? because when I try to read it in VB, with
    > exactly the same sub as the first one posted, it shows perfectly. but not
    in
    > asp (probably due to the fact that there is not types).
    >
    > thanks, any other solution?
    >
    > ThunderMusic
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:ut$7RinYDHA.2236@TK2MSFTNGP10.phx.gbl...
    > > Does your abBytes array contain any non-numeric values? See the line I
    > > added below:
    > >
    > > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > > news:eSJ0yBnYDHA.2464@TK2MSFTNGP09.phx.gbl...
    > > > come on, read the code, it's written. it fails on bTempChar =
    > > > chr(abBytes(lCpt))
    > > >
    > > > Public Sub ConvertBytesToString(ByRef abBytes(), ByRef strString)
    > > > Dim lCpt
    > > > Dim bTempChar
    > > > Dim NbChars
    > > >
    > > > NbChars = UBound(abBytes) +1
    > > > strString = ""
    > > > For lCpt = 0 To NbChars - 1
    > > > ' It fails right after this line.
    > > RESPONSE.WRITE ABBYTES(LCPT) & " - "
    > > > bTempChar = chr(abBytes(lCpt))
    > > >
    > > > 'Do not convert chr(0) if it's the last char
    > > > If (abBytes(lCpt) = 0) And (lCpt = (NbChars - 1)) Then
    > > > 'Do Nothing
    > > > Else
    > > > strString = strString & CStr(bTempChar)
    > > > End If
    > > > Next 'lCpt
    > > > End Sub
    > > >
    > > > thanks
    > > >
    > > > ThunderMusic
    > > >
    > > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
    message
    > > > news:OYDrk%23mYDHA.1680@tk2msftngp13.phx.gbl...
    > > > > On what line?
    > > > >
    > > > > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > > > > news:ekInfUmYDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > > > >> I always get a Type mismatch
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Ray at Guest

  7. #6

    Default Re: Problem reading a blob field in oracle (no, just converting it)

    il semblerait que asp ne le voit pas de cette manière. ce qui est contenu
    dans le blob c'est du binaire (binary large object) donc, 0x38, 0x39, 0x38,
    0x37, 0x20, 0x4D, 0x42 ou encore 38393837204D42. c'est la représentation. Or
    Asp ne semble pas voir que c'est une string puisque même si je fais
    response.write(monrecordset.field("monchampblob") il me donne un type
    mismatch. résultat, j'ai l'impression que c'est impossible d'afficher un
    blob en asp lorsque ce blob contient du texte.

    à ceux qui connaissent bien Oracle, serait-ce t'il plus approprié d'utilise
    un clob plutot qu'un blob?

    merci

    ThunderMusic

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:e$nF$znYDHA.2032@TK2MSFTNGP10.phx.gbl...
    > abBytes is supposed to be an array. So, is it actually equivalent to
    > Array("8","9","8","7"," ","M","B")?
    >
    > If so, you will get a type mismatch when you try to do chr on " ".
    >
    > What does this code do?
    >
    > Public Sub TEST(ByRef abBytes(), ByRef strString)
    > Dim lCpt
    > Dim bTempChar
    > Dim NbChars
    >
    > NbChars = UBound(abBytes) +1
    > strString = ""
    > For lCpt = 0 To NbChars - 1
    > RESPONSE.WRITE ABBYTES(LCPT) & "<BR>"
    > Next 'lCpt
    > End Sub
    >
    >
    > If you get a type mismatch on that, something's up with your array. BTW,
    > why are you using ByRef on the array?
    >
    > Ray at work
    >
    >
    >
    >
    >
    > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > news:%23ZGuErnYDHA.1748@TK2MSFTNGP12.phx.gbl...
    > > ok, I get a type mismatch anyway. I remarked all the lines within the
    for
    > > and put your line and I get a type mismatch on your line. if I replace
    > your
    > > line by response.write(lcpt), I get the lcpt values (that's ok), so the
    > > length of my thing is not 0. technically the values it should get from
    the
    > > db is "8987 MB" that's what is contained into the abBytes (as a string
    > > converted to blob, then read by GetChunk).
    > >
    > > What's happening with that? because when I try to read it in VB, with
    > > exactly the same sub as the first one posted, it shows perfectly. but
    not
    > in
    > > asp (probably due to the fact that there is not types).
    > >
    > > thanks, any other solution?
    > >
    > > ThunderMusic
    > >
    > >
    > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > > news:ut$7RinYDHA.2236@TK2MSFTNGP10.phx.gbl...
    > > > Does your abBytes array contain any non-numeric values? See the line
    I
    > > > added below:
    > > >
    > > > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > > > news:eSJ0yBnYDHA.2464@TK2MSFTNGP09.phx.gbl...
    > > > > come on, read the code, it's written. it fails on bTempChar =
    > > > > chr(abBytes(lCpt))
    > > > >
    > > > > Public Sub ConvertBytesToString(ByRef abBytes(), ByRef strString)
    > > > > Dim lCpt
    > > > > Dim bTempChar
    > > > > Dim NbChars
    > > > >
    > > > > NbChars = UBound(abBytes) +1
    > > > > strString = ""
    > > > > For lCpt = 0 To NbChars - 1
    > > > > ' It fails right after this line.
    > > > RESPONSE.WRITE ABBYTES(LCPT) & " - "
    > > > > bTempChar = chr(abBytes(lCpt))
    > > > >
    > > > > 'Do not convert chr(0) if it's the last char
    > > > > If (abBytes(lCpt) = 0) And (lCpt = (NbChars - 1)) Then
    > > > > 'Do Nothing
    > > > > Else
    > > > > strString = strString & CStr(bTempChar)
    > > > > End If
    > > > > Next 'lCpt
    > > > > End Sub
    > > > >
    > > > > thanks
    > > > >
    > > > > ThunderMusic
    > > > >
    > > > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
    > message
    > > > > news:OYDrk%23mYDHA.1680@tk2msftngp13.phx.gbl...
    > > > > > On what line?
    > > > > >
    > > > > > "ThunderMusic" <NOdlatulippe@teldig.comSPAM> wrote in message
    > > > > > news:ekInfUmYDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > > > > >> I always get a Type mismatch
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    ThunderMusic 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