Using IData Reader

G

Guest

Hi All,

We want to customize a single application to use either with Oracle or
SQL 2000.
So we switched all datareader related queries to IDataReader.However we
faced the following problems.

1.We were unable to use Dataset Or ExecuteScalar with Reader within the
IDataReader.

2.In Oracle empty string is treated as NULL , but in SQL takes as empty
string.
Is there any common way to insert NULL value in both Database Queries
without using More "If conditions"


3.The left outer join syntax in Oracle is different from SQL server.For
example
In Oracle ,outer join is represented as
A.Number(+)=B.Number
But is SQL Server 2000 it should be written as
A.Number=*B.Number

Is there any way to represent it in Common way

4. In Oracle we have used the pipe symbol '||' in some queries to treat a
int value as varchar,IN Sql Server we were unable to use '+' symbol to
convert Int to varchar.
Is there any way to use it without using the 'CAST' keyword


Guhan
 
M

Miha Markic [MVP C#]

Hi,

Guhanath said:
Hi All,

We want to customize a single application to use either with Oracle or
SQL 2000.
So we switched all datareader related queries to IDataReader.However we
faced the following problems.

1.We were unable to use Dataset Or ExecuteScalar with Reader within the
IDataReader.

That's why there are IDataAdapter and IDbCommand interfaces.
2.In Oracle empty string is treated as NULL , but in SQL takes as empty
string.
Is there any common way to insert NULL value in both Database Queries
without using More "If conditions"


3.The left outer join syntax in Oracle is different from SQL server.For
example
In Oracle ,outer join is represented as
A.Number(+)=B.Number
But is SQL Server 2000 it should be written as
A.Number=*B.Number

Is there any way to represent it in Common way

Those are server specific syntaxes.
You should use INNER JOIN, LEFT JOIN, RIGHT JOIN syntax instead.
 
G

Guest

Thanks i will try them.
--
Guhan


Miha Markic said:
Hi,

Guhanath said:
Hi All,

We want to customize a single application to use either with Oracle or
SQL 2000.
So we switched all datareader related queries to IDataReader.However we
faced the following problems.

1.We were unable to use Dataset Or ExecuteScalar with Reader within the
IDataReader.

That's why there are IDataAdapter and IDbCommand interfaces.
2.In Oracle empty string is treated as NULL , but in SQL takes as empty
string.
Is there any common way to insert NULL value in both Database Queries
without using More "If conditions"


3.The left outer join syntax in Oracle is different from SQL server.For
example
In Oracle ,outer join is represented as
A.Number(+)=B.Number
But is SQL Server 2000 it should be written as
A.Number=*B.Number

Is there any way to represent it in Common way

Those are server specific syntaxes.
You should use INNER JOIN, LEFT JOIN, RIGHT JOIN syntax instead.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info
 

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