Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Oracle Associate Array(Index-By table) in PL/SQL declaration #5928

Open
ZhengguanLi opened this issue May 17, 2024 · 0 comments
Open

Comments

@ZhengguanLi
Copy link
Contributor

ZhengguanLi commented May 17, 2024

Now we only support in the CREATE TYPE sql for Oracle index-by table syntax

dbtype: Oracle
dbversion: 19
druid verion: 1.2.23-SNAPSHOT
error sql:

set SERVEROUTPUT ON;

DECLARE
  TYPE population IS TABLE OF NUMBER INDEX BY VARCHAR2(64);          
  
  city_population  population;      
  i  VARCHAR2(64);                  
  
BEGIN
  city_population('Smallville')  := 2000;
  city_population('Midland')     := 750000;
  city_population('Megalopolis') := 1000000;
 
  city_population('Smallville') := 2001;
 
  i := city_population.FIRST;
 
  WHILE i IS NOT NULL LOOP
    DBMS_Output.PUT_LINE
      ('Population of ' || i || ' is ' || city_population(i));
    i := city_population.NEXT(i);
  END LOOP;
END;

testcase code:
stacktrace info:
error info: com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'_tab AS TABLE OF VARCHAR2(30) INDEX', expect IS, actual AS, pos 32, line 2, column 22, token AS

@ZhengguanLi ZhengguanLi changed the title Support Oracle: "DECLARE TYPE" in PL/SQL declaration Support Oracle Associate Array(Index-By table) in: "DECLARE TYPE" in PL/SQL declaration May 17, 2024
@ZhengguanLi ZhengguanLi changed the title Support Oracle Associate Array(Index-By table) in: "DECLARE TYPE" in PL/SQL declaration Support Oracle Associate Array(Index-By table) in PL/SQL declaration May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant