CSQL 시작 옵션

프롬프트 상에서 옵션 목록을 보려면, 다음과 같이 옵션을 적용할 데이터베이스를 지정하지 않고 csql 유틸리티를 실행한다.

% csql
interactive SQL utility, version 8.1.0
usage: csql [OPTION] database-name valid options:
  -S, --SA-mode                standalone mode execution
  -C, --CS-mode                client-server mode execution
  -u, --user=ARG               alternate user name
  -p, --pasword=ARG            password string, give "" for none
  -e, --error-continue         don't exit on statement error
  -i, --input-file=ARG         input-file-name
  -o, --output-file=ARG        output-file-name
  -s, --single-line            single line oriented execution
  -c, --command=ARG            CSQL-commands
  -l, --line-output            display each value in a line
      --no-auto-commit         disable auto commit mode execution
      --no-pager               do not use pager

옵션

다음은 csql 유틸리티와 함께 사용할 수 있는 옵션을 정리한 표이다.

옵션

설명

-S

독립 모드(standalone mode)로 실행하기 위한 옵션이다.

-C

클라이언트/서버 모드(client/server mode)로 실행하기 위한 옵션이다.

-u user_name

데이터베이스에 접속하려는 사용자를 명시할 때 사용하는 옵션으로, 디폴트 값은 PUBLIC이다.

-p password

데이터베이스에 접속하려는 사용자의 암호가 존재하는 경우 암호를 입력하기 위한 옵션이다.

-e

에러가 발생하더라도 세션을 종료하지 않고 계속 실행하라는 옵션이다.

-i input_file

인수로 지정된 input_file은 SQL 문이 저장된 파일이며, 배치 모드 실행을 위한 옵션이다.

-o output_file

구문 실행 결과를 화면에 표시하지 않고 지정된 output_file에 저장한다.

-s

복수 개의 SQL 문이 연속적으로 저장된 파일에서 SQL 문을 하나씩 실행하려고 할 때 사용하는 옵션이다. 각 SQL 문은 세미콜론(;)으로 구분한다.

-c "CSQL commands"

프롬프트 상에서 직접 SQL 문을 수행하기 위한 옵션으로 큰 따옴표 안에 수행하려는 SQL 문을 입력한다.

-l

실행된 SQL 문에 대한 결과를 컬럼이 아닌 라인 형태로 출력하는 옵션이다. 디폴트 값은 컬럼 형태로 출력된다.

--no-auto-commit

CSQL 인터프리터의 자동 커밋(auto-commit) 모드를 OFF로 설정하는 옵션이다.

--no-pager

CSQL 인터프리터에서 수행한 질의 결과를 페이지 단위로 출력하지 않고 일괄적으로 출력하는 옵션이다.

csql -S demodb

csql -C demodb

csql -i infile demodb

csql -o outfile demodb

csql -u DBA demodb

csql -u DBA -p *** demodb

csql -s -i infile demodb

csql -c "select * from olympic;select * from stadium" demodb

csql -l demodb

csql -e demodb

csql --no-auto-commit demodb

csql --no-pager demodb