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 Views48
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4458
    read more
  3. 8.3.1 --> 9.2 업그레이드 후 한글 깨짐. ( vb6.0 + MS949 )

    Date2013.12.28 By한종희 Views23129
    Read More
  4. 8.4.3 32bit의 데이터를 9.1 64bit로 마이그레이션을 하려고 합니다만..

    Date2013.04.26 By살구맛 Views7698
    Read More
  5. 8.4.4 charset. Collation 확인 방법

    Date2023.05.24 By네오랜덤 Views188
    Read More
  6. 8.4.4ver 큐브리드 JDBC Driver Connection 인터페이스 미구현 문제

    Date2020.05.07 Bybikehee Views478
    Read More
  7. 8.4.4ver 큐브리드 JDBC Driver Connection 인터페이스 미구현 문제2

    Date2020.07.23 Bybikehee Views323
    Read More
  8. 8.4.4버젼 charset 확인

    Date2023.05.23 By네오랜덤 Views192
    Read More
  9. 8.44 버전 지원 여부와 9.대로 업그레이드시 안정 버전 문의드립니다.

    Date2017.07.06 By땡땡이 Views268
    Read More
  10. 8.4로 업그레이드후 cci_execute 실패 에러

    Date2011.09.23 By천상하늘 Views9126
    Read More
  11. 9.1 가져오기 / 내보내기

    Date2014.05.13 Bybellstar Views10507
    Read More
  12. 9.1 내보내기 / 가져오기 시 기본값.

    Date2014.05.14 Bybellstar Views7438
    Read More
  13. 9.1 버전 설치 후 오류 문의

    Date2013.07.09 By장경수 Views8
    Read More
  14. 9.1버전 LAST_VALUE함수 지원여부

    Date2015.08.17 By아하하하하 Views6527
    Read More
  15. 9.2 업그레이드 후 spread.datasource가 작동 안함!!!!!

    Date2014.01.04 By한종희 Views11206
    Read More
  16. 9.3 다음버전은...??

    Date2015.08.13 By유니콘 Views5611
    Read More
  17. 9.3 버전 원격 DB 접근 방법 문의

    Date2015.03.27 By수진이2 Views277
    Read More
  18. 9.3.2 에 대한 릴리즈노트는 어디서 볼수 있나요?

    Date2015.08.13 By유니콘 Views7174
    Read More
  19. 9.3버전에서 10.2버전 업그레이드 방법문의 드립니다.

    Date2020.02.06 By동동 Views280
    Read More
  20. 971번 에러 로그가 5초간격으로 쌓임

    Date2020.01.15 Bykidless Views312
    Read More
  21. ===<ResultofSELECTCommandinLine1>=== 등의 출력 없이 결과값만 반환받고 싶습니다.

    Date2023.10.18 Byf0081 Views93
    Read More
  22. A provider-specific error occurred 에러

    Date2010.10.26 By유니콘 Views10262
    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