简体   繁体   中英

Can someone tell me how do I create a class in sqldeveloper?

Recently I'm learning sql by myself and it's really tough to me.

For example I'd like create a sql class called XXX and also I'd like add some attributes into the class like country, population, etc.

So how do I write the code? Can anyone show me how to do that with a simple example?

I would fully appreciate for that.

You can create table like this:

create table your_class_table
(
country varchar2(2000 char),
population number
)

then you can insert data into it then select.

You can create a Type like below.

CREATE OR REPLACE TYPE MYCLASS AS OBJECT 
(Country varchar2(30), 
 Population varchar2(30)
); 
/     

CREATE TABLE MYTABLE of MYCLASS;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM