Background Image

FORUM

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄


* 질문 등록 시 다음의 내용을 꼭 기입하여 주세요.

OS
Linux 64bit
CUBRID Ver.
CUBRID 11.2 (11.2.0.0404-720e490) (64bit release build for Linux) (Nov 19 2021 11:38:03)
CUBRID TOOL Ver.
[도움말]-[버전정보] 확인
응용 환경(API)
java, php, odbc 등 입력


* CUBRID 응용 오류, SQL 오류 또는 SQL 튜닝 관련된 문의는 반드시 다음의 내용을 추가해 주세요. 비밀글이나 비밀 댓글도 가능합니다.
* 저희가 상황을 이해하고, 재현이 가능해야 알 수 있는 문제들이 많습니다. 가능한 정보/정황들을 부탁합니다.

 

에러 내용 및 재현 방법 재현 가능한 Source와 SQL
관련 테이블(인덱스, 키정보 포함) 정보 CUBRID 홈 디렉토리 아래 log 디렉토리 압축


-------------- 아래에 질문 사항을 기입해 주세요. ------------------------------------------------------------------------

예를 들어 csql에서 select 'run'; 수행시,
run이라는 결과만 출력하고 싶습니다.(===<ResultofSELECTCommandinLine1>=== 등은 출력하고 싶지 않음)
오라클의 sqlplus로 치면, feedback heading off등으로 가능한데
csql에서는 어떻게 하면 되나요? 처음 사용자라 해당 내용을 못찾겠습니다.

 

감사합니다.

 

 

  • ?
    허서진 2023.10.18 17:43
    안녕하세요. 큐브리드입니다.
    현재 말씀해주신 기능은 CUBRID CSQL 인터프리터에서 제공되지 않는 기능입니다.
    리눅스에서 csql 사용 시에만 해당 기능이 필요하신 거라면 별도 쉘 스크립트를 작성하여 사용하시거나, 아래와 같이 우회하는 방안이 있습니다.
    csql -u dba demodb -c "쿼리 본문" | sed '/^$/d;2d;$d'
    쿼리 본문이 길 경우 아래와 같이 쿼리가 저장되어 있는 파일을 읽어들여 수행.
    csql -u dba demodb -i query.sql | sed '/^$/d;2d;$d'
    원하시는 대답이 되었기를 바랍니다
    감사합니다.
  • ?
    유형규 2023.10.18 17:59

    csql의 다음의 옵션으로 실행하는 경우에 말씀하신 기능과 "비슷"하게 결과만 출력할 수 있습니다. 결과의 헤더에 해당하는 컬럼 이름은 함께 출력됩니다.

    1) -t 옵션 이용 (plain output)

    >csql -u public demodb -t -c "SELECT 'run';"
    'run'
    run

    > csql -u public demodb -t -c "SELECT * from game LIMIT 5;"
    host_year event_code athlete_code stadium_code nation_code medal game_date
    2004 20021 14345 30116 NGR B 08/28/2004
    2004 20021 11280 30116 USA S 08/28/2004
    2004 20021 10507 30116 GBR G 08/28/2004
    2004 20013 15520 30116 RUS S 08/28/2004
    2004 20013 14521 30116 ROU B 08/28/2004

    2) -q 옵션 이용 (query output)

    > csql -u public demodb -q -c "SELECT 'run';"
    'run'
    'run'

    > csql -u public demodb -q -c "SELECT * from game LIMIT 5;"
    host_year,event_code,athlete_code,stadium_code,nation_code,medal,game_date
    2004,20021,14345,30116,'NGR','B','08/28/2004'
    2004,20021,11280,30116,'USA','S','08/28/2004'
    2004,20021,10507,30116,'GBR','G','08/28/2004'
    2004,20013,15520,30116,'RUS','S','08/28/2004'
    2004,20013,14521,30116,'ROU','B','08/28/2004'

    추가 내용
    'csql' 명령어만 입력하면 다음과 같이 출력된 사용법을 참조하실 수 있습니다. 참고로 -t와 -q 옵션은 인터프리터 모드가 아닌 -c 옵션 (위 예제와 같이 문자열을 바로 입력) 하거나 -i 옵션 (질의 문자열이 들어있는 파일의 경로를 지정) 하는 방식으로만 사용할 수 있습니다.

     

    A database-name is missing.
    interactive SQL utility, version 11.2
    usage: csql [OPTION] database-name[@host]

    valid options:
      -S, --SA-mode                standalone mode execution
      -C, --CS-mode                client-server mode execution
      -u, --user=ARG               alternate user name
      -p, --password=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
      -r, --read-only              read-only mode
      -t, --plain-output           display results in a script-friendly format (only works with -c and -i)
      -q, --query-output           display results in a query-friendly format (only work with -c and -i)
      -d, --loaddb-output          display results in a loaddb-friendly format (only work with -c and -i)
      -N, --skip-column-names      do not display column names in results (only works with -c and -i)
          --string-width           display each column which is a string type in this width
          --no-auto-commit         disable auto commit mode execution
          --no-pager               do not use pager
          --no-single-line         turn off single line oriented execution
          --no-trigger-action      disable trigger action
          --delimiter=ARG          delimiter between columns (only work with -q)
          --enclosure=ARG          enclosure for a result string (only work with -q)

  • ?
    f0081 2023.10.19 10:15
    답변 주신 분들 감사합니다. 두 분의 의견 섞어서 정규식으로 해결하였습니다.

  1. CUBRID 사용자를 위한 DBeaver 도구 출시 안내

    Date2024.04.23 Byadmin Views55
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4461
    read more
  3. 11.2버전에서 사용자 스키마에 대해서 궁금한 것이 있습니다.

    Date2023.11.08 By로키 Views139
    Read More
  4. 저장프로시저 실행관련 문의

    Date2023.11.08 Byf0081 Views139
    Read More
  5. 다른 소유자 테이블 검색 권한

    Date2023.11.08 By박혀누 Views143
    Read More
  6. [CUBRID Admin] 사용자의 테이블 권한 편집

    Date2023.11.06 Bytree1891 Views98
    Read More
  7. 3909번 답변 좀 부탁드립니다.

    Date2023.11.06 Byf0081 Views92
    Read More
  8. [CUBRID Admin] 테이블 컬럼 순서 변경 불가

    Date2023.11.05 Bytree1891 Views179
    Read More
  9. 시스템 카탈로그 조회 외

    Date2023.11.01 Byf0081 Views122
    Read More
  10. 시리얼 생성 시 class_name, attr_name, started 컬럼 값을 변경하고 싶습니다.

    Date2023.11.01 Bygetpost Views113
    Read More
  11. cubrid 9.3.1 설치해서 원격으로 접속하고자 설치했는데 에러가 뜹니다

    Date2023.10.27 ByXstar Views98
    Read More
  12. loaddb 실행 중 발생하는 오류에 대해서 문의 드립니다.

    Date2023.10.19 By뚜벅뚜벅 Views104
    Read More
  13. 큐브리드 매니서 실행 문의

    Date2023.10.19 By마리오 Views96
    Read More
  14. 큐브리드 DB가 실행되지 않는 것 같습니다.

    Date2023.10.18 By뚜벅뚜벅 Views124
    Read More
  15. ===<ResultofSELECTCommandinLine1>=== 등의 출력 없이 결과값만 반환받고 싶습니다.

    Date2023.10.18 Byf0081 Views93
    Read More
  16. 가로 데이터 세로로 조회

    Date2023.10.18 ByGgyak Views120
    Read More
  17. 테이블별 row 개수를 조회하는 쿼리

    Date2023.10.18 Bycncn Views111
    Read More
  18. [ADO.NET] Syntax error: unexpected

    Date2023.10.17 Bytree1891 Views152
    Read More
  19. 큐브리드매니저 패스워드 변경 문의건

    Date2023.10.16 Byyurrrr Views102
    Read More
  20. Db프로시져 스케쥴 실행 성공 리포트나 로그 결과른 보고싶습니다

    Date2023.10.16 ByRoy Views105
    Read More
  21. db 데이터용량을 조회하는 쿼리

    Date2023.10.11 Bycncn Views117
    Read More
  22. 특정 값 우선 정렬

    Date2023.10.11 Bydrunkenascii Views66
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 200 Next
/ 200

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales