Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 views
in Technique[技术] by (71.8m points)

java - How can I fix this error : non supported SQL92?

I wirte code in java and database connection with oracle. I run some script and get this error.My script work in toad but not work in my project

url include .

.
.
.
.
    DECODE
                 (REF.target_type_code,
                  '1', wf.workflow_name,
                  '20', reqtyp.request_type_name,
                  '6', prj1.project_name,
                  '59', trootinfo1.NAME,
                  '55', DECODE
                     (document.checked_out_by,
                      NULL, 
                      REPLACE
                         (REPLACE
                             (REPLACE
                                 (REPLACE
                                     (REPLACE
                                         (knta_i18n_resource.get
                                             ('DMS_REFERENCE_DETAIL_CHECKED_OUT.TXT'
                                             ),
                                          knta_i18n_format_utils.format_date
                                                        (document.checked_in_date,
                                                         3 
                                                        )
                                         )
                                     ),
                                  document.version_number
                                 ) 
                             ),
                          '{4}' 
                         )
                     )
                 ) reference_detail,

.
.
.

.

try { 
    stmt = connection.createStatement(); 
    rset =   stmt.executeQuery(url) ;  
}  catch (Exception e) 

{  
    error= e.getLocalizedMessage() ;
    return 4; 
}

this error occurs because of { } parentheses. I test it . When I delete parentheses dont error. But I need them and How can I fix this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's all about { and }. You do not use them. Ojdbc won't parse it. Use different token instead of them.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...