How to pass GUID as OracleParameter

S

sjoshi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top