Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Tom Kyte

Thanks for the question, Vince Crismer.

Asked: December 03, 2000 - 7:26 pm UTC

Last updated: September 08, 2009 - 9:36 am UTC

Version: Oracle 8.0.5 and 8.1.5

Viewed 1000+ times

You Asked

Sir,

Greetings.
I would just like to know what is the current release of the OLEDB Provider for Oracle? Do you have any sample codes for visual basic on how to use this OLEDB Provider for Oracle. Thanks.

- Vince Crismer C. Villena

and Tom said...

See
</code> http://technet.oracle.com/tech/nt/ole_db/ <code>
for all of that information and a discussion board for examples/questions.

Rating

  (8 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

OLEDB Limitation..????

Shailesh Saraff, August 29, 2002 - 3:15 am UTC

Hi Tom,

We are using Oracle Provider for OLEDB from Release 2 (9.2.0.1.0) on Windows 2000/XP. I have taken SQL TRACE of following query. This query accepts 100 ID's. Parses, executes and fetches that many time. Statistics shown below clearly indicates that PARSE had taken 3.35 seconds elapsed time for 100 records. Where as EXCUTE, FETCH takes 0.01, 0.02 seconds elapsed time respectively.

Why parsing takes so much of time? How can we avaoid this?

SELECT Name
FROM
TBLTest WHERE Id = :1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 100 3.16 3.35 0 0 0 0
Execute 100 0.01 0.01 0 0 0 0
Fetch 100 0.02 0.02 0 299 0 99
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 300 3.19 3.38 0 299 0 99

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 19

Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS BY INDEX ROWID TBLTEST
2 INDEX UNIQUE SCAN (object id 4590)

Please guide us.

Thanks & Regards,

Shailesh

Tom Kyte
August 29, 2002 - 7:41 pm UTC

I can only guide you to support to file a performance bug.

I've never ever used OLE as far as I know (sort of impossible on the machines I program) and have never used OLEDB. Not seeing the code you wrote -- I don't know if it is YOUR CODE (eg: I can do the same bad thing in PLSQL, Pro*C, OCI, JDBC if I code it wrong) or if the OLEDB stuff isn't optimal.

Followup

Justin Cave, August 30, 2002 - 4:09 am UTC

If you have a support contract with Oracle, I'd log a TAR on this-- it appears to be a legitimate problem. I believe there's a workaround, however.

The workaround:

Declare a stored procedure, say, get_foo that takes as an IN parameter whatever you're binding (in this case an integer) and returns a REF CURSOR that is the result of your select statement. Replace the text of your SQL statement with "{call get_foo( ? )}" and you should be set.

(potential workaround) I did a experiment along the lines of the one below with Oracle's ODBC driver and verified that it behaves properly (only 1 parse) when a prepared select statement is executed multiple times (I used the ODBCTest sample from the MDAC SDK (url below)). It may be that if you use the Microsoft OLE DB to ODBC provider with the Oracle ODBC driver that you problems go away, but I haven't tested that idea.


My code:
create table foo( col NUMBER );

-- Note that I'm just inserting back into foo rather than returning the results of the select
-- statement like you'd want to do.
create or replace procedure get_foo( value NUMBER )
AS
BEGIN
insert into foo( select * from foo where col = value );
END;
/


What I did:
- Using the "Microsoft OLE DB RowsetViewer", which is one of the sample apps in Microsoft's MDAC SDK <</code> http://www.microsoft.com/data >, <code>I executed row OLE DB API calls with the Oracle OLE DB provider. When I prepared the statement "insert into foo values( ? )" and executed it a series of times with different parameters, tkprof shows that all is well:

insert into foo
values
( :1 )


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 1 1 6 2
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 1 1 6 2

Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer goal: CHOOSE
Parsing user id: 35

If I instead use a select statement, "select * from foo where col = ?", I get the erroneous behavior

select *
from
foo where col = :1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 13 0.00 0.00 0 0 0 0
Execute 6 0.00 0.00 0 0 0 0
Fetch 6 0.00 0.00 0 10 24 10
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 25 0.00 0.00 0 10 24 10

Misses in library cache during parse: 1
Parsing user id: 35

If I change to use a stored procedure that does the selecting, all is well again.

BEGIN get_foo(:1); END;


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 3
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.00 0.00 0 0 0 3

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 35

INSERT INTO FOO SELECT * FROM FOO WHERE COL = :b1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 4 21 56
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.00 0.00 0 4 21 56

Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 35 (recursive depth: 1)


Justin

Note this thread is also ongoing on OTN

Justin Cave, August 30, 2002 - 4:11 am UTC

Mr. Villena also asked this question on OTN. There may be further discussion there.

</code> http://www.oracle.com/forums/message.jsp?id=1264414&gid=763963 <code>

MICROSOFT OLE DB PROVIDER FOR ORACLE ERROR '80004005'

friend, January 28, 2005 - 5:31 pm UTC

MICROSOFT OLE DB PROVIDER FOR ORACLE ERROR '80004005'
whats should be the course of action?


Tom Kyte
January 28, 2005 - 7:28 pm UTC

ask MS what 80004005 means maybe?

if you speak oracle -- I can help you -- if you speak MS error codes, well -- I never see those on my computers so I'm a bit over my head...

MS OLEDB 80004005

Mark A. Williams, January 28, 2005 - 8:00 pm UTC

Here's a thread in regard to this from the OLEDB forums... Perhaps it will help a bit.

</code> http://forums.oracle.com/forums/thread.jsp?forum=148&thread=202015 <code>

HTH,

Mark

Thanks MARK

friend, January 31, 2005 - 12:11 pm UTC

Appreciated

OLEDB Provider

Ranu Shah, July 26, 2005 - 9:07 am UTC

Hi Tom,

I am trying to connect to Oracle 9i database from VB (through the Oracle OLEDB provider)

Can someone tell me the difference between the following two connection strings:

1. "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;UserID=<userid>;Password=<password>;Data Source=<source name>"

2. "Provider=OraOLEDB.Oracle;Persist Security Info=False;UserID=<userid>;Password=<password>;Data Source=<source name>"


Need this info as soon as possible
Thanks in advance.



greetings & one question

sushil, September 08, 2009 - 8:53 am UTC

Dear Sir,

I have an typical requirement. I am using dev.6i forms and i am using long raw datatype to insert object ( word document )inside database using container in forms 6i. I would like to know by any means you can insert the column value for eg. DATE_ENTERED [08-sep-2009] inside the Linked Object on Key-commit.

As per the requirement my users dont want to fill the date during the time of creation of document but on save it should automatically updated the linked object with current date.

Any way around of doing this ?
Tom Kyte
September 08, 2009 - 9:36 am UTC

please use the forums on otn.oracle.com. one obvious database approach would be to use a very small "before insert or update for each row" trigger to set a column to sysdate, simply ":new.last_modified := sysdate;"



I haven't touched forms since 1995 myself.