Search found 64 matches

by kevinherring
Thu 26 Jul 2007 11:12
Forum: dotConnect for Oracle
Topic: default values for parameters?
Replies: 16
Views: 7418

Thanks Alexey, you've been really helpful.

I stuck sys.dbms_describe.describe_procedure into google and came up with this guys blog:
http://mennan.kagitkalem.com/WhereIsDef ... ments.aspx
This was only posted in June, which is why I didnt find it before.

Anyway I settled on the following if anyone is interested:

Code: Select all

SELECT o.NAME, a.procedure$, a.argument, a.default#, a.default$
FROM sys.obj$ o, sys.argument$ a
WHERE o.obj# = a.obj#
and a.procedure$ = 'MY_PROCEDURE'
AND o.NAME like 'MY_PACKAGE'
Unfortunately it doesnt seem that you can actually get the default value, only that it has one. This is good enough for me, but it would be nice if you could get the default value too.

Using the OCI call I mentioned above seemed like a lot of effort and parsing all_source would be slow.....

Thanks again
Kevin
by kevinherring
Wed 25 Jul 2007 13:36
Forum: dotConnect for Oracle
Topic: default values for parameters?
Replies: 16
Views: 7418

ah! I'm with you.

Only being able to use it with OracleCommandBuilder.DeriveParameters seems pretty reasonable. But you are saying that the feature doesnt exists currently though right?

I am writing some oracle code in the meantime that looks at the all_source view and parses it. I will post if for others when it is done.
by kevinherring
Wed 25 Jul 2007 12:52
Forum: dotConnect for Oracle
Topic: default values for parameters?
Replies: 16
Views: 7418

Thanks Alexey, but I'm not quite sure I understand your reply.

Are you saying there is no way this function can be used, or just that there are only specific circumstances where it can be used?
by kevinherring
Tue 24 Jul 2007 11:04
Forum: dotConnect for Oracle
Topic: default values for parameters?
Replies: 16
Views: 7418

Thanks Alexey
by kevinherring
Tue 24 Jul 2007 10:09
Forum: dotConnect for Oracle
Topic: default values for parameters?
Replies: 16
Views: 7418

I forgot all about this, but I am bringing it back from the dead.....
We use software called PL/SQL Developer, and in it optional parameters are indicated as such. So I emailed them and asked them how they did it:

http://www.allroundautomations.com/ubb/ ... 3;t=004092

The answer was that they use the following:

Code: Select all

OCIAttrGet(ParamHandle,            
           OCI_DTYPE_PARAM,           
           HasDefault,           
           Nil,           
           OCI_ATTR_HAS_DEFAULT,           
           ErrorHandle);

Do the Corelab drivers allow me to access this in any way? Could this be an enhancement suggestion if not?

Any other suggestions would be appreciated also....
by kevinherring
Tue 24 Jul 2007 09:49
Forum: dotConnect for Oracle
Topic: corelab vs ms Oracle Drivers
Replies: 10
Views: 4360

Thanks Alexey.
Just to confirm, I am not using the Oracle Long datatype, I am using the .NET Long datatype. I mistakenly assumed that they were the same thing.
by kevinherring
Wed 11 Jul 2007 09:46
Forum: dotConnect for Oracle
Topic: corelab vs ms Oracle Drivers
Replies: 10
Views: 4360

Thanks Alexey.

BTW removing to OraDirect drivers didnt fix my "AccessViolationException: Attempted to read or write protected memory" problem.
by kevinherring
Tue 10 Jul 2007 12:57
Forum: dotConnect for Oracle
Topic: corelab vs ms Oracle Drivers
Replies: 10
Views: 4360

no Alladin, Long in oracle is a very long string (up to 2GB I believe)
by kevinherring
Tue 10 Jul 2007 11:33
Forum: dotConnect for Oracle
Topic: corelab vs ms Oracle Drivers
Replies: 10
Views: 4360

Thanks Alexey but the most important question remains unanswered.

How come you can pass in an int64 into a parameter you have defined as a Long?
by kevinherring
Tue 10 Jul 2007 09:24
Forum: dotConnect for Oracle
Topic: corelab vs ms Oracle Drivers
Replies: 10
Views: 4360

corelab vs ms Oracle Drivers

Hi
I have been experiencing with an application as I have posted previously (AccessViolationException: Attempted to read or write protected memory)

I have tried everything I can, and the only thing left to do is to remove the OraDirect drivers. Although I am not sure whether this has fixed the problem, I have come across a number of differences between the OraDirect drivers and the built in MS Oracle drivers (with the OracleCommand object).

Firstly with the MS driver the parameters have to be called the same as in the procedure. Doesnt really matter either way but I thought I would mention it.

The MS driver doesnt allow you to set a parameter to Nothing, you have to set it to DBNull.Value. The OraDirect driver does. What happens internally? Does it convert Nothing to DBNull.Value?

The most concerning thing was that the OraDirect drivers seem to allow parameter values that are not of the type you specified them as. For example I realised that some old code was specifying a parameter as a Long and then I was passing in an Int64. This goes back to my old days when I thought that an Oracle Long was a number as opposed to a long string. I know my code was wrong, but I am amazed the drivers allowed it! Also the same happened with Dates/Varchars and int32/numbers.

Shouldn't the OracleCommand object be a little stricter?

Incidentally I notice that version 4 requires 'out' cursors to have their direction specified as output, whereas version 3 doesnt seem to care.

Thanks
Kevin
by kevinherring
Wed 06 Jun 2007 11:09
Forum: dotConnect for Oracle
Topic: how can I find out which Oracle Home the connection is using?
Replies: 3
Views: 2568

oops, didnt see that one hiding in there! Thanks Alexey, that's great.
by kevinherring
Wed 06 Jun 2007 10:35
Forum: dotConnect for Oracle
Topic: how can I find out which Oracle Home the connection is using?
Replies: 3
Views: 2568

how can I find out which Oracle Home the connection is using?

Hi
As the subject states, I am trying to confirm which Oracle Home the driver is using at run-time.
I can itterate through OracleHomes ok, and print the available ones out.
There is also the OracleConnection.Home property but this is blank, which the documentation says means the default is being used. How can I find out what the default is?

I have no ORACLE_HOME environment variable on my machine; the path to my home is hard coded into the 'path' system variable.

Thanks
Kevin
by kevinherring
Mon 04 Jun 2007 11:58
Forum: dotConnect for Oracle
Topic: Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory
Replies: 5
Views: 3337

yes of course, I am having a similar problem as I cant reproduce it on our developer or test machines. Just wondered if you had seen anything like it before.
by kevinherring
Mon 04 Jun 2007 08:58
Forum: dotConnect for Oracle
Topic: Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory
Replies: 5
Views: 3337

its hard to tell, and not consistant, but it seems to happen when populating a dataset or using a reader.

However it isnt an exception that I can catch.
by kevinherring
Thu 10 May 2007 14:53
Forum: dotConnect for Oracle
Topic: Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory
Replies: 5
Views: 3337

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory

Hi

I am getting the following exception:
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at OciDynamicType.nativea(HandleRef , Int32 )
at OciDynamicType.a(HandleRef , Int32 )
at CoreLab.Oracle.at.a()
at CoreLab.Oracle.a6.q()
at CoreLab.Oracle.OracleCursor.Finalize()

However, the exception only occurs on a select few clients machines, and it happens at seemly random intervals. The only thing that I can establish is that the longer my program is in use, the more likely it is to happen. We are using version 3.55.19 of the .net 2.0 driver. I am using connection pooling and threading but I have checked my code and I am cleaning up after myself properly. The only thing that I can think is that the clients that are getting the crash have 8.1 oracle clients set as default, which I am in the process of getting upgraded. They are connecting to a 9.2 database.

It would appear from google that other people have had this exception but there doesnt seem to be any definitive answer to it. Some people seem to have had the problem with the official oracle drivers.

I am at a bit of a loss, so I was wondering if you had ever seen it before?

Thanks
Kevin