473,513 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling stored procedures via oracle odbc

I created a stored procedure in oracle with the help of sql +plus:

Set serveroutput on
create or replace procedure spComp(company IN CHAR,oFname OUT CHAR,
oFamname OUT CHAR, oAdr OUT CHAR, oTelno OUT CHAR)

AS

Cursor SelWorkers IS
SELECT
firstname, familyname, address, telno
FROM customers
WHERE company = 'Compname';

cnt NUMBER DEFAULT 1;

BEGIN
DBMS_OUTPUT.PUT_LINE('Employees of Companyname');
DBMS_OUTPUT.PUT_LINE('firstname familyname address telno');
FOR customers IN SelWorkers LOOP
oFname := customers.firstname;
oFamname := customers.familyname;
oAdr := customers.address;
oTelno := customers.telno;
cnt := cnt + 1;
DBMS_OUTPUT.PUT_LINE(customers.firstname||' :
'||customers.familyname||' : '||customers.address||' :
'||customers.telno);
END LOOP;
END spComp;
/

DECLARE
oFname CHAR(15);
oFamname CHAR(15);
oAdr CHAR(20);
oTelno CHAR(7);
BEGIN
spComp('Companyname',oFname,oFamname,oAdr,oTelno);
END;
/
The results were okay.
Now I am trying to call it via odbc.
All about connections were okay.

AnsiString stmt = "CALL
spComp('Companyname',firstname,familyname,address, telno)";
ret = SQLAllocStmt(hDBconn, &hstmt);//locate the statement ok
ret = SQLExecDirect(hstmt, stmt.c_str(), SQL_NTS);

immediately I step in here trying to execute, I get ret delivers -1
is there any tricks I am missing? Also bei Prepare, same problem. If I
just use normal sql-stament, it works fine.
How can I call this procedure well?

I am using C++Builder6 as my developing environment, Oracle9i.

Thanks in advance,
Harp

Nov 12 '05 #1
1 4887
wrong group!!

post your query here

http://groups-beta.google.com/group/....oracle.server

regards,
dotyet

Nov 12 '05 #2

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

Similar topics

1
4354
by: Robert Scheer | last post by:
Hi. I wrote some stored procedures used by a web application. As I am fairly new to Oracle, I am missing some concepts when creating these procedures, as a result, the application is suffering...
11
10714
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept should be the same that the stored procedures...
24
3773
by: Benjamin Doyle | last post by:
In Chip Irek's "A PRIMER ON USING DB2 WITH .NET" (www.15seconds.com), he states that "...ODBC doesn't support DB2 stored procedures. So if you are building an application heavily dependant on...
14
8986
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
5
2626
by: Zlatko Matić | last post by:
Hello. How can I call some functions on MSDE when working in .mdb ? Especially in-line functions which are similar to stored procedures. How can I use MSDE in-line functions as recordsource for...
5
3459
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree, I've run into something I don't understand: Stored...
4
17372
by: eighthman11 | last post by:
I'm calling a stored procedure on a sql server from an access application. I just need the stored procedure to run I do not need any data returned from the stored procedure to my Access...
8
11240
by: colmkav | last post by:
Can someone tell me how I can access the return value of a function called from Oracle as opposed to a store proc from oracle? my oracle function is get_num_dates_varposfile. I am only used to...
14
4570
by: jehugaleahsa | last post by:
Hello: I am working with Oracle .NET Stored Procedures. I would like to know how to return the results of a SELECT statement. I have tried returning a OracleRefCursor and a DataTable, but...
0
7264
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
7166
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7386
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,...
1
7106
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
7534
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
5094
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
4749
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...
0
1601
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 ...
0
459
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...

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.