반응형
Oracle SQL Developer에서 변수 대체를 피하는 방법
Oracle SQL Developer 2.1에서 이 문을 실행하려고 하면 "Enter Substitution Variable" 대화상자가 나타나 TOBAGO의 대체 값을 요구합니다.
update t set country = 'Trinidad and Tobago' where country = 'trinidad & tobago';
어떻게 하면 이 문제를 피할 수 있을까요?chr(38)또는u'trinidad \0026 tobago'둘 다 그 진술의 목적을 모호하게 하는 건가요?
쿼리 전에 호출:
set define off;
또는 해킹:
update t set country = 'Trinidad and Tobago' where country = 'trinidad &' || ' tobago';
SQL*Plus 조정에서:
SET DEFINE OFF는 대체 변수를 값으로 대체하는 명령어 해석을 비활성화합니다.
인 SQL*Plus 퍼팅SET DEFINE ?보통 이 문제를 해결합니다.Oracle SQL Developer에서도 사용할 수 있습니다.
CHAR(38)를 사용하지 않고 원하는 대로 작동합니다.
update t set country = 'Trinidad and Tobago' where country = 'trinidad & '|| 'tobago';
create table table99(col1 varchar(40));
insert into table99 values('Trinidad &' || ' Tobago');
insert into table99 values('Trinidad &' || ' Tobago');
insert into table99 values('Trinidad &' || ' Tobago');
insert into table99 values('Trinidad &' || ' Tobago');
SELECT * FROM table99;
update table99 set col1 = 'Trinidad and Tobago' where col1 = 'Trinidad &'||' Tobago';
liquibase를 사용하여 sql 파일을 실행하면 오류가 발생하지 않습니다.그러나 SQL 개발자의 경우 이 방법을 사용합니다.set define off;sql sode 전에
set scan off. 위 명령도 작동합니다.
언급URL : https://stackoverflow.com/questions/2333994/how-to-avoid-variable-substitution-in-oracle-sql-developer
반응형
'programing' 카테고리의 다른 글
| Node events.js:167 throw er; // 처리되지 않은 '오류' 이벤트 (0) | 2023.03.06 |
|---|---|
| Swift [45] 디코딩 가능한 프로토콜에서 JSON 사전 유형을 사용하여 속성을 디코딩하는 방법 (0) | 2023.03.06 |
| AJAX를 사용한 ReCaptcha 2.0 (0) | 2023.03.06 |
| 타임아웃과 함께 sping의 restTemplate를 사용하여 타임아웃을 검출하려면 어떻게 해야 합니까? (0) | 2023.03.06 |
| mod_pagespeed는 CSS와 JS를 결합하지 않습니다. (0) | 2023.03.06 |