473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Patience for a Oracle Noobie

Hi, I am a SQL Server programmer using Oracle for the first time.

In our .NET client apps which use a SQL Server back end, we would use Stored
Procedure exclusively for all database access for increased security as well
as the pre-compiled advantage.

To minimize trips to the db server, we would often call SPs that return more
than one recordset. For example:

CREATE Stored Procedure HelloWorld As
BEGIN
SELECT * FROM HELLO
SELECT * FROM WORLD
END

Using ADO.NET, the results would be returned as 2 tables within a dataset
object.

We are using Oracle 10g with version 10.2 ODP.NET (data provider) on the
client. Is there a *PRODUCTION* version of software available which allows
me to do this simple task?

If Multiple returned Recordsets are not an option in Oracle SPs, can someone
please show me the latest and greatest (excluding beta software) for writing
a baby Oracle SP to return a query result for use by a client app? I am
found one example that utilizes TYPEs and CURSORs and it looks ugly as hell
and surprisingly complicated for what it is doing and involves looping
through a cursor and populating what looks like an array of TYPES which are
defined as output params. Please tell me that there is a better way of doing
this in Oracle.

We could construct the query as a string on the client but I would really
like to put the DB access in the database as compiled queries.

It would be great if someone could write the Oracle equivalent of the 5 line
SQL Server proc above for me, it would help a lot. If two returned queries
is too much for it, a one query example would still be useful.

Thanks
May 13 '06 #1
1 4339

"Chad" <ch*************@comcast.netnet> wrote in message
news:Nc********************@comcast.com...
Hi, I am a SQL Server programmer using Oracle for the first time.

In our .NET client apps which use a SQL Server back end, we would use Stored Procedure exclusively for all database access for increased security as well as the pre-compiled advantage.

To minimize trips to the db server, we would often call SPs that return more than one recordset. For example:

CREATE Stored Procedure HelloWorld As
BEGIN
SELECT * FROM HELLO
SELECT * FROM WORLD
END

Using ADO.NET, the results would be returned as 2 tables within a dataset
object.

We are using Oracle 10g with version 10.2 ODP.NET (data provider) on the
client. Is there a *PRODUCTION* version of software available which allows
me to do this simple task?

If Multiple returned Recordsets are not an option in Oracle SPs, can someone please show me the latest and greatest (excluding beta software) for writing a baby Oracle SP to return a query result for use by a client app? I am
found one example that utilizes TYPEs and CURSORs and it looks ugly as hell and surprisingly complicated for what it is doing and involves looping
through a cursor and populating what looks like an array of TYPES which are defined as output params. Please tell me that there is a better way of doing this in Oracle.

We could construct the query as a string on the client but I would really
like to put the DB access in the database as compiled queries.

It would be great if someone could write the Oracle equivalent of the 5 line SQL Server proc above for me, it would help a lot. If two returned queries
is too much for it, a one query example would still be useful.

Thanks


Hi,
Oracle!=SQLServer. They are two very different products. In Oracle you
don't have to use a stored procedure to get the advantage of "compiled" SQL.
(the explain plan) You do have to use bind variables and that is a good
practice in any RDBMs to get reuse of the execution plan.

That said it is a good idea to use stored procedures for what you are trying
to do. In your case you can use ref cursors as out parameters. You should
also use packages. asktom.oracle.com has some great examples:
http://asktom.oracle.com/pls/ask/f?p...10369303150185

The select statement gets returned into a ref cursor. If you want to return
two sets then return each one into a ref cursor. (thus you would have 2 out
parameters.)

Don't construct a string on the client even with stored procedures. Use
bind variables and call the stored procedures with bind variables. You will
get better scaling and better performance.
Jim
May 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jan Bols | last post by:
I've been trying to install Oracle 8.1.7 on a fresh Mandrake 9.1 O.S for days, but I'm still not able to get it running. I've tried several install instructions that I found on the internet but no...
4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
2
by: osgnamah | last post by:
Hi All; I am getting ready to launch a shareware program in the next few weeks and the last step is going to be creating a website. So the last few days I've been doing some web surfing in...
6
by: Aristotelis E. Charalampakis | last post by:
Hi all, this is a newbie question :-) I was wondering if there was a way to use the switch statement in a manner that each case statement includes more that a simple value. i.e.: switch (...
63
by: Nick Palmer | last post by:
Hi all, Is there a DB2 equivilant to Oracle's DB Link functionality ? I have two DB2 databases and I need to get access to the tables in one from the other. In Oracle I would just create a DB...
2
by: Ruslan A Dautkhanov | last post by:
Hello ! I'm about to install O9i on FreeBSD box. uname -a: FreeBSD stat2.scn.ru 5.2.1-RELEASE-p3 FreeBSD 5.2.1-RELEASE-p3 #2: Fri Apr 23 19:19:43 KRAST 2004...
1
by: Chad | last post by:
Hi, I am a SQL Server programmer using Oracle for the first time. In our .NET client apps which use a SQL Server back end, we would use Stored Procedure exclusively for all database access for...
0
by: Jack | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: Winder | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.