database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
ㆍSybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Sybase Q&A 1455 게시물 읽기
No. 1455
LOAD 명령어를 사용하는데...
작성자
손종삼(도우미)
작성일
2006-03-09 17:21
조회수
4,983

LOAD 명령어를 사용해서...

txt 파일의 내용을 테이블에 넣을려고 합니다.

 

이때, 옵션이 여러가지 있던데요...

그 의미를 알고 싶어서요...

 

LOAD TABLE TEST(
NAME ascii(11),
filler(1)
)
FROM '/test/test.txt'
Quotes off
Escapes off
--Delimited by ''
--Row Delimited by 0x0a
go

 

위에서

Quotes off
Escapes off
--Delimited by ''
--Row Delimited by 0x0a 의 의미가 뭔지요 ?

 

또 txt 파일에서 몇 개의 라인을 건너뛸 수 도 있다고 하던데... 옵션이 뭔지요 ???

 

고수님들 부탁 드려요 ^^

 


이 글에 대한 댓글이 총 1건 있습니다.

메뉴얼을 참고하시면

To use the newline character as a row delimiter, you can specify either the special combination '\n' or its ASCII value '\x0a'.

 

\b 0x08 back space

\f 0x0c form feed

\n 0x0a new line

\r 0x0d carriage return

\t 0x09 tab

 

윈도우에서는 '\x0a'로 사용하며  UNIX에서는 '\n'도 가능합니다.

 

두번째 질문은

SKIP option

Lets you define a number of rows to skip at the beginning of the input file(s) for this load. The default is 0. This option works in conjunction with the LIMIT option, and takes precedence over it.

In this UNIX example, Adaptive Server IQ reads 9,000 rows from the input file, skips the first 5,000, and loads the next 4,000. If there are only 8,000 rows in the input file, then only 3,000 rows are loaded.

LOAD TABLE lineitem(
    l_shipmode ASCII(15),
    l_quantity ASCII(8),
FILLER(30))
FROM '/d1/MILL1/tt.t'
BLOCK FACTOR 1000
LIMIT 4000
SKIP 5000
PREVIEW ON
로서 SKIP 5로 하시면 sam file에서 5개의 row는 생략합니다.
가끔 same file에 컬럼 head 가 있으면 skip 1 를 사용가능할 것 같습니다.
엑셀데이터에 컬럼이름이 있는 경우에요....
 
 
남억수(keaton)님이 2006-03-10 11:03에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
1458서버랑 클라이언트랑 character set 꼭 같게 해야 하나요? [2]
한원
2006-03-14
4131
1457한글 정렬(order by) [2]
한원
2006-03-13
4225
1456고수님들 부탁드려요 빨리 [2]
박정제
2006-03-11
3747
1455LOAD 명령어를 사용하는데... [1]
손종삼
2006-03-09
4983
1454엑셀이나 엑세스로 내보내기... [2]
윤영호
2006-03-09
4345
1453제곱근. [1]
알려주세요
2006-03-09
4008
1452한글 sortting & Index [1]
한원
2006-03-09
4095
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.020초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다