Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to pass System.GUID as Parameter

531162Sep 1 2006 — edited Sep 1 2006
Hello all

I'm passing a GUID as an Oracle Parameter using this :

sqlParm = new OracleParameter();
sqlParm.ParameterName = prm.ParamName;
sqlParm.OracleDbType = OracleDbType.RAW
sqlParm.Direction = prm.ParamDirection;
sqlParm.Size = 16;
sqlParm.Value = ((Guid)prm.ParamValue).ToByteArray();

cmd.Parameters.Add(sqlParm)

The Guid.ToString() is 32750000-0000-0000-0400-1f262144bf86

In SQLPlus I however see this as 000075320000000004001F262144BF86

When the code reaches the cmd.ExecuteReader() I get an exception saying "OracleCommand.CommandText is invalid"

The sql sent at this stage is

Select Distinct(prj.Name) as PrjName, prj.oid as PrjOid
From ERLS.PRJMGTProjectRoot prj, ERLS.CORERELATIONDEST ic, ERLS.PRJMGTDatabase pd
Where prj.oid=ic.oidTarget And ic.oid=pd.oid And pd.oid= :plant_oid

Is there something else I need to do when I pass a GUID as parameter. ?

thanks
Sunit
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2006
Added on Sep 1 2006
1 comment
5,155 views