Strange Record Set behavior

Results 1 to 4 of 4

Thread: Strange Record Set behavior

  1. #1
    Bruce newcomer Guest

    Default Strange Record Set behavior

    I have a situation that is so bizzare that it is hard to explain, but here goes.<BR> I ussue an SQL SELECT that should return 2 columns that I will call col1 and col2"<BR> SELECT col1, col2 FROM table where .........<BR> The where is very straight forward and involves only columns from the table and variables passed to the asp script.(No joins or anything like that.)<BR> It should(and does) return 1 row.<BR> I then use Response.Write to display the contents of the 2 columns.<BR> Response.Write "Column 1 = " & RS("col1") & "<BR>"<BR> Response.Write "Column 2 = " & RS("col2") & "<BR>"<BR> It should display:<BR> Column 1 = OTHER<BR> Column 2 = abc 1234567890 defg 5-13-99 hijklmn<BR><BR> Column 1 displays correctly.<BR> Column 2 displays nothing(null string)<BR><BR> Now for the bizzare part, if I do a second RS("col2"), either <BR>by doing another Response.Write or col2contents = RS("col2")<BR>I get 3-99 hijklmn returned. This is the last 12 characters of what I should have get back the first time.<BR> Understand, I don&#039t mean that I MoveNext to the next record in the record set(there isn&#039t any), I just mean I touch it again.<BR>If I touch it a third time, I get a null string.<BR> I can do col1contents = RS("col1") repeatedly and just keep getting back the correct contents(OTHER).<BR> This is an Oracle DataBase. I have many other web pages doing queries on this same DataBase although this is the first time with this particular table.<BR> Any ideas, I have run out.<BR> Bruce Newcomer<BR><BR>

  2. #2
    Bruce Newcomer Guest

    Default RE: Strange Record Set behavior

    I have made an additional discovery.<BR> The column that is acting strangly is a "long" data type. This is potentially 2 gig in Oracle, although in this case it never would be within 1.999 of that.<BR> My guess is that some level of software in the stack is trying to teach me a lesson.<BR> When I discovered that it was a long, I tried to limit the returned data by several Oracle functions(RTRIM, SUBSTR and T_CHAR) but got:<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>ORA-00932: inconsistent datatypes <BR><BR> It now seems that this is more of a database problem, but if you have any suggestions I would appreciate it.<BR> Bruce<BR><BR>

  3. #3
    Bruce Newcomer Guest

    Default RE: Strange Record Set behavior

    I have made another discovery. By testing with other rows that have different data in the column in question I found that as I touch the Record Set column, it seems to index through it in 23 byte chunks. It returns null strings for every full 23 byte chunk and then returns actual data for the less than 23 byte end of the data. For example if the column contains a 50 char. string, the first 2 Response.Write RS("col2") returns nulls and the third returns the last 4 chars. of the data.<BR> My next investigation will be to find another DB table with a LONG type column and see if it exhibits the same behavior. I am getting past thinking I will get a solution and getting to the obcession stage.<BR> Bruce

  4. #4
    Branavank Guest

    Default RE: Strange Record Set behavior

    I don&#039t know if this applys to your case, but i have had problems in sql 6.5 (haven&#039t used 7 yet) with text feilds. When you get a record set with text feilds in the columns, you have to display the records in the same order as are ordered in the database. Like if the name feild comes after the date feild then you have to access the date feild first before you access the name feild from the record set. I think this was a bug in the sql6.5.

Posting Permissions

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