Background Image

FORUM

2020.08.27 18:48

csql 문의

조회 수 136 추천 수 0 댓글 5
?

단축키

Prev이전 문서

Next다음 문서

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

* 질문 등록 시 다음의 내용을 꼭 기입하여 주세요.
OS
Window7 32bit, Linux 64bit 등
CUBRID Ver.
[cubrid_rel] 수행 결과 9.3
CUBRID TOOL Ver.
[도움말]-[버전정보] 확인
응용 환경(API)
java, php, odbc 등 입력

* CUBRID 응용 오류, SQL 오류 또는 SQL 튜닝 관련된 문의는 반드시 다음의 내용을 추가해 주세요. 비밀글이나 비밀 댓글도 가능합니다.
* 저희가 상황을 이해하고, 재현이 가능해야 알 수 있는 문제들이 많습니다. 가능한 정보/정황들을 부탁합니다.
에러 내용 및 재현 방법 재현 가능한 Source와 SQL
관련 테이블(인덱스, 키정보 포함) 정보 CUBRID 홈 디렉토리 아래 log 디렉토리 압축


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

csql 에서 텍스트 컬럼을 select 하는 경우 ' (Single Quote)로 싸서 출력되는데,

'(Single Quote) 이 안보이고 실제 컬럼 값만 보이게 출력하는 방법 문의드립니다.

  • ?
    황영진 2020.08.28 02:05

    csql 인터프리터에 접속 하지않고 -c 옵션(셸 상에서 SQL 문을 직접 수행)을 사용해 필드구분자를 제거하는 명령어를 활용하여 사용해보세요.

    원본 예시)
    $> csql -u dba demodb -c "select * from athlete limit 1;"

    === <Result of SELECT Command in Line 1> ===

             code  name                  gender                nation_code           event               

    =====================================================================================================

            10999  'Fernandez Jesus'     'M'                   'ESP'                 'Handball' 


    * single quote 제거 예시)
    $> csql -u dba demodb -c "select * from athlete limit 1;" | tr -d "'"

    === <Result of SELECT Command in Line 1> ===

             code  name                  gender                nation_code           event               

    =====================================================================================================

            10999  Fernandez Jesus     M                   ESP                 Handball          


  • ?
    bchlim 2020.08.28 09:59

    감사합니다.

    그런데, 이렇게 하면 실데이터에 있는 ' 까지 제거되서 문제입니다.

    다른 방법은 없을까요?

  • ?
    주영진 2020.08.28 00:48
    안녕하세요.

    -t 옵션을 주면 ' (Single quotation) 없이 결과를 볼 수 있습니다.
    하지만 컬럼마다 열이 맞지 않을 수 있습니다.

    비교 #1. -t 옵션을 사용하지 않았을 때

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    $ csql -u dba demodb -"select * from athlete limit 5"
     
    === <Result of SELECT Command in Line 1> ===
     
             code  name                  gender                nation_code           event               
    =====================================================================================================
            10999  'Fernandez Jesus'     'M'                   'ESP'                 'Handball'          
            10998  'Fernandez Jaime'     'M'                   'AUS'                 'Rowing'            
            10997  'Fernandez Isabel'    'W'                   'ESP'                 'Judo'              
            10996  'Fernandez Gigi'      'W'                   'USA'                 'Tennis'            
            10995  'Fernandez Ana Ibis'  'W'                   'CUB'                 'Volleyball'        
     
    5 rows selected. (0.005238 sec) Committed.
    cs

    비교 #2. -t 옵션을 사용했을 때


    1
    2
    3
    4
    5
    6
    7
    $ csql -u dba demodb -"select * from athlete limit 5" -t
    code    name    gender    nation_code    event
    10999    Fernandez Jesus    M    ESP    Handball
    10998    Fernandez Jaime    M    AUS    Rowing
    10997    Fernandez Isabel    W    ESP    Judo
    10996    Fernandez Gigi    W    USA    Tennis
    10995    Fernandez Ana Ibis    W    CUB    Volleyball
    cs
  • ?
    bchlim 2020.08.28 10:01
    감사합니다.
    그런데, 저희가 쓰고 있는 9.3 버전에는 -t 옵션이 없네요.
  • ?
    민순 2020.08.28 11:08

    sed 명령어를 이용해보시기 바랍니다.

    다음 3132번 게시글의 답변을 참고하시기 바랍니다.

    https://www.cubrid.com/index.php?mid=qna&page=6&document_srl=3826364


  1. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4441
    read more
  2. where in () 서브쿼리 관련 문의입니다

    Date2023.03.27 By제리리 Views114
    Read More
  3. 한글을 입력받아 한글을 리턴하는 CUBRID JAVA StoredProcedure 작성시 window 환경에서 리턴 값이 깨져서 출력 됨

    Date2023.03.22 By두목원슝 Views164
    Read More
  4. 큐브리드 DAMO(암호화)관련 버전 호환관련하여 문의드립니다.

    Date2023.03.20 By초코초코초 Views230
    Read More
  5. cubrid manager 에러??

    Date2023.03.20 By11시38분 Views220
    Read More
  6. PreparedStatement.executeBatch에서 일부 데이터의 오류 시 반환 값 문의

    Date2023.03.18 By새옹지마 Views337
    Read More
  7. db생성경로가 db테이블과 결과조회에 영향을 미치나요?

    Date2023.03.15 Bydfdfdd Views119
    Read More
  8. SQL statement violated NOT NULL constraint

    Date2023.03.15 Byyoo Views164
    Read More
  9. 콤마로 split하는 기능 구현 관련 문의

    Date2023.03.15 By플레이어블 Views293
    Read More
  10. insert문에서 replace

    Date2023.03.15 Byyoo Views121
    Read More
  11. cubrid 파라미터 바인딩

    Date2023.03.14 ByDJ Views167
    Read More
  12. /home/jenkins/workspace/cubrid_release_10.1/src/transaction/boot_cl.c, line 1138 CODE = -971 Tran = -1, EID = 1Program 'tranlist' (pid ) connected to database server 'test' on the host 'localhost'

    Date2023.03.13 Byjmkim Views193
    Read More
  13. macOS CUBRID 다운로드 질문

    Date2023.03.13 Bybk9395 Views193
    Read More
  14. CUBRID 11.2 & CUBRID Aadmin 11.1 오류 문의

    Date2023.03.08 By붉은구름 Views135
    Read More
  15. 도커에서 설치시 접속 문의드립니다.

    Date2023.03.07 By핫산 Views384
    Read More
  16. 특수문자 포함 LIKE검색

    Date2023.03.06 BySEO Views151
    Read More
  17. cubrid admin 질문 드립니다.

    Date2023.03.06 By초코초코초 Views119
    Read More
  18. plugin방식 호출

    Date2023.03.04 By네오랜덤 Views136
    Read More
  19. 서브쿼리시 질문드립니다.

    Date2023.02.28 Bydev123123 Views150
    Read More
  20. Cubrid DB 의 sqoop 사용시 옵션 문의

    Date2023.02.28 By망고라떼 Views100
    Read More
  21. 큐브리드 통계정보 관련 문의드립니다.

    Date2023.02.26 By초코초코초 Views118
    Read More
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 200 Next
/ 200

Contact Cubrid

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