TQuery Float field is implicitly rounded to integer when using ODBC - oracle

I'm querying 1 value from table. In db it's value is 48.8
When my app use BDE's native Oracle SQL Link driver, everything is Ok, it's still 48.8.
Then I make the app to use another BDE alias, which use ODBC data source (latest driver from Oracle). And now displayed value is 48.0
Details
The column is factW NUMBER(10, 3).
Test code:
var
q: TQuery;
begin
q := TQuery.Create( SELF );
try
q.DatabaseName := 'Realize';
q.SQL.Text := 'SELECT factW, TO_CHAR(factW) charW'
+'FROM bSertific WHERE id_sertific = :id';
q.ParamByName('id').AsInteger := dm1.Sertif1ID_SERTIFIC.AsInteger;
q.Open;
ShowMessage( ' factW = '
+ FloatToStrF(
q.FieldByName('factW').AsFloat,
ffFixed,
5, 3 ) // here 48.000
+ ' charW = ' + q.FieldByName('charW').AsString // here 48.8
);
finally
q.Free;
end;
end;

I hadn't find a proper solution. The workaround is to query the field as a string and convert it back and forth on the client side.

Related

ODP.NET, Managed reading LONG column results in ORA-01009

I'm trying to get the source of a view in my .net app.
To do this, I query DBA_VIEWS: it has a column TEXT with exactly what I need. The type is LONG.
If I do it using the Unmanaged driver, everything works as expected.
The same code with Managed driver results in ORA-01009: missing mandatory parameter.
Adding a transaction around the command and using breakpoint and "slow" steps sometimes results in the same code working.
ODP.NET version is 19, Oracle DB is 18c Express Edition. Strangely enough, the same code works just fine with Oracle Database 12c regardless of driver type.
Is there maybe some setting I need to change on the database or in code? I'm completely lost here.
Code I'm using for testing:
Imports System.Data.Common
Imports Oracle.ManagedDataAccess
'Imports Oracle.DataAccess
Module Views
Function CreateCommand(Connection As DbConnection) As System.Data.Common.DbCommand
Dim cmd As Data.Common.DbCommand = Connection.CreateCommand()
With CType(cmd, Client.OracleCommand)
.BindByName = True
.FetchSize = &H100000 '1 Mb
.InitialLONGFetchSize = -1 'the entire LONG or LONG RAW data is prefetched and stored in the fetch array.
.InitialLOBFetchSize = -1 'the entire LOB data is prefetched and stored in the fetch array.
End With
Return cmd
End Function
Sub query()
Try
Using DBConnection = New Client.OracleConnection("User ID=TESTUSER;Password=TESTPWD;Data Source=TESTDB;Pooling=True")
DBConnection.Open()
Using DBConnection.BeginTransaction()
Using cmdSQL = CType(CreateCommand(DBConnection), Client.OracleCommand)
cmdSQL.CommandText = "select TEXT from DBA_VIEWS where VIEW_NAME = :0"
Dim p = cmdSQL.CreateParameter()
p.ParameterName = "0"
p.Value = "TEST_VIEW"
cmdSQL.Parameters.Add(p)
Dim sw = Stopwatch.StartNew
Using rdr = cmdSQL.ExecuteReader
rdr.FetchSize = 2 ^ 20
While rdr.Read
Dim row(rdr.FieldCount - 1) As Object
rdr.GetProviderSpecificValues(row)
Dim x = row(0)
Console.WriteLine($"{x.ToString.Length} bytes")
End While
End Using
Console.WriteLine($"{sw.ElapsedMilliseconds} ms")
End Using
End Using
End Using
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
End Sub
End Module
You can use an anonymous block with output parameter and a call to ExecuteNonQuery. Your command text will be
"begin select TEXT into :0 from DBA_VIEWS where VIEW_NAME = :1; end;"
Add 2 parameters. Make sure that
' Parameter #1 has
p.Direction = ParameterDirection.Output
p.OracleDbType = OracleDbType.Long
p.Size = 1000000
And use command cmd.ExecuteNonQuery(). Then, when parameter is retrieved, just use its value
Dim txt As String = cmd.Parametersp[0].Value.ToString()
It's a pity, Oracle deprecated LONG data type for ages but LONG data is still used many times for internal data.
You could write a function and then get the data by calling the function:
create or replace function GetViewText(v in varchar2) return clob is
ret CLOB;
BEGIN
FOR aRow IN (SELECT TEXT FROM DBA_VIEWS WHERE VIEW_NAME = v) LOOP
ret := aRow.TEXT;
-- or ret := TO_CLOB(aRow.TEXT);
END LOOP;
RETURN ret;
END;
Yet another way from this answer is to (ab)use dbms_xmlgen.getxml.
We can either use it to query a single view's code (as in my original question)
with input as (
select
:0 as VIEW_NAME
from dual
)
SELECT
substr(
text_xml,
instr(text_xml, '<LONGCOL>') + length('<LONGCOL>'),
instr(text_xml, '</LONGCOL>', -1) - (instr(text_xml, '<LONGCOL>') + length('<LONGCOL>'))
) as TEXT
from
(
-- getxml can return malformed xml (which is good in this case)
-- while getxmltype can not.
select dbms_xmlgen.getxml(q'{
SELECT TEXT as LONGCOL
FROM SYS.DBA_VIEWS
WHERE VIEW_NAME = '}' || input.VIEW_NAME || q'{'
}') as text_xml
from input
)
or create our own DBA_VIEWS version.
create or replace view APP_SCHEMA.DBA_VIEWS
as
select
OWNER, VIEW_NAME, TEXT_LENGTH,
case
when (TEXT_VC is not null and TEXT_LENGTH <= 4000)
then to_clob(TEXT_VC)
when TEXT is NULL
then NULL
else (
SELECT
substr(
text_xml,
instr(text_xml, '<LONGCOL>') + length('<LONGCOL>'),
--instr(text_xml, '</LONGCOL>', -1) - (instr(text_xml, '<LONGCOL>') + length('<LONGCOL>'))
TEXT_LENGTH
) as TEXT
from
(
-- getxml can return malformed xml (which is good in this case)
-- while getxmltype can not.
select dbms_xmlgen.getxml(q'{
SELECT TEXT as LONGCOL
FROM SYS.DBA_VIEWS
WHERE OWNER = '}' || OWNER || q'{'
and VIEW_NAME = '}' || VIEW_NAME || q'{'
}') as text_xml
from dual
)
)
end as TEXT,
TEXT_VC, TYPE_TEXT_LENGTH, TYPE_TEXT, OID_TEXT_LENGTH, OID_TEXT, VIEW_TYPE_OWNER, VIEW_TYPE, SUPERVIEW_NAME, EDITIONING_VIEW, READ_ONLY, CONTAINER_DATA, BEQUEATH, ORIGIN_CON_ID, DEFAULT_COLLATION, CONTAINERS_DEFAULT, CONTAINER_MAP, EXTENDED_DATA_LINK, EXTENDED_DATA_LINK_MAP, HAS_SENSITIVE_COLUMN
from sys.dba_views
;

Oracle Spatial : SDO_RELATE returns Polygon that are not inside

I am having an issue with the SDO_RELATE, it is returning the geometries that
are not inside
t.geom is not inside of myGeom() but it is still returning 8 results.
Does anyone have any idea?
The query:
select t.geom from GEOM_TABLE t where SDO_RELATE(t.geom, MDSYS.ST_GEOMETRY( mygeom() ).geom,'mask=INSIDE')= 'TRUE';
the table GEOM_TABLE has 8 GEOM:
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.0869771096384677,51.5024165642481,NULL),NULL,NULL)
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.0858793201373357,51.5028736400019,NULL),NULL,NULL)
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.0859194148542997,51.5026045168702,NULL),NULL,NULL)
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.08585886464887,51.5028197752593,NULL),NULL,NULL)
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.08585886464887,51.5028197752593,NULL),NULL,NULL)
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.0869771096384677,51.5024165642481,NULL),NULL,NULL)
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.0858791695113971,51.5028772345772,NULL),NULL,NULL)
MDSYS.SDO_GEOMETRY(2001,4326,MDSYS.SDO_POINT_TYPE(-0.0859418928233853,51.5026354585244,NULL),NULL,NULL)
The function mygeom() returns a multipolygon:
create or replace FUNCTION mygeom
RETURN SDO_GEOMETRY
AS
sdo_thing SDO_GEOMETRY;
BEGIN
sdo_thing := sdo_geometry('MULTIPOLYGON (((-0.0865288603107932 51.5039564260449, -0.0865060010910315 51.5039483194539, -0.0865141682574544 51.5039391004243, -0.0863253073372686 51.5038727110367, -0.0863124617498804 51.5038869794842, -0.0861795514907842 51.5038402074052, -0.0861346869924903 51.5038139363237, -0.0861936192356698 51.503748622705, -0.085952644781669 51.5036639366557, -0.0859381361413453 51.503680066363, -0.0858665730544053 51.5036547982402, -0.0857786527152011 51.5036038140749, -0.0858085678942227 51.5035707600203, -0.0855573745654051 51.5034823992445, -0.0855562489936357 51.5034817513896, -0.0855144898673776 51.503460476679, -0.0854816214774265 51.5034436635341, -0.0855221133560601 51.5033989120031, -0.0854580732722616 51.5033763742846, -0.0855274309380533 51.5032995408303, -0.0855420337567935 51.5032811645641, -0.0855009965077738 51.5032667359951, -0.085398333387543 51.5032306184033, -0.0854158650244525 51.5032111209312, -0.0855116600641411 51.5031051334827, -0.0855172589057151 51.503098750221, -0.0855484999942321 51.5031096916138, -0.0856632327265146 51.5031500527559, -0.0857510227333684 51.5030528371038, -0.0858171960176657 51.5030760389644, -0.0858605661541136 51.5030279171151, -0.0861706892907778 51.5031369327097, -0.0862031684355457 51.503101132696, -0.0862676908339 51.5030296154548, -0.0863597181173557 51.5029275225779, -0.0865600765882216 51.5029979663451, -0.086777901902547 51.5030745398974, -0.0866356488383303 51.5032302187971, -0.0863604562944733 51.5031334647858, -0.0862507570730499 51.5032549630447, -0.0864188824541957 51.5033140899477, -0.0864641795598904 51.5033300265126, -0.0865275076607135 51.5033523722106, -0.0865625842463539 51.5033646348715, -0.0865635733667962 51.5033651006388, -0.0867131904394105 51.5032125095177, -0.0869205046762469 51.5032854941311, -0.0870304148828612 51.5033240666651, -0.0870314190610705 51.5033241729708, -0.0870459460195229 51.5033075937999, -0.087056389498824 51.5032956241626, -0.0867378739881255 51.5031873732771, -0.0869961007463528 51.5029048122902, -0.0869420693368078 51.5030733511776, -0.0871457009621967 51.503096636268, -0.087287236796925 51.5031128832374, -0.0873377146831273 51.5031186524167, -0.0873088241159957 51.5032167399355, -0.0874407581118753 51.503231751007, -0.0877460537025708 51.5033357377504, -0.0878978480003227 51.5033892006805, -0.0876010933439077 51.5037178967794, -0.0875796551637441 51.5037102631995, -0.087541274963729 51.5037528017192, -0.0874832826670801 51.5037612982195, -0.0873375890289662 51.5037100924754, -0.0873665978138789 51.5036780124315, -0.0873188860315623 51.5036612275065, -0.0872403069325914 51.5037484329227, -0.087335734416622 51.5037819129539, -0.0874311582792707 51.5038154827731, -0.0874110589611976 51.5038378162924, -0.0873156388304757 51.5038041565922, -0.0872200710856096 51.5037705843314, -0.0871112779121759 51.5038911089731, -0.0871521760104861 51.503905444775, -0.0871712110818985 51.5038844428283, -0.0872419301226673 51.5039092467519, -0.0872727648646231 51.5038748584409, -0.0873251646654072 51.5038932485791, -0.0873951713635406 51.5039178609403, -0.0873787009196911 51.5039361170481, -0.0874631918861763 51.5039658215792, -0.0874486836756725 51.5039819514772, -0.087345784810058 51.5040959179464, -0.0872135694017501 51.5042424089491, -0.0867076236586411 51.5040643759442, -0.0866881299671788 51.5040859998153, -0.0866326075158272 51.5040664793368, -0.0865461857038368 51.5040278400461, -0.0865151018581603 51.5040131246071, -0.0865572637661047 51.5039663316798, -0.0865288603107932 51.5039564260449)), ((-0.0875356956274903 51.502805432305955, -0.0875796524044413 51.50266064913526, -0.0875796524047242 51.50266064913432, -0.0875937076629999 51.502614026979536, -0.0875985455101144 51.50259827892592, -0.0875985455103903 51.50259827892503, -0.0876057263963508 51.50257474593212, -0.0877224361428347 51.502588519150784, -0.0877174357167263 51.50260471361209, -0.0877174356972497 51.50260471370696, -0.0877174356964275 51.5026047138038, -0.0877174357142906 51.50260471389898, -0.0877174357501689 51.502604713988944, -0.0877174358027163 51.502604714070294, -0.0877174358699615 51.50260471413999, -0.0877174359493814 51.502604714195414, -0.0877174360379964 51.50260471423449, -0.0877174361324819 51.502604714255746, -0.0878167688166939 51.50261712495759, -0.0877824452897606 51.50272456524463, -0.0877579362979249 51.50272146788525, -0.0877579361990961 51.50272146788261, -0.0877579361016798 51.50272146789947, -0.087757936009485 51.50272146793517, -0.0877579359261164 51.50272146798831, -0.0877579358548333 51.50272146805681, -0.0877579357984226 51.502721468138006, -0.08775793575909 51.50272146822871, -0.0877284344790737 51.502813520862006, -0.0877284344585182 51.50281352095726, -0.0877284344568288 51.50281352105469, -0.0877284344740695 51.5028135211506, -0.0877284345095857 51.50281352124134, -0.0877284345620283 51.502813521323475, -0.0877284346294053 51.50281352139387, -0.0877284347091577 51.502813521449866, -0.0877284347982561 51.50281352148932, -0.0877284348933168 51.50281352151075, -0.0878130053573931 51.50282407290225, -0.0878130054562405 51.50282407290473, -0.0878130055536435 51.50282407288771, -0.0878130056457923 51.50282407285186, -0.0878130057290832 51.50282407279857, -0.0878130058002589 51.50282407272993, -0.0878130058565359 51.50282407264863, -0.0878130058957132 51.50282407255784, -0.0878372259787406 51.50274803051843, -0.0878567746459156 51.50268720009297, -0.0879175512757668 51.502694755562416, -0.0879201274364463 51.50269515718285, -0.087919639251137 51.50269649753589, -0.0879196392447881 51.50269649755444, -0.0879005789247029 51.50275598746124, -0.0879005789041521 51.50275598755652, -0.0879005789024769 51.50275598765398, -0.0879005789197416 51.50275598774991, -0.08790057895529 51.502755987840665, -0.0879005790077712 51.502755987922804, -0.0879005790751907 51.5027559879932, -0.0879005791549865 51.502755988049174, -0.0879005792441261 51.5027559880886, -0.087900579339222 51.50275598810999, -0.0879897380150376 51.502767063746774, -0.087977295169382 51.50280615788909, -0.0879719916039587 51.50282270769781, -0.0879719915833543 51.502822707793506, -0.0879719915817896 51.50282270789138, -0.0879719915993254 51.50282270798769, -0.0879719916352893 51.50282270807873, -0.087971991688303 51.50282270816103, -0.0879719917563345 51.50282270823141, -0.087971991836776 51.50282270828719, -0.0879719919265444 51.502822708326235, -0.0879719920221989 51.50282270834703, -0.0880499954356839 51.502831803612374, -0.0881510871247728 51.50284352334698, -0.0881698484254638 51.50286001551683, -0.0881366408628612 51.502947690871785, -0.0881300260745374 51.50295082027087, -0.0881232784087366 51.50295367781014, -0.0881161100569678 51.502956258713674, -0.0881088127538357 51.502958477814225, -0.0881012349937299 51.50296051249066, -0.0880935320485161 51.502962095498056, -0.0880855486436176 51.50296349408193, -0.0880774400524054 51.50296444099676, -0.0880693389837578 51.5029652081824, -0.0880611127337426 51.50296552369855, -0.0880528977637351 51.50296556962145, -0.0880432579250784 51.5029652326112, -0.0880432578330748 51.50296523261648, -0.0880432577436031 51.502965232638566, -0.0880432576597028 51.50296523267669, -0.0880432575842239 51.50296523272956, -0.0880432575197305 51.50296523279538, -0.0880432574684133 51.50296523287193, -0.0880432574320158 51.50296523295659, -0.0880432574320151 51.50296523295659, -0.0880399489463089 51.50297543016591, -0.0879813242499659 51.50296808969798, -0.0878864350578846 51.50295620115383, -0.087607205567424 51.502921433069126, -0.0876072054686676 51.50292143306667, -0.0876072053713546 51.50292143308367, -0.0876072052792838 51.502921433119475, -0.087607205196049 51.50292143317268, -0.0876072051248994 51.50292143324121, -0.0876072050686124 51.50292143332239, -0.0876072050293848 51.50292143341306, -0.0875718887157261 51.503031915503655, -0.0874139305526745 51.503012163835656, -0.0874503905578022 51.50289846329147, -0.0874503905783742 51.50289846319622, -0.0874503905800788 51.50289846309879, -0.0874503905628519 51.50289846300287, -0.0874503905273476 51.50289846291212, -0.0874503904749147 51.50289846282998, -0.0874503904075448 51.50289846275957, -0.0874503903277971 51.50289846270356, -0.0874503902387006 51.50289846266409, -0.0874503901436394 51.502898462642655, -0.0872184674116834 51.502869500950254, -0.0872184673129662 51.50286950094775, -0.0872184672156828 51.5028695009647, -0.0872184671236279 51.50286950100044, -0.0872184670403919 51.502869501053574, -0.0872184669692217 51.50286950112203, -0.0872184669128932 51.502869501203136, -0.0872184668736036 51.50286950129373, -0.0871632778659572 51.50304161843133, -0.0871632778453859 51.503041618526595, -0.0871632778436852 51.50304161862404, -0.0871632778609196 51.50304161871996, -0.0871632778964344 51.50304161881072, -0.0871632779488802 51.50304161889286, -0.0871632780162645 51.503041618963266, -0.0871632780960272 51.50304161901927, -0.087163278185138 51.50304161905873, -0.0871632782802113 51.50304161908016, -0.0873043249390598 51.5030592068739, -0.0872872364452774 51.50311288269375, -0.0871457010190011 51.503096635771236, -0.0869420699989376 51.50307335075006, -0.0869961012224836 51.502904812442836, -0.0869961012429601 51.50290481234835, -0.086996101244867 51.50290481225168, -0.0869961012281337 51.50290481215645, -0.086996101193386 51.50290481206623, -0.0869961011419231 51.50290481198438, -0.0869961010756693 51.502904811913965, -0.0869961009971019 51.50290481185762, -0.0869961009091587 51.502904811817444, -0.0869961008151279 51.50290481179495, -0.0869961007185255 51.50290481179097, -0.0869961006229636 51.502904811805664, -0.0869961005320154 51.50290481183847, -0.0869961004490816 51.502904811888165, -0.0869961003772632 51.502904811952895, -0.0869961003772638 51.502904811952895, -0.0867378736251001 51.50318737293316, -0.0867131900823951 51.503212509167646, -0.0865635732584604 51.503365100035126, -0.0865625844593643 51.50336463441914, -0.0865625844113606 51.50336463439952, -0.0865625844113595 51.50336463439952, -0.0865275084998493 51.50335237197429, -0.0865569707631191 51.50331634336844, -0.0865580238599093 51.50331528145787, -0.0865580238742154 51.50331528144284, -0.0866356492074414 51.50323021913438, -0.0867779022716042 51.503074540234735, -0.0869440113232145 51.50289281212284, -0.0869440113825742 51.5028928120433, -0.0869440114250535 51.5028928119536, -0.0869440114489787 51.50289281185728, -0.0869440114534074 51.50289281175812, -0.0869440114381649 51.502892811660054, -0.0869440114038518 51.50289281156692, -0.0869440113518201 51.50289281148241, -0.08694401128412 51.502892811409836, -0.0869440112034189 51.50289281135206, -0.0869440111128965 51.50289281131137, -0.0869440110161193 51.50289281128936, -0.0867535136294299 51.502869020709156, -0.0867535135307322 51.50286902070665, -0.0867535134334669 51.50286902072359, -0.0867535133414263 51.50286902075931, -0.086753513258199 51.50286902081242, -0.08675351318703 51.50286902088085, -0.0867535131306943 51.50286902096193, -0.0867535130913884 51.5028690210525, -0.0867535130913892 51.5028690210525, -0.0867361132841826 51.50292323184697, -0.0865755715891166 51.5029032570434, -0.08661123081924 51.50279152204951, -0.0866112308192409 51.50279152204951, -0.0866112308396728 51.5027915219543, -0.0866112308412605 51.50279152185693, -0.086611230823944 51.5027915217611, -0.08661123078838 51.50279152167044, -0.0866112307359177 51.5027915215884, -0.0866112306685471 51.50279152151808, -0.0866112305888239 51.50279152146216, -0.0866112304997722 51.50279152142274, -0.08661123040477 51.50279152140134, -0.0862643484968622 51.50274827239438, -0.0861933979432667 51.50273938102363, -0.0862159507984379 51.502668798544875, -0.0862675494329679 51.50267530583977, -0.0862675495327692 51.50267530584231, -0.0862675496310856 51.50267530582497, -0.0862675497239978 51.50267530578845, -0.0862675498078017 51.50267530573419, -0.0862675498791563 51.502675305664376, -0.0862675499352169 51.50267530558177, -0.0862675499737486 51.50267530548967, -0.0862675499737491 51.50267530548967, -0.0862864221619717 51.502613475094726, -0.0864636391294531 51.50263435187476, -0.0864584566148763 51.502651442574404, -0.0864584565958719 51.50265144266945, -0.0864584565955644 51.502651442766386, -0.0864584566139652 51.50265144286155, -0.0864584566503828 51.50265144295138, -0.0864584567034484 51.5026514430325, -0.0864584567711677 51.50265144310185, -0.0864584568509958 51.50265144315683, -0.0864584569399326 51.502651443195376, -0.0864584570346352 51.50265144321604, -0.0865863498614521 51.50266656917524, -0.0865863499607894 51.502666569177045, -0.0865863500585232 51.502666569159175, -0.0865863501507945 51.50266656912234, -0.0865863502339599 51.50266656906798, -0.0865863503047357 51.50266656899825, -0.0865863503603274 51.502666568915906, -0.0865863503985399 51.502666568824196, -0.0865863503985394 51.502666568824196, -0.0866079062863844 51.502595699255, -0.0866079062865531 51.50259569925444, -0.0866296437350284 51.502523933384815, -0.086652883914772 51.50244724650904, -0.0867326025617493 51.50245664037642, -0.086859202806476 51.50247165502762, -0.0868592028997648 51.502471655029915, -0.0868592029918553 51.50247165501484, -0.0868592030795397 51.502471654982905, -0.0868592031597639 51.502471654935235, -0.0868592032297335 51.502471654873496, -0.0868592032870111 51.50247165479983, -0.0868592033296019 51.50247165471679, -0.0868592033560221 51.50247165462729, -0.0868592033653516 51.502471654534446, -0.0868592033572658 51.50247165444148, -0.0868528769693414 51.50243692978998, -0.0868528769400813 51.502436929689964, -0.0868528768907263 51.50243692959819, -0.0868528768234195 51.50243692951863, -0.0868528767410847 51.50243692945476, -0.0868528766472981 51.502436929409335, -0.0868528765461335 51.502436929384345, -0.0868528764419848 51.502436929380856, -0.0867582179164935 51.50244365828668, -0.0867533985511748 51.50241768200776, -0.086848056910661 51.50241095311324, -0.0868480570129885 51.502410953095136, -0.0868480571093647 51.50241095305628, -0.0868480571956267 51.50241095299833, -0.0868480572680485 51.50241095292381, -0.0868480573235019 51.50241095283593, -0.0868480573595916 51.50241095273848, -0.0868480573747587 51.50241095263568, -0.0868480573683483 51.50241095253196, -0.0868467897319104 51.50240337862254, -0.086882485684042 51.5024008136219, -0.0868952409154868 51.50247125278963, -0.0868705290308604 51.50247300783496, -0.0868705289320335 51.50247300785206, -0.0868705288386083 51.50247300788855, -0.086870528754344 51.50247300794294, -0.0868705286826312 51.502473008013055, -0.0868705286263554 51.502473008096075, -0.086870528587781 51.50247300818866, -0.0868705285877801 51.50247300818866, -0.0868603301224643 51.50250665393327, -0.0868591603609484 51.502510501661945, -0.0867976360834365 51.50271344978054, -0.0867976360644753 51.50271344987524, -0.0867976360640724 51.502713449971814, -0.0867976360822429 51.50271345006666, -0.0867976361183088 51.50271345015625, -0.0867976361709248 51.50271345023723, -0.0867976362381278 51.50271345030659, -0.0867976363174107 51.50271345036173, -0.0867976364058159 51.502713450400606, -0.0867976365000449 51.50271345042176, -0.0870887587648387 51.50274976332186, -0.0870887588636049 51.50274976332434, -0.087088758960931 51.50274976330736, -0.0870887590530172 51.50274976327156, -0.0870887591362682 51.50274976321836, -0.0870887592074336 51.502749763149836, -0.0870887592637349 51.50274976306865, -0.0870887593029734 51.50274976297798, -0.087107495062796 51.502691167161174, -0.0871074950832851 51.50269116706593, -0.0871074950849163 51.502691166968525, -0.087107495067628 51.50269116687265, -0.0871074950320765 51.50269116678195, -0.0871074949796116 51.50269116669986, -0.0871074949122248 51.50269116662951, -0.0871074948324745 51.502691166573555, -0.0871074947433881 51.502691166534134, -0.0871074946483475 51.50269116651273, -0.0868590865092216 51.50266022667813, -0.0868862760683493 51.502575241258995, -0.0869064809091434 51.50251253324487, -0.0870429409450917 51.50252950700925, -0.0871308074125347 51.502540472364245, -0.0872781585375605 51.50255888250305, -0.0875226937707183 51.50258939859043, -0.0874754490222109 51.50273700477435, -0.0872379344796241 51.502707412413336, -0.0872379343808678 51.50270741241087, -0.0872379342835534 51.50270741242786, -0.0872379341914797 51.50270741246366, -0.0872379341082407 51.502707412516855, -0.0872379340370859 51.50270741258539, -0.0872379339807927 51.50270741266656, -0.0872379339415587 51.502707412757225, -0.0872191983413225 51.502766008596325, -0.0872191983208338 51.502766008691566, -0.0872191983192026 51.502766008788974, -0.0872191983364905 51.50276600888485, -0.0872191983720415 51.50276600897555, -0.0872191984245058 51.50276600905763, -0.0872191984918918 51.50276600912799, -0.0872191985716413 51.50276600918394, -0.0872191986607269 51.502766009223365, -0.0872191987557667 51.502766009244766, -0.0875356950872509 51.502805432656864, -0.0875356951870528 51.50280543265925, -0.0875356952853399 51.502805432641765, -0.087535695378194 51.5028054326051, -0.0875356954619136 51.50280543255072, -0.0875356955331612 51.5028054324808, -0.0875356955890967 51.502805432398105, -0.0875356956274903 51.502805432305955)), ((-0.0855485008688955 51.50310969139146, -0.0856062200954659 51.50304579788976, -0.0856874375681486 51.503074460995705, -0.0856874376631632 51.50307446101908, -0.0856874377609106 51.50307446102351, -0.0856874378576485 51.503074461008815, -0.085687437949672 51.50307446097556, -0.0856874380334571 51.50307446092502, -0.085687438105795 51.50307446085913, -0.0856874381057963 51.50307446085913, -0.0857465212997724 51.50300897032288, -0.0858146799473403 51.503032923893315, -0.0858146800421549 51.503032923916535, -0.0858146801396751 51.50303292392089, -0.0858146802361831 51.50303292390622, -0.0858146803280004 51.50303292387307, -0.0858146804116271 51.503032923822715, -0.0858146804838757 51.50303292375707, -0.0858146804838741 51.50303292375707, -0.0858616680546854 51.5029809943903, -0.0862031675592498 51.50310113291776, -0.08617068914348 51.50313693212792, -0.0858605663199289 51.50302791664339, -0.0858605662249457 51.50302791662014, -0.0858605661272542 51.50302791661582, -0.0858605660305901 51.50302791663059, -0.0858605659386506 51.5030279166639, -0.0858605658549525 51.50302791671447, -0.085860565782697 51.50302791678036, -0.0858605657826987 51.50302791678036, -0.0858171958690526 51.50307603838245, -0.0857510228988054 51.503052836631966, -0.0857510228039528 51.50305283660881, -0.0857510227064081 51.50305283660453, -0.0857510226098914 51.50305283661929, -0.0857510225180834 51.50305283665252, -0.0857510224344848 51.50305283670297, -0.0857510223622835 51.503052836768695, -0.0856632325784847 51.50315005217379, -0.0855485008688955 51.50310969139146)), ((-0.0864156223899973 51.5028656671258, -0.0866159834223306 51.50293602057272, -0.0865600764400518 51.502997965763, -0.0863597189922888 51.50292752235551, -0.0864156223899973 51.5028656671258)))', 4326);
RETURN sdo_thing;
END;

CT_FETCH error in PowerBuilder Program

I'm still learning PowerBuilder and trying to get familiar with it. I'm receiving the following error when I try to run a program against a specific document in my database:
ct_fetch(): user api layer: internal common library error: The bind of result set item 4 resulted in an overflow. ErrCode: 2.
What does this error mean? What is item 4? This is only when I run this program against a specific document in my database, any other document works fine. Please see code below:
string s_doc_nmbr, s_doc_type, s_pvds_doc_status, s_sql
long l_rtn, l_current_fl, l_apld_fl, l_obj_id
integer l_pvds_obj_id, i_count
IF cbx_1.checked = True THEN
SELECT dsk_obj.obj_usr_num,
dsk_obj.obj_type,
preaward_validation_doc_status.doc_status,
preaward_validation_doc_status.obj_id
INTO :s_doc_nmbr, :s_doc_type, :s_pvds_doc_status, :l_pvds_obj_id
FROM dbo.dsk_obj dsk_obj,
preaward_validation_doc_status
WHERE dsk_obj.obj_id = :gx_l_doc_obj_id
AND preaward_validation_doc_status.obj_id = dsk_obj.obj_id
using SQLCA;
l_rtn = sqlca.uf_sqlerrcheck("w_pdutl095_main", "ue_run_script", TRUE)
IF l_rtn = -1 THEN
RETURN -1
END IF
//check to see if document (via obj_id) exists in the preaward_validation_doc_status table.
SELECT count(*)
into :i_count
FROM preaward_validation_doc_status
where obj_id = :l_pvds_obj_id
USING SQLCA;
IF i_count = 0 THEN
//document doesn't exist
// messagebox("Update Preaward Validation Doc Status", + gx_s_doc_nmbr + ' does not exist in the Preaward Validation Document Status table.', Stopsign!)
//MC - 070815-0030-MC Updating code to insert row into preaward_validation_doc_status if row doesn't already exist
// s_sql = "insert into preaward_validation_doc_status(obj_id, doc_status) values (:gx_l_doc_obj_id, 'SUCCESS') "
INSERT INTO preaward_validation_doc_status(obj_id, doc_status)
VALUES (:gx_l_doc_obj_id, 'SUCCESS')
USING SQLCA;
IF sqlca.sqldbcode <> 0 then
messagebox('SQL ERROR Message',string(sqlca.sqldbcode)+'-'+sqlca.sqlerrtext)
return -1
end if
MessageBox("PreAward Validation ", 'Document number ' + gx_s_doc_nmbr + ' has been inserted and marked as SUCCESS for PreAward Validation.')
return 1
Else
//Update document status in the preaward_validation_doc_status table to SUCCESS
Update preaward_validation_doc_status
Set doc_status = 'SUCCESS'
where obj_id = :l_pvds_obj_id
USING SQLCA;
IF sqlca.sqldbcode <> 0 then
messagebox('SQL ERROR Message',string(sqlca.sqldbcode)+'-'+sqlca.sqlerrtext)
return -1
end if
MessageBox("PreAward Validation ", 'Document number '+ gx_s_doc_nmbr + ' has been marked as SUCCESS for PreAward Validation.')
End IF
update crt_script
set alt_1 = 'Acknowledged' where
ticket_nmbr = :gx_s_ticket_nmbr and
alt_2 = 'Running' and
doc_nmbr = :gx_s_doc_nmbr
USING SQLCA;
Return 1
ElseIF cbx_1.checked = False THEN
messagebox("Update Preaward Validation Doc Status", 'The acknowledgment checkbox must be selected for the script to run successfully. The script will now exit. Please relaunch the script and try again . ', Stopsign!)
Return -1
End IF
Save yourself a ton of headaches and use datawindows... You'd reduce that entire script to about 10 lines of code.
Paul Horan gave you good advice. This would be simple using DataWindows or DataStores. Terry Voth is on the right track for your problem.
In your code, Variable l_pvds_obj_id needs to be the same type as gx_l_doc_obj_id because if you get a result, it will always be equal to it. From the apparent naming scheme it was intended to be long. This is the kind of stuff we look for in peer reviews.
A few other things:
Most of the time you want SQLCode not SQLDbCode but you didn't say what database you're using.
After you UPDATE crt_script you need to check the result.
I don't see COMMIT or ROLLBACK. Autocommit isn't suitable when you need to update multiple tables.
You aren't using most of the values from the first SELECT. Perhaps you've simplified your code for posting or troubleshooting.

Fixing sql length error in progress 4gl 10.2B

I'm trying to use the openedge jdbc connector to pull data from an existing progress db but im running into column width issues.
Here is the error that is holding me up.
[DataDirect][OpenEdge JDBC Driver][OpenEdge] Column TabDisplayName in table PUB.Menu has value exceeding its max length or precision.
I've looked at many posts, each offering different advice, and here's what I've given a go this far:
Manually modify the SQL width via the data dictionary.
I ran a quick check on PUB.Menu.TabDisplayName to find a max value of 44 Characters
Set the width to x(50) to no avail and then x(100) out of a fix of irrational rage, again with no luck.
Use the SUBSTR() SQL Function to truncate the field -not optimum but better than nothing
I get weird results with this. It works fine in sqlexp but in a java environment its like the column is never selected.
Use the dbtool to automatically fix width problems with option #2
After selecting all tables and "areas" (not sure what those are...) and submitting the final option I am returned to the proenv cmdline as if nothing ever happened.
Modify the sql width programmatically via 4gl
This is the only option I found that I have yet to try.
I am a little reluctant to try this only because a manual modification failed. Also this is a live development environment(for me only) and Im trying to mess it up too terribly, although i am taking snaps regularly.
Running progress 10.2B on a unix machine.
Any comments and suggestions would be appreciated.
-Thanks
The dbtool option is the best. It is designed for this. From proenv you should see something like this:
proenv> dbtool s2k
DATABASE TOOLS MENU - 10.2B
---------------------------
1. SQL Width & Date Scan w/Report Option
2. SQL Width Scan w/Fix Option
3. Record Validation
4. Record Version Validation
5. Read or Validate Database Block(s)
6. Record Fixup
7. Schema Validation
9. Enable/Disable File Logging
Q. Quit
Choice: 2
: (0=single-user 1=self-service >1=#threads)? 1
Padding % above current max: 100
: (Table number or all)? all
: (Area number or all)? all
: (verbose level 0-3)? 0
Total records read: 31357
SQLWidth errors found: 0, Date errors found: 0
SQLWidth errors fixed: 0
If your db has a server up & running choose "1" at the connect: prompt. If not, choose "0".
Pick 100 for padding to double the width of fields.
Try it on a copy of the "sports" database if you are unsure. Use a higher level of verboseness if you want some insight into what it is doing.
It does not take very long to run on a small development database. (It is basically instantaneous on "sports".)
It is possible to create views with substring (field.name,1,maxlength) option and use PUB2.viewname instead pub.tablename
DROP VIEW PUB2."accounts";
CREATE VIEW PUB2."accounts" (
"ACC-TYPE",
"ACCOUNT-NAME",
ANALITIC,
ARCH,
COUNT1,
CURRENCY,
PLAN,
QUANTITY,
"RID-ANOBJECT",
"RID-APP",
TRANSIT )
AS select "acc-type",
SUBSTRING("account-name", 1, 130),
"analitic",
"arch",
"count1",
"currency",
"plan",
"quantity",
"rid-anobject",
"rid-app",
"transit"
FROM PUB."accounts";
COMMIT;
use sqlexp for automatic creation:
sqlexp account -H localhost -S ' + db-port + ' -user sysprogress -password sysprogress -infile recreateSQLviews.sql -outfile recreateSQLviews.log
here is code:
def var num-port as integer.
for first _Servers where _Servers._Server-Type = "Login" no-lock:
num-port = _Servers._Server-PortNum.
end.
if num-port < 0 then num-port = num-port + 65536.
if num-port = 0 then do:
message "Define -S parameter for Database" view-as alert-box.
RETURN.
end.
message num-port.
/* ttSQLWidth table: SQL WIDTH for all tables */
def var execstr as char.
def var rez-str as char.
def var db-port as char. /* -S port */
db-port = STRING(num-port).
DEFINE TEMP-TABLE ttSQLWidth NO-UNDO
FIELD tableName AS CHARACTER
FIELD tableNum AS INTEGER
FIELD fieldName AS CHARACTER
FIELD sqlWidth AS INTEGER
FIELD requireFix AS LOGICAL INIT FALSE
FIELD actualWidth AS INTEGER
FIELD newWidth AS INTEGER
INDEX tableNum tableNum
INDEX tableName tableName.
FOR EACH _File NO-LOCK WHERE _Tbl-Type = "T":
FOR EACH _Field OF _File WHERE _Field._Data-type = "character":
if _field._extent > 0 then next.
CREATE ttSQLWidth.
ASSIGN tableName = _File._File-name
tableNum = _File._File-num
fieldName = _Field._Field-name
sqlWidth = _Field._Width.
RELEASE ttSQLWidth.
END. /* FOR EACH _Field */
END. /* FOR EACH _File */
DEFINE VARIABLE bTab AS HANDLE NO-UNDO.
DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
DEFINE VARIABLE queryString AS CHARACTER NO-UNDO.
FOR EACH ttSQLWidth:
CREATE BUFFER bTab FOR TABLE tableName.
CREATE QUERY hQuery.
hQuery:ADD-BUFFER(bTab).
message tablename.
queryString = "FOR EACH " + tableName + " WHERE LENGTH(" + fieldName + ") >= " + STRING(sqlWidth) + " BY LENGTH(" + fieldName + ") DESC".
hQuery:QUERY-PREPARE(queryString).
hQuery:QUERY-OPEN().
IF hQuery:GET-NEXT() THEN DO:
ASSIGN actualWidth = LENGTH(bTab:BUFFER-FIELD(fieldName):BUFFER-VALUE)
requireFix = TRUE.
END. /* IF .. THEN DO */
hQuery:QUERY-CLOSE.
DELETE OBJECT hQuery.
bTab:BUFFER-RELEASE().
DELETE OBJECT bTab.
END. /* FOR EACH ttSQLWidth */
def var add-pr as integer initial 10. /* % from max */
def var maxWidth as integer initial 249. /* maxwidth */
FOR EACH ttSQLWidth WHERE ttSQLWidth.requireFix = TRUE:
ttSQLWidth.newWidth = TRUNCATE ( (ttSQLWidth.actualWidth + add-pr) / add-pr, 0 ) * add-pr.
ttSQLWidth.newWidth = INTEGER( ttSQLWidth.newWidth).
if ttSQLWidth.newWidth > maxWidth then ttSQLWidth.newWidth = maxWidth.
END.
/* sql script generation */
OUTPUT TO value("recreateSQLviews.sql").
def var lst-field as char.
FOR EACH ttSQLWidth WHERE BREAK BY ttSQLWidth.tableName:
IF FIRST-OF(ttSQLWidth.tableName)
THEN run MakeSQLViews(ttSQLWidth.tableName).
END.
OUTPUT CLOSE.
/* sql script execution */
execstr = 'sqlexp account -H localhost -S ' + db-port + ' -user sysprogress -password sysprogress -infile recreateSQLviews.sql -outfile recreateSQLviews.log'.
input through value(execstr).
repeat:
IMPORT UNFORMAT rez-str.
message rez-str.
end.
INPUT CLOSE.
RETURN.
PROCEDURE MakeSQLViews:
define input parameter tableName as character.
def var str_tmp as char.
def var str_tmp1 as char.
def var str as char initial "count,sum,double,row,date,level,area,number,primary".
def var fieldName as char.
def var fieldName1 as char.
FOR EACH _file WHERE _file._file-name = tableName AND
_file._file-num GT 0 AND _file._file-num LT 32000 NO-LOCK:
fieldName = "".
FOR EACH _Field OF _File NO-LOCK:
str_tmp = '"' + _Field._Field-name + '"'.
FOR FIRST ttSQLWidth where ttSQLWidth.tableName = _file._file-name and
ttSQLWidth.fieldName = _Field._Field-name and
ttSQLWidth.requireFix = TRUE:
str_tmp = 'SUBSTRING("' + _Field._Field-name + '", 1, ' + STRING(ttSQLWidth.newWidth) + ')'.
END.
fieldName = fieldName + (IF(fieldName = "") THEN ("") ELSE ("," + chr(10) + chr(9))) + str_tmp.
str_tmp1 = ( IF ( INDEX ( _Field._Field-name, "-" ) = 0 )
THEN ( _Field._Field-name )
ELSE ( '"' + _Field._Field-name + '"' )).
if LOOKUP ( _Field._Field-name, str, "," ) > 0 then str_tmp1 = '"' + _Field._Field-name + '"'.
fieldName1 = fieldName1 + (IF(fieldName1 = "") THEN ("") ELSE ("," + chr(10) + chr(9))) + UPPER(str_tmp1).
END. /* FOR EACH _Field */
PUT UNFORMATTED 'DROP VIEW PUB2."' + _file._file-name + '";' SKIP.
PUT UNFORMATTED 'CREATE VIEW PUB2."' + _file._file-name + '" ( ' + chr(10) chr(9) + fieldName1 + ' ) ' + chr(10) +
'AS select ' + fieldName + chr(10) +
'FROM PUB."' + _file._file-name + '";' SKIP.
PUT UNFORMATTED 'COMMIT;' SKIP(1).
END.
END.

Passing huge XML from C#/.Net to Oracle Stored Procedure via CLOB parameter - ORA-01008: not all variables bound

Environment:
Server: Oracle 11.2g server on a 64-bit windows 2008
Client: Oracle 11g client on Windows XP SP3, ASP.Net 4.0, Visual Studio 2010, C#
Input size of XML ~ 1,206,500 characters (Calculated based on the maximum data that I would have).
Scenario:
The web application generates the XML that the oracle stored procedure uses to update a table in the database. Since the XML size is pretty large, the Stored Procedure Parameter type chosen is CLOB instead of LONG as LONG has a limitation of 32760 characters.
Problem:
Using CLOB as the parameter type throws up the error "ORA-01008: not all variables bound" for the same stored procedure code which works perfectly for the parameter type as LONG (and XML length < 32760)
C# Code for invoking stored procedure:
OracleCommand DbUpdateCommand = null;
OracleLob tempLOB = null;
DbUpdateCommand.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
DbUpdateCommand.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
DbUpdateCommand.ExecuteNonQuery();
//Assign the value to the LOB
tempLOB = (OracleLob)DbUpdateCommand.Parameters[0].Value;
tempLOB.BeginBatch(OracleLobOpenMode.ReadWrite);
//Convert the string to byte array to write to LOB
UnicodeEncoding encoding = new UnicodeEncoding();
byte[] renewalDetailXMLBytes = encoding.GetBytes(renewalDetailXML);
tempLOB.Write(renewalDetailXMLBytes, 0, renewalDetailXMLBytes.Length);
tempLOB.EndBatch();
DbUpdateCommand.CommandText = "P_WEB_PRDCR_RNEW_UPDT";
DbUpdateCommand.CommandType = System.Data.CommandType.StoredProcedure;
DbUpdateCommand.Parameters.Add("PN_KEY_AGNT_RNEW_HDR",
System.Data.OracleClient.OracleType.Number, 12).Value = agentRenewalHeader;
DbUpdateCommand.Parameters.Add("PN_KEY_CO",
System.Data.OracleClient.OracleType.Number, 12).Value = companyCode;
DbUpdateCommand.Parameters.Add("PC_RNWL_DETL_XML",
System.Data.OracleClient.OracleType.Clob).Value = tempLOB;
DbUpdateCommand.Parameters.Add("PS_USR_NM",
System.Data.OracleClient.OracleType.VarChar,255).Value = userName;
DbUpdateCommand.ExecuteNonQuery();
Oracle Stored Procedure Code:
CREATE OR REPLACE PROCEDURE DOIADMIN.P_WEB_PRDCR_RNEW_UPDT (
PN_KEY_AGNT_RNEW_HDR IN NUMBER,
PN_KEY_CO IN NUMBER,
PC_RNWL_DETL_XML IN CLOB,
PS_USR_NM IN VARCHAR2
)
AS
lx_rnew_detl_xml XMLTYPE;
lct_rnew_detl_cntx DBMS_XMLSAVE.ctxtype;
--Construct the complete xml for financial data
lx_rnew_detl_xml := XMLTYPE(PC_RNWL_DETL_XML);
--table to be updated with the xml
lct_rnew_detl_cntx := DBMS_XMLSAVE.newcontext('IL_AGNT_RNEW_DETL');
--Set the key column list
DBMS_XMLSAVE.SETKEYCOLUMN(lct_rnew_detl_cntx, 'KEY_AGNT_RNEW_HDR');
DBMS_XMLSAVE.SETKEYCOLUMN(lct_rnew_detl_cntx, 'KEY_CO');
DBMS_XMLSAVE.SETKEYCOLUMN(lct_rnew_detl_cntx, 'KEY_INDVDL_LIC');
--Set the udpate column
DBMS_XMLSAVE.SETUPDATECOLUMN(lct_rnew_detl_cntx, 'FLG_MARKED_FOR_CANCEL');
--update the table from the rows
ln_cntr := DBMS_XMLSAVE.UPDATEXML(lct_rnew_detl_cntx, lx_rnew_detl_xml.getCLOBVal());
DBMS_XMLSAVE.closecontext(lct_rnew_detl_cntx);
END p_web_prdcr_rnew_updt;
Anyone who has worked with passing large XML via CLOB parameter and converted that CLOB to XML in the stored procedure can please help? Any alternate approach to this problem would also be highly appreciated.
Thanks in advance.
Here is the C# code that fixed the issue. I was missing to clear the parameters before reusing the same command object.
C# Code
OracleCommand DbUpdateCommand = null;
OracleLob tempLOB = null;
DbUpdateCommand.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
DbUpdateCommand.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
DbUpdateCommand.ExecuteNonQuery();
//Assign the value to the LOB
tempLOB = (OracleLob)DbUpdateCommand.Parameters[0].Value;
tempLOB.BeginBatch(OracleLobOpenMode.ReadWrite);
//Convert the string to byte array to write to LOB
UnicodeEncoding encoding = new UnicodeEncoding();
byte[] renewalDetailXMLBytes = encoding.GetBytes(renewalDetailXML);
tempLOB.Write(renewalDetailXMLBytes, 0, renewalDetailXMLBytes.Length);
tempLOB.EndBatch();
DbUpdateCommand.CommandText = "P_WEB_PRDCR_RNEW_UPDT";
DbUpdateCommand.CommandType = System.Data.CommandType.StoredProcedure;
//Missing line - start
DbUpdateCommand.Parameters.Clear();
//Missing line - end
DbUpdateCommand.Parameters.Add("PN_KEY_AGNT_RNEW_HDR",
System.Data.OracleClient.OracleType.Number, 12).Value =
agentRenewalHeader;
DbUpdateCommand.Parameters.Add("PN_KEY_CO",
System.Data.OracleClient.OracleType.Number, 12).Value =
companyCode;
DbUpdateCommand.Parameters.Add("PC_RNWL_DETL_XML",
System.Data.OracleClient.OracleType.Clob).Value =
tempLOB;
DbUpdateCommand.Parameters.Add("PS_USR_NM",
System.Data.OracleClient.OracleType.VarChar,255).Value =
userName;
DbUpdateCommand.ExecuteNonQuery();

Resources