Oracle Problems

G

Guest

I have posted a query before on this particular issue but no one had ever heard of this issue, and I find it difficult to swallow as well, but this is what is happening.

When a read an Oracle table and I have a column which has the exact same value in the first row and the second row, the second row part of the row has "garbage" after about 4 characters. So if the first record has the value of "Happy Birthday", the second row will show "Happ\0\0\0".

If I look at this same information using the same query and using Toad to execute my query, all is well both the first and the second record say "Happy Birthday".

This happens for each and every table that I read and it is repeatable without exception.

The column type that I am having problems with is "VarChar2". I am reading the column as follows: String myField = dr.GetString(3). I see there is a method of "GetOracleString(3)" and I have tried this method with the same results.

I am using the "System.Data.OracleClient" namespace, which is the Microsoft version of the drivers. I am accessing an Oracle 8I table (or atleast this is what I am told).

I am thinking of installing the Oracle version of the drivers or using the standard oledb drivers to get around the problem.

Can anyone point me in the right direction on this issue?
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

I would go to http://otn.oracle.com and register. Then, download ODP.NET.
The model is very similar to Microsoft's model, but a bit different on some
items. It plays better with Oracle than the MS OracleClient classes.

I have never seen your problem, however.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
Jim Heavey said:
I have posted a query before on this particular issue but no one had ever
heard of this issue, and I find it difficult to swallow as well, but this is
what is happening.
When a read an Oracle table and I have a column which has the exact same
value in the first row and the second row, the second row part of the row
has "garbage" after about 4 characters. So if the first record has the
value of "Happy Birthday", the second row will show "Happ\0\0\0".
If I look at this same information using the same query and using Toad to
execute my query, all is well both the first and the second record say
"Happy Birthday".
This happens for each and every table that I read and it is repeatable without exception.

The column type that I am having problems with is "VarChar2". I am
reading the column as follows: String myField = dr.GetString(3). I see
there is a method of "GetOracleString(3)" and I have tried this method with
the same results.
I am using the "System.Data.OracleClient" namespace, which is the
Microsoft version of the drivers. I am accessing an Oracle 8I table (or
atleast this is what I am told).
I am thinking of installing the Oracle version of the drivers or using the
standard oledb drivers to get around the problem.
 
T

Thomas H

Jim Heavey said:
I have posted a query before on this particular issue but no one had ever
heard of this issue, and I find it difficult to swallow as well, but this is
what is happening.
When a read an Oracle table and I have a column which has the exact same
value in the first row and the second row, the second row part of the row
has "garbage" after about 4 characters. So if the first record has the
value of "Happy Birthday", the second row will show "Happ\0\0\0".
If I look at this same information using the same query and using Toad to
execute my query, all is well both the first and the second record say
"Happy Birthday".
This happens for each and every table that I read and it is repeatable without exception.

The column type that I am having problems with is "VarChar2". I am
reading the column as follows: String myField = dr.GetString(3). I see
there is a method of "GetOracleString(3)" and I have tried this method with
the same results.
I am using the "System.Data.OracleClient" namespace, which is the
Microsoft version of the drivers. I am accessing an Oracle 8I table (or
atleast this is what I am told).
I am thinking of installing the Oracle version of the drivers or using the
standard oledb drivers to get around the problem.
Can anyone point me in the right direction on this issue?

What version of the Oracle Client are you using? Check for any patches that
might have occurred for the Oracle Client. Example; Oracle client version
8.1.7.0.0 has some bugs, latest patch is 8.1.7.4.1- if you don't have access
to Oracle Support/Metalink, I believe the newest version (as opposed to a
Patch) is available for download from otn.oracle.com. You can actually
install the Oracle 9iR2 (release 2) client; Oracle 9i will talk down to 8i,
and up to 10g. Keep in mind that when you enter production, you should be
running the same versions of software that the production servers/platforms
will run.

Two years ago, I wrote a Visual C++ 6 ATL COM object, with OLE DB- there was
a bug in the Oracle Client, where it would not terminate a value returned
from a stored procedure with a null character. I thought my coding was at
fault, and coded up a workaround. A few months later, I found out that it
was an Oracle Client bug, not a Microsoft bug.

Also, for fun, try using a DataSet & DataTable to see what happens.

-Thomas
 
G

Guest

Now I can tell you that using a Dataset does not alter the results, on repeating values for a column, the data on susquent rows is geting populated with junk after the first 3-4-5 characters...
 
T

Thomas H

Jim,

Sorry I didn't see your response earlier; hopefully you'll still check this
message.

At the top, you see something like "SQL*Plus: release 8.1.5.0.0"? If so,
then yes, 8.1.5 is your client version. Since 8.1.5 was not the "terminal"
release for Oracle 8i, I'd definately suspect your 8.1.5 client as being the
culprit.

As for "drivers", you can't download individual drivers. If you don't have
access to metalink.oracle.com, you'll have to uninstall your 8.1.5 client,
and download the new 8.1.7 client from Oracle. Oracle always publishes
their latest patched clients- so you won't be getting the 8.1.7.0.0 client,
you'll be downloading the 8.1.7.4.1 (patched Windows) client.

If you don't require connectivity to Oracle 7.3 (unsupported for a LONG
time), then that's great, because you can download the 9iR2 or 10G client.
Remember you can't just download a driver, you must uninstall the Oracle
Client (use the Oracle Universal Installer from Start/Programs), and then
install the new version. Before you install the client, make sure you read
the release notes & installation PDF for the pre & post installation steps.

-Thomas



Jim Heavey said:
When I go into SQL Plus, it tells my version is 8.1.5.0, so I guess this
must be the version of my client.
Do I have to install an newer version of the client to get the Oracle
drivers? I am not quite sure what to download from Oracle's web site to get
the drivers that I am looking for. I am pretty sure when I made the
selection to download the drivers, I am pretty sure I got the "9" version of
the client. Is this what I should install?
I will try using the DataAdapter and get the data in a dataset and see
what effect this has. I will let you know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top