Home » SQL & PL/SQL » SQL & PL/SQL » working with abstract data type, help
working with abstract data type, help [message #223498] Fri, 09 March 2007 03:25 Go to next message
aboodlardy
Messages: 80
Registered: November 2006
Location: India
Member
HI
I have two questions for which i need u people help.
1. I am helping my college junior in his academic project to design a database for web based application dealing with college information( such as , student informatn, library ..etc..). MY question, which kind of database it is "prodction database or development" i don't the difference.
2. i have created


SQL> create or replace type sub as object(sname varchar2(10), m1 number(3), m2 n
umber(3));
2 /

Type created.

SQL> create table student(name varchar2(20), rno varchar2(14), subject sub);

Table created.

SQL> insert into student values('john','02j01a1201',sub('oracle',23,23));

1 row created.

SQL> select * from student;

NAME RNO
-------------------- --------------
SUBJECT(SNAME, M1, M2)
--------------------------------------------------------------------------------

john 02j01a1201
SUB('oracle', 23, 23)


SQL> select a.sub.m1 from student a;
select a.sub.m1 from student a
*
ERROR at line 1:
ORA-00904: invalid column name


SQL>
please help
Re: working with abstract data type, help [message #223501 is a reply to message #223498] Fri, 09 March 2007 03:56 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,


does this help you.
SELECT A.NAME,A.RNO,A.SUBJECT.M1,A.SUBJECT.M2 FROM STUDENT A




regards,
Re: working with abstract data type, help [message #223503 is a reply to message #223501] Fri, 09 March 2007 04:07 Go to previous messageGo to next message
aboodlardy
Messages: 80
Registered: November 2006
Location: India
Member
Thanx
Yes i was doing that, mistake thankyou.
Please can u tell me what is production and development database?what is the difference?
Re: working with abstract data type, help [message #223507 is a reply to message #223498] Fri, 09 March 2007 04:10 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You need to refer to the Column in the table, not the type.
select s.subject.sname from student s;

[drat - beaten to it]

[Updated on: Fri, 09 March 2007 04:10]

Report message to a moderator

Re: working with abstract data type, help [message #223508 is a reply to message #223503] Fri, 09 March 2007 04:12 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
They're pretty self explanitory.
A Development database is one where you do your development work.
A Production database is one that the company is using to produce work - ie it's actually being used for whatever it is that it was meant to do.
Previous Topic: How to send a email through procedure
Next Topic: SQL Query
Goto Forum:
  


Current Time: Mon Dec 05 09:08:12 CST 2016

Total time taken to generate the page: 0.10281 seconds