You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PL/iSQL Parser Rejects Parentheses in SELECT INTO Expression #981
IvorySQL's PL/iSQL parser rejects SELECT INTO statements when the selected expression is wrapped in parentheses:
ERROR: syntax error at or near "select"
LINE 6: SELECT (100 - x) * 0.01 INTO result FROM dual;
^
Expected behavior/code
Oracle PL/SQL accepts parenthesized expressions in SELECT INTO statements. The same code runs successfully in Oracle:
Test with parentheses: .5
Expected: 0.5
PL/SQL procedure successfully completed.
Step to reproduce
Run the following code in IvorySQL Oracle compatibility mode (port 1521):
SET SERVEROUTPUT ON;
-- Test: Parenthesized expression in SELECT INTO
DECLARE
x NUMBER :=50;
result NUMBER;
BEGINSELECT (100- x) *0.01 INTO result FROM dual;
DBMS_OUTPUT.PUT_LINE('Test with parentheses: '|| result);
DBMS_OUTPUT.PUT_LINE('Expected: 0.5');
END;
/
Workaround
Use a temporary variable to maintain correct calculation:
DECLARE
temp NUMBER;
BEGINSELECT100 INTO temp FROM dual;
result := (temp - x) *0.01;
END;
Thanks for reporting this! I've verified the issue in the codebase.
The problem is in the PL/iSQL parser - it misidentifies SELECT (expression) syntax. This affects any SELECT statement where the first item after SELECT is wrapped in parentheses.
Your workaround using a temporary variable is correct for now. This should be fixed to ensure full Oracle PL/SQL compatibility.
Activity
yuanyl630 commentedon Nov 27, 2025
Thanks for reporting this! I've verified the issue in the codebase.
The problem is in the PL/iSQL parser - it misidentifies
SELECT (expression)syntax. This affects any SELECT statement where the first item after SELECT is wrapped in parentheses.Your workaround using a temporary variable is correct for now. This should be fixed to ensure full Oracle PL/SQL compatibility.
OreoYang commentedon Nov 27, 2025
/assign