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
운영게시판
최근게시물
MySQL Q&A 1357 게시물 읽기
No. 1357
Re: LOAD INFILE은 있는데 그반대인 file unload는 어떻게 하나요?~~~
작성자
문태준
작성일
2000-04-21 11:46
조회수
7,296

>

> 파일 언로드는 어떻게 하나요?

> LOAD DATA INFILE 'DATA.TXT' INTO TABLE TEST_TB FIELDS TERMINATED BY ';

> '

> 라는 식으로 로드는 되는데,

> 반대의 경우는 어떻게 하는지 알려주세요...

> 위의 문장과 다 반대로 해도 안되네요...

>

> UNLOAD DATA OUTFILE 'DATA.TXT' FROM TABLE TEST_TB FIELDS TERMINATED BY

> ';'

>

>

>

 

select 문을 참고하세요. 매뉴얼 좀만 찾아봐도 나오는 내용이네요.

 

The SELECT ... INTO OUTFILE 'file_name' form of SELECT writes the selected rows to a file. The file is created on the server host, and cannot already exist (among other things, this prevents database tables and files such as `/etc/passwd' from being destroyed). You must have the file privilege on the server host to use this form of SELECT. SELECT ... INTO OUTFILE is the complement of LOAD DATA INFILE; the syntax for the export_options part of the statement consists of the same FIELDS and LINES clauses that are used with the LOAD DATA INFILE statement. See section 7.16 LOAD DATA INFILE syntax. In the resulting text file, only the following characters are escaped by the ESCAPED BY character:

The ESCAPED BY character

The first character in FIELDS TERMINATED BY

The first character in LINES TERMINATED BY

Additionally, ASCII 0 is converted to ESCAPED BY followed by 0 (ASCII 48). The reason for the above is that you MUST escape any FIELDS TERMINATED BY, ESCAPED BY or LINES TERMINATED BY characters to reliably be able to read the file back. ASCII 0 is escaped to make it easier to view with some pagers. As the resulting file doesn't have to conform to the SQL syntax, nothing else need be escaped.

[Top]
No.
제목
작성자
작성일
조회
1353Mysql게시판 처럼 만들려고 하거든요.
최용섭
2000-04-20
6344
1366┕>Re: Mysql게시판 처럼 만들려고 하거든요.
정재익
2000-04-22 12:31:59
6849
1352패스워드설정에 관해서
이민영
2000-04-20
5930
1351mysql 에서 SQL문에 대하여..
김상범
2000-04-20
6402
1359┕>Re: mysql 에서 SQL문에 대하여..
seoullee
2000-04-21 15:42:49
6404
1350LOAD INFILE은 있는데 그반대인 file unload는 어떻게 하나요?~~~
최영란
2000-04-20
6328
1357┕>Re: LOAD INFILE은 있는데 그반대인 file unload는 어떻게 하나요?~~~
문태준
2000-04-21 11:46:30
7296
1348user 테이블에 insert 할 때 user password encrypt는 어떻게 하나요?~~~
최영란
2000-04-20
6170
1355┕># Re: user 테이블에 insert 할 때 user password encrypt는 어떻게 하나요?~~~
문태준
2000-04-21 11:32:52
6537
1346# 테이블 최대크기란?
김형교
2000-04-20
5841
1347┕># Re: # 테이블 최대크기란? -> 파일하나 크기 제한때문
문태준
2000-04-20 14:11:21
6497
1349 ┕>답변 감사합니다.(내용없음)
김형교
2000-04-20 15:45:10
6286
1343[추가질문] 시스템 부하. 웹서버와 MySQL 서버
송재호
2000-04-20
6557
1345┕># Re: [추가질문] 시스템 부하. 웹서버와 MySQL 서버 -> 당장 서버 분리하셔야할듯
문태준
2000-04-20 10:09:05
7036
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.019초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다