All,
I have an application in which i have to serialize an C++ object in
Oracle DB. This object has 100 properties and all properties have to be
stored in different tables. These properties can be added/deleted at
client side.
So i am serializing the object as XML file and storing it in XML
repositorty. From there i am parsing the XML and based on the tablename
creating a dynamic query for inserting. SOmething like:
FORALL index in 1..PropCount
EXECUTE IMMEDIATE ' INSERT INTO '||tblname||'(val) VALUES (:a)' USING
t_char(index);
So this is hampering the performance as this statement has to be parsed
evrytime.
Is there a better way to update tables (when the tablenames are
dynamic) ? I want to do away with hard parse here.
I tried using DBMS_SQL but there are limitations in that (like varchar2
is 2000).
Pls suggest.
TIA
S
Jim Kennedy - 30 Apr 2006 15:26 GMT
> All,
> I have an application in which i have to serialize an C++ object in
[quoted text clipped - 19 lines]
> TIA
> S
Yes, Rethink the design. Why have dynamic table names?
Jim
Brian Peasland - 30 Apr 2006 17:09 GMT
Have you looked at doing a multi-table INSERT instead of multiple
INSERTs into multiple tables?
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9
014.htm#i2163698
This is available in 9i or 10g.
I'm not sure if serializing your data into one XML document is helping
or hurting you here. Do you have a need to use XML for this case,
outside of this loading process? If not, then XML may be getting in your
way. Maybe it isn't.... If you need XML, then look at Oracle's XML
toolkits (go to http://technet.oracle.com for many examples). There are
tools which let you load from XML files into Oracle databases.
HTH,
Brian

Signature
===================================================================
Brian Peasland
oracle_dba@nospam.peasland.net
http://www.peasland.net
Remove the "nospam." from the email address to email me.
"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown