Here the link whose answer is the opposite to I want: Reflection in PLSQL? I want to do the opposite operation to that Jon Heller wrote in the link above. I mean, I want to set attributes of an object dynamically not manually (because my user-defined type object has 130 attributes and in my opinion, filling out some many attributes manually is not best practice and not generic programming. Does anybody know how we can accomplish that?
Asked
Active
Viewed 127 times
0
-
2Please rephrase the question so as to better explain what you wish to achieve, what your data is like and what you have tried so far. A link to a question and saying its the oposite of what you want is not enough. We need to understand what you wish to do exactly and then maybe we can help you. – TineO Nov 04 '19 at 14:52
-
*"generic programming"*? Gak. PL/SQL (and SQL) are strongly typed languages, suited to well-defined data models. Generic data models are proven causes of poor query performance and data corruption. In as far as there can be a best practice in software design, generic programming is not it, at least where data is concerned. Also, by an OOP yardstick, something with 130 attributes smells like it might be [a God Object](https://en.wikipedia.org/wiki/God_object). – APC Nov 04 '19 at 17:18
-
@TineO: Hi. I've an user-defined type object with 130 attributes (@APC: You are right, an object with 130 attributes is not acceptable, but I must use this object because business needs force me :).) and I've a CLOB, includes XML. XML's tags are my object's attributes. I want to assign the values included in the XML to my user-defined object attributes. Since, my object has 130 attributes, I want to do the assignment by matching the attr. name with tag name and do it within a loop. I thought I can do the assignments by setVarchar2 of anydata and after that reconverting anydata to my object. – xascomm Nov 05 '19 at 10:17