473,498 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing an oracle table from .NET

2 New Member
have a stored procedure which has a table as one of its "out" parameters. I'm not able to call this procedure from c# .net. please let me know how i can access it. The procedure has been called from vb. I want to move the following code from vb to c#.

VB code
Function ReportTableRetrieved(objReportTable As OraParamArray) As Boolean

Const constArraySize = 100
Dim i As Integer
Dim strSQL As String
Dim strMsg As String
Dim strReportDate As String
Dim strSysDate As String

strReportDate = RetrieveReportDate
strSysDate = gstrSysDate
gdbSLAM.Parameters.Add "report_dt_in", strReportDate, ORAPARM_INPUT
gdbSLAM.Parameters("report_dt_in").serverType = ORATYPE_DATE
gdbSLAM.Parameters.Add "sys_dt_in", strSysDate, ORAPARM_INPUT
gdbSLAM.Parameters("sys_dt_in").serverType = ORATYPE_DATE
gdbSLAM.Parameters.Add "err_msg_out", "", ORAPARM_OUTPUT
gdbSLAM.Parameters("err_msg_out").serverType = ORATYPE_VARCHAR2
gdbSLAM.Parameters.AddTable "report_table", ORAPARM_OUTPUT, ORATYPE_VARCHAR2, constArraySize, 255

strSQL = "Begin MRM.RUN_REPORT(:report_dt_in, "
strSQL = strSQL & " :sys_dt_in, "
strSQL = strSQL & " :report_table, "
strSQL = strSQL & " :err_msg_out); end;"
On Error Resume Next
gdbSLAM.ExecuteSQL (strSQL)
If Err.Number Then
MsgBox Err.Description, vbCritical
Else
Set objReportTable = gdbSLAM.Parameters("report_table")
ReportTableRetrieved = True
End If
For i = 0 To gdbSLAM.Parameters.Count - 1
gdbSLAM.Parameters.Remove 0
Next

End Function


And the stored procedure in oracle
PROCEDURE RUN_REPORT
(
report_dt_in IN DATE,
sys_dt_in IN DATE,
report_table OUT RPT_LINE_OUT,
err_msg_out OUT VARCHAR2
)
IS

BEGIN

l_include_basis := FALSE;
report_dt := report_dt_in;
rl_idx := 0;

-- Determine whether to include data from current or history tables.
IF report_dt_in = sys_dt_in THEN
l_include_current_data := 1;
ELSE
l_include_current_data := 0;
END IF;

INIT_TABLE;
GET_GAPS;
GET_INVEST_DATA;
GET_LOAN_BASIS;
GET_NOTIONAL_TOTALS;
FILL_TABLE;

report_table := rl_tab;

EXCEPTION
WHEN OTHERS THEN
IF l_sblock IS NULL THEN
l_sblock := 'MRM.RUN_REPORT';
errMsg := 'Err info: ' || l_sblock || ': ' || SQLCODE || ': ' || SUBSTR(SQLERRM,11,500);
errs.log('NONE', l_sblock, SQLCODE, SUBSTR(SQLERRM,11,500), l_usr, errMsg);
END IF;
err_msg_out := errMsg;
RAISE;

END RUN_REPORT;
Jul 26 '07 #1
0 1110

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4500
by: naimy | last post by:
Hi, I need to access more that 1 instance, is there a way to start a new connection from a pl/sql script ? eg. inst1 has table I1 inst2 has table I2 I need to query I2 using columns from I1....
1
16130
by: majk | last post by:
hey! Im looking for a db tutoral which covers accessing a Microsoft SQL database on windows. I will be using VC++ if it matters. NO details just a basic introduction! Oracle DB access using...
10
3484
by: Andrea M. Segovia | last post by:
Hello, I am a newbie to Oracle databases.... We have a visualization front-end tool connected to an Oracle back-end database on a Tru64 UNIX server. We also have clients with MS access...
1
9175
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
8
2333
by: berj | last post by:
How difficult is this? I'm having a tough time getting a simple select to work. I am using MS Access 2002 and Windows XP. What do I have to do to make a simple select statement like this...
1
6248
by: lovkeshanand | last post by:
Dear All, I am using the oracle transparent gateway connectivity with sql server using tg4msql,as far as settings are concerned those were set and Connectivity is working Fine, and getting the...
4
1974
by: Mark D Powell | last post by:
We are running SQL Server 2000 SP3. We have linked servers in use that we use to access Oracle tables. Recently the claim has been made that you can access Oracle tables from within SQL Server...
2
4059
by: Mark Brown | last post by:
I'm trying to access an Oracle database vb.net. I found several examples. I tried following each one, but I get the same error no matter what I try. I don't really understand what the error means...
1
1863
by: Bill | last post by:
We have a corporate database that was upgraded to Oracle 10 and I can no longer link to or query a table that contains a Time Stamp field with Access 2003. I've tried the Microsoft ODBC driver and...
2
1292
by: Ken Williams | last post by:
WhenI search Internet there thousands of comments and samples for database conenction and tuning. They are all advanced and comprehesive. I didn't found a simple "Hello World" for accessing an...
0
7125
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
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
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...
1
6887
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
7379
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...
1
4910
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...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.