G
Guest
Hi. I asked this question on another newsgroup, but with no luck..
I'm doing a .Net conversion project. Before, I was using VB6.0 and Oracle for a 3 tier architecture.
An important part of the conversion is moving a large number of Oracle stored procedure to VB.NET; the reason is that they containt too much business logic. This is an example of how a stored procedure looked like:
BEGIN
define cursor 1
define cursor 2
define cursor 3
validate inputs
open cursor 1(with input arguments)
open cursor 2(with input arguments)
if cursor 1 column(x) <> cursor 2 column(y) raise error
open cursor 3(with input and cursor 2 column(y) arguments)
if cursor 3 column(z) is null then insert into some_table
if cursor 3 column(w) is null then set some output variables
set some output variables
END
What is the best way to write this in a VB.NET function/procedure?
Should I use datasets or should I use datareaders?
Should I execute the select statements (the cursors) at the beginning of the function, or should I execute them in the "middle" of the function?
Do I use the same datareader for all the select statements (eg call ExecuteReader on the same datareader with different command object - or maybe the same command object with a different command string)?
Should I use stored procedures for selecting, inserting and deleting from the database instead of doing it from the function?
How do I deal with nulls?
Maybe I'm not asking all the right questions, so I would appreciate, if someone knows a complex example on the internet that is similar to what I'm asking, to share the link.
Thanks.
TibM
I'm doing a .Net conversion project. Before, I was using VB6.0 and Oracle for a 3 tier architecture.
An important part of the conversion is moving a large number of Oracle stored procedure to VB.NET; the reason is that they containt too much business logic. This is an example of how a stored procedure looked like:
BEGIN
define cursor 1
define cursor 2
define cursor 3
validate inputs
open cursor 1(with input arguments)
open cursor 2(with input arguments)
if cursor 1 column(x) <> cursor 2 column(y) raise error
open cursor 3(with input and cursor 2 column(y) arguments)
if cursor 3 column(z) is null then insert into some_table
if cursor 3 column(w) is null then set some output variables
set some output variables
END
What is the best way to write this in a VB.NET function/procedure?
Should I use datasets or should I use datareaders?
Should I execute the select statements (the cursors) at the beginning of the function, or should I execute them in the "middle" of the function?
Do I use the same datareader for all the select statements (eg call ExecuteReader on the same datareader with different command object - or maybe the same command object with a different command string)?
Should I use stored procedures for selecting, inserting and deleting from the database instead of doing it from the function?
How do I deal with nulls?
Maybe I'm not asking all the right questions, so I would appreciate, if someone knows a complex example on the internet that is similar to what I'm asking, to share the link.
Thanks.
TibM