DBILITY

독거 가능성 100% 노후에 라면값이라도 하게 센스를 발휘합시다!😅
Please click on the ad so that I can pay for ramen in my old age!
点击一下广告,让老后吃个泡面钱吧!
老後にラーメン代だけでもするように広告を一回クリックしてください。

[SQL0418] db2 Use of parameter marker not valid 본문

database/db2 for iseries

[SQL0418] db2 Use of parameter marker not valid

DBILITY 2016. 9. 7. 12:55
반응형

[SQL0418] Use of parameter marker not valid. Cause . . . . . :   

Parameter markers and the RAISE_ERROR scalar function are not allowed: 
-- As a value in a VALUES INTO statement. 
-- As an operand of a concatenation operation. 
-- As the operand of a scalar function.  
   If the scalar function is VALUE, COALESCE, IFNULL, MIN, MAX, LAND, LOR, or XOR, then at least one of the arguments must not be a parameter marker. 
-- As the left operand of the LIKE predicate. 
-- As the operand of a unary minus. Parameter markers are also not allowed: 
-- In the SELECT clause of the statement string to be prepared. 
-- In an SQL statement in embedded SQL or in interactive SQL. 
-- In an EXECUTE IMMEDIATE statement. 


-- In a CREATE VIEW, CREATE TABLE, ALTER TABLE, or CREATE INDEX statement. 
-- In a statement processed by the RUNSQLSTM command. 
-- In a blocked INSERT statement.
 Recovery  . . . :   
Ensure parameter markers and the RAISE_ERROR scalar function are only specified where they are allowed.
A CAST specification can be used in many situations. Correct any errors.  Try the request again.
위와 같이 다양한 이유가 있습니다. 오류메시지의 마지막에 주목!!
INSERT SELECT SQL을 사용하는 MyBatis Mapper에서 오류가 발생할 경우 등
대부분 SELECT절에 DUMMY COLUMN을 PARAMETER로 받아 처리하는 경우 CASTING을 제대로 해주지 않아 발생하는 것임.
예를들어,framework상에서 parameter를 Map으로 넘기는 경우 value가 String이고,DB Field가 INTEGER인 경우를 CAST(#{파라메터} AS INTEGER) 처리
특이한 경우로 bind할 위치가 적으면 괜찮고, 많아지면 오류가 발생하기도 함.

반응형
Comments