how to get sys_guid from oracle into c#
hi ..
i have source file with columns name with dt_str size 64,
data_uid1 dt_str values given below
name data_uid1
--------------------
sai
ram
i wanted assign sys_guid oracle into c# to data_uid1 column
for have used ssis package script component
with code
row.name1 = row.name
oracleconnection
con;
con=
new oracleconnection("data source=wild;user id=log;password=pas");con.open();
cmd =
new oraclecommand(" select sys_guid() dual ", con);dr = cmd.executereader();
while (dr.read())
{
row.datauid1 = dr[0].tostring();
}
the output getting this
name1 data_uid1
ram system.byte[]
sai system.byte[]
how correct guid value into data_uid1 column
karteek
oraclecommand cmd;
as calling sys_guid() returns raw byte[].
so try
rawtohex(user_guid) function
convert raw bytes[] hexadecimal
update following statementcmd =
new oraclecommand(" selectrawtohex
(sys_guid()) dual ", con);
my blogs
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment