473,623 Members | 2,693 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 ReportTableRetr ieved(objReport Table 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 = RetrieveReportD ate
strSysDate = gstrSysDate
gdbSLAM.Paramet ers.Add "report_dt_ in", strReportDate, ORAPARM_INPUT
gdbSLAM.Paramet ers("report_dt_ in").serverTy pe = ORATYPE_DATE
gdbSLAM.Paramet ers.Add "sys_dt_in" , strSysDate, ORAPARM_INPUT
gdbSLAM.Paramet ers("sys_dt_in" ).serverType = ORATYPE_DATE
gdbSLAM.Paramet ers.Add "err_msg_ou t", "", ORAPARM_OUTPUT
gdbSLAM.Paramet ers("err_msg_ou t").serverTy pe = ORATYPE_VARCHAR 2
gdbSLAM.Paramet ers.AddTable "report_tab le", ORAPARM_OUTPUT, ORATYPE_VARCHAR 2, 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.Execute SQL (strSQL)
If Err.Number Then
MsgBox Err.Description , vbCritical
Else
Set objReportTable = gdbSLAM.Paramet ers("report_tab le")
ReportTableRetr ieved = True
End If
For i = 0 To gdbSLAM.Paramet ers.Count - 1
gdbSLAM.Paramet ers.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_curre nt_data := 1;
ELSE
l_include_curre nt_data := 0;
END IF;

INIT_TABLE;
GET_GAPS;
GET_INVEST_DATA ;
GET_LOAN_BASIS;
GET_NOTIONAL_TO TALS;
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 1116

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

Similar topics

1
4513
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. It may sound unusual etc.etc.
1
16138
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 C++ is also of interest! Thanks!
10
3517
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 databases who would like to share their data using this visualization tool but do not want to import their data into the Oracle server back-end.
1
9189
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 will work for 9i and even 10g ) No one had what I needed, so I wrote it myself. I Rule. This code isn't going for efficiency, and isn't trying to be dynamic. It doesn't create the table structure in Oracle, that's up to you. (I
8
2357
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 work: select id from emp
1
6258
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 response from that server. here is description what I done as:-There is a View on Sqlserver which is Join of 6 tables and have
4
1985
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 without using a Linked Server. I searched Books Online using keywords: linked, remote, and Oracle and did not find anything. A search of the newsgroup archives found only entries related to using Linked Servers.
2
4068
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 (I've never tried accessing an Oracle database before). The error I get is: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor I installed the oracle dll and added it as reference (I get the same error...
1
1871
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 the Oracle 10 and Oracle 8 Driver. Any ideas as to how to access this data?
2
1303
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 Oracle database. This sample should contain just - connecting to database, - pass an SELECT FROM WHERE statement and - read the result into a CSharp internal table/records.
0
8217
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8661
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8603
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8460
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6104
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4067
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2590
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1467
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.