Any Easier Way? [message #559281] |
Sun, 01 July 2012 14:12  |
 |
jbm417
Messages: 9 Registered: June 2012
|
Junior Member |
|
|
Below is what I used to create a user defined type and associated table.
All this works just fine.
CREATE type person_type AS object (pname varchar2(30), address varchar2(60), age
number(3));
CREATE TABLE person_table
(
id NUMBER(5),
person PERSON_TYPE
);
INSERT INTO person_table
VALUES ('123', Person_type ('ABC', 'One Street', '68'));
When I access the table I use the code below which works just fine meaning that
objPersonBO contains all the data of Person_Type.
"SELECT * FROM person_table;
..... usual open, cmd stuff ....
OracleDataReader objReader = objCmd.ExecuteReader();
while (objReader.Read())
{
objPersonBO = (PersonBO)objReader["Person"];
...
}
Now the question --
I would like to use a different INSERT statement to have a more consistent syntax.
For example,
INSERT INTO person_table VALUES ('123', objPersonBO);
where objPersonBO has previously been given the data to be stored.
Can anyone show me a way? TIA, Joe
|
|
|
|
|
|
|
|
|
|
|
Re: Any Easier Way? [message #559540 is a reply to message #559513] |
Tue, 03 July 2012 20:53  |
 |
jbm417
Messages: 9 Registered: June 2012
|
Junior Member |
|
|
Thanks flyby! The use of : completely fixed the problem. Code now works as expected. Because I am just learning about bindparameters, I had no clue.
I really appreciate your help.
|
|
|