Home > Net >  APEX ORACLE not saving SQL Query Changes
APEX ORACLE not saving SQL Query Changes

Time:10-11

I am fairly new to APEX so excuse me if this question is basic. However, I have some inquiries to the following and would appreciate input as to your experience with this and the factors that are potential causes to this behavior in APEX. If you have resolved this before would appreciate if you would share with me the fix.

Issue: When I add to the current SQL query on page I get an error message up top, yet on the Code Editor-SQL Query Section it says "Validation Successful". Click okay and query with edits is on there. Click on Save and "Changes Saved" yet when I am clicking to leave page message "Changes you made may not be saved?". The "1 Error has occurred" message not very helpful since it lacks details. Also, I have been able to edit other pages yet others give me this issue. enter image description here

enter image description here

enter image description here

I have tried the following: * Different browsers (Firefox, Chrome, Internet Explore) * Used SQL Command in APEX to debug query. I have run the new query successfully here and it gave the desired output but once I try to change the one in the SQL query section of page it does not save.

  • Tried on a new page; same result.

code looks as below (quite similar different item names)

    SELECT blue_code
,blue_name
,blue_cash
,blue_above_below
FROM(
SELECT CASE WHEN jg_blue_code = ‘ALL’ THEN jg_blue_or_ct_code ELSE jb_blue_code END blue_code
,jc_blue_name AS blue_name
,SUM(jg_blue_cash_amount) AS blue_cash
,get_above_below(jg_blue_comp_code,jg_blue_dept_code, CASE WHEN jg_blue_code = ‘ALL’ THEN jg_blue_or_ct_code ELSE jb_blue_code END blue_above_below
FROM schema.jg_blue_fin
,schema.jb_blue_info
WHERE 1=1
AND jg_blue_comp_code = :p4_comp_code
AND SUBSTR(jg_blue_dept_code,1,1) LIKE DECODE(:p4_comp_code,’10’, ’%’,:p4_dept_ blue_code)
AND CASE WHEN jg_blue_code = ‘ALL’ THEN jg_blue_or_ct_code ELSE jb_blue_code END = jg_code
AND jg_blue_comp_code IN(
‘10’, ‘22’, ‘88’)
GROUP BY CASE WHEN jg_blue_code = ‘ALL’ THEN jg_blue_or_ct_code ELSE jb_blue_code END
, jc_blue_name
, jg_blue_comp_code
, jg_blue_dept_code
)
WHERE(blue_cash,0) < 0
ORDER BY blue_code

CodePudding user response:

Not sure if this is the issue but this could be a problem: Note the whitespace between ':p4_dept_' and 'blue_code'.

...
AND SUBSTR(jg_blue_dept_code,1,1) LIKE DECODE(:p4_comp_code,’10’, ’%’,:p4_dept_ blue_code) 
...

If that doesn't work then try removing the function call to see if that makes a difference.

CodePudding user response:

In addition of removing white spaces, always try to type page item names in uppercase since APEX may act weirdly with lowercase page item names.

  • Related