설문조사
PostgreSQL/PPAS 관련 듣고 싶은 교육은


총 게시물 94건, 최근 0 건
   

SQLPLUS 흉내내기

글쓴이 : PostgresDBA 날짜 : 2012-12-15 (토) 00:21 조회 : 5514
create.sql  화일의 내용은 아래와 같습니다.
create table test(test char(10) not null);

오라클에서 sqlplus scott/tiger 로 접속한후에 아래와 같이 create.sql 화일의 구문을 실행하였고,
생성된 test 테이블의 구조를 확인하였습니다.
SQL>@create.sql
SQL>desc test;
 Name                             Null?          Type
 ---------------------- ------------ ----------------------------------------------------
 TEST                           NOT NULL     CHAR(10)
SQL>

위 내역을 PostgreSQL 에서 그대로 재현해 보겠습니다.
[postgres@olmaster:~/oradba]$ cat create.sql 
create table test(test char(10) not null);

[postgres@olmaster:~/oradba]$ psql -d scottdb -U scott -W
Password for user scott: 
Null display is "NULL".
Timing is on.
Pager is always used.
psql (9.2.1)
Type "help" for help.

scott@[local]:5432 scottdb#SQL> \i create.sql
CREATE TABLE
Time: 18.327 ms
scott@[local]:5432 scottdb#SQL> \d test
        Table "public.test"
 Column |     Type      | Modifiers 
--------+---------------+-----------
 test   | character(10) | not null

scott@[local]:5432 scottdb#SQL> 

이상입니다.


   

postgresdba.com