Language: C


####索引
****
```sql
create table TD(
       id number,
       sq number,
       tri number,
       fac number,
       fib number,
       pow number
);

create or replace procedure proce1
AS
       id number:=1;
       last1 number:=0;
       last2 number:=1;
       lastpow number:=1;
       lastfac number:=1;
       md number:=1000003;
       temp number;
begin
       for i in 1..100000 loop
            insert into TD values ( i,MOD((i*i),md),MOD((i*i*i),md),Mod(lastfac*i,md)
                   ,Mod(last1+last2,md),Mod(lastpow*2,md));
            temp:=last1;
            last1:=last2;
            last2:=Mod(temp+last1,md);
            lastpow:=Mod(lastpow*2,md);
            lastfac:=Mod(lastfac*i,md);
       end loop;
end;

create index myindex1 on TD(id);
```

* ??比?,索引???速度?快了一点.


<br>

####数据字典表
****

#### PL/SQL 程序基?
****

* 判断偶数
```sql
create or replace procedure pro1 (x number) as
begin
  if Mod(x,2)=0 then
    dbms_output.put_line('even');
  else
    dbms_output.put_line('odd');
  end if;
end;
```

* 判断素数
```sql
create or replace procedure isPrime(x number) as
  flag number:=1;
begin
  if x<2 then
    dbms_output.put_line('not prime');
  else
    for i in 2..x loop
      if i*i>x then
        goto here;
      end if;
      if Mod(x,i)=0 then
        flag:=0;
        goto here;
      end if;
    end loop;
    <<here>>
    if flag=1 then
      dbms_output.put_line('is prime');
    else
      dbms_output.put_line('not prime');
    end if;
   end if;
end;
```

Compiler output:
main.c:2:1: error: stray '##' in program
    2 | ####索引
      | ^~
main.c:2:3: error: stray '##' in program
    2 | ####索引
      |   ^~
main.c:2:5: error: unknown type name '\U00007d22\U00005f15'
    2 | ####索引
      |     ^~~~
main.c:4:1: error: stray '`' in program
    4 | ```sql
      | ^
main.c:4:2: error: stray '`' in program
    4 | ```sql
      |  ^
main.c:4:3: error: stray '`' in program
    4 | ```sql
      |   ^
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'create'
    5 | create table TD(
      | ^~~~~~
main.c:5:1: error: unknown type name 'create'
main.c:14:1: error: unknown type name 'create'
   14 | create or replace procedure proce1
      | ^~~~~~
main.c:14:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'replace'
   14 | create or replace procedure proce1
      |           ^~~~~~~
main.c:14:11: error: unknown type name 'replace'
main.c:17:8: error: unknown type name 'last1'
   17 |        last1 number:=0;
      |        ^~~~~
main.c:17:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   17 |        last1 number:=0;
      |                    ^
main.c:18:8: error: unknown type name 'last2'
   18 |        last2 number:=1;
      |        ^~~~~
main.c:18:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   18 |        last2 number:=1;
      |                    ^
main.c:19:8: error: unknown type name 'lastpow'
   19 |        lastpow number:=1;
      |        ^~~~~~~
main.c:19:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   19 |        lastpow number:=1;
      |                      ^
main.c:20:8: error: unknown type name 'lastfac'
   20 |        lastfac number:=1;
      |        ^~~~~~~
main.c:20:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   20 |        lastfac number:=1;
      |                      ^
main.c:21:8: error: unknown type name 'md'
   21 |        md number:=1000003;
      |        ^~
main.c:21:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   21 |        md number:=1000003;
      |                 ^
main.c:22:8: error: unknown type name 'temp'
   22 |        temp number;
      |        ^~~~
main.c:24:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
   24 |        for i in 1..100000 loop
      |        ^~~
main.c:24:17: error: too many decimal points in number
   24 |        for i in 1..100000 loop
      |                 ^~~~~~~~~
main.c:27:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   27 |             temp:=last1;
      |                 ^
main.c:28:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   28 |             last1:=last2;
      |                  ^
main.c:29:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   29 |             last2:=Mod(temp+last1,md);
      |                  ^
main.c:30:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   30 |             lastpow:=Mod(lastpow*2,md);
      |                    ^
main.c:31:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   31 |             lastfac:=Mod(lastfac*i,md);
      |                    ^
main.c:32:8: error: unknown type name 'end'
   32 |        end loop;
      |        ^~~
main.c:33:1: warning: data definition has no type or storage class
   33 | end;
      | ^~~
main.c:33:1: error: type defaults to 'int' in declaration of 'end' [-Wimplicit-int]
main.c:35:1: error: unknown type name 'create'
   35 | create index myindex1 on TD(id);
      | ^~~~~~
main.c:35:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'myindex1'
   35 | create index myindex1 on TD(id);
      |              ^~~~~~~~
main.c:35:14: error: unknown type name 'myindex1'
main.c:36:1: error: stray '`' in program
   36 | ```
      | ^
main.c:36:2: error: stray '`' in program
   36 | ```
      |  ^
main.c:36:3: error: stray '`' in program
   36 | ```
      |   ^
main.c:38:3: error: expected identifier or '(' before '?' token
   38 | * ??比?,索引???速度?快了一点.
      |   ^
main.c:43:1: error: stray '##' in program
   43 | ####数据字典表
      | ^~
main.c:43:3: error: stray '##' in program
   43 | ####数据字典表
      |   ^~
main.c:46:1: error: stray '##' in program
   46 | #### PL/SQL 程序基?
      | ^~
main.c:46:3: error: stray '##' in program
   46 | #### PL/SQL 程序基?
      |   ^~
main.c:50:1: error: stray '`' in program
   50 | ```sql
      | ^
main.c:50:2: error: stray '`' in program
   50 | ```sql
      |  ^
main.c:50:3: error: stray '`' in program
   50 | ```sql
      |   ^
main.c:54:26: warning: multi-character character constant [-Wmultichar]
   54 |     dbms_output.put_line('even');
      |                          ^~~~~~
main.c:55:3: error: expected identifier or '(' before 'else'
   55 |   else
      |   ^~~~
main.c:56:26: warning: multi-character character constant [-Wmultichar]
   56 |     dbms_output.put_line('odd');
      |                          ^~~~~
main.c:57:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
   57 |   end if;
      |       ^~
main.c:58:1: warning: data definition has no type or storage class
   58 | end;
      | ^~~
main.c:58:1: error: type defaults to 'int' in declaration of 'end' [-Wimplicit-int]
main.c:59:1: error: stray '`' in program
   59 | ```
      | ^
main.c:59:2: error: stray '`' in program
   59 | ```
      |  ^
main.c:59:3: error: stray '`' in program
   59 | ```
      |   ^
main.c:62:1: error: stray '`' in program
   62 | ```sql
      | ^
main.c:62:2: error: stray '`' in program
   62 | ```sql
      |  ^
main.c:62:3: error: stray '`' in program
   62 | ```sql
      |   ^
main.c:62:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sql'
   62 | ```sql
      |    ^~~
main.c:62:4: error: unknown type name 'sql'
main.c:66:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
   66 |   if x<2 then
      |   ^~
main.c:67:26: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   67 |     dbms_output.put_line('not prime');
      |                          ^~~~~~~~~~~
main.c:68:3: error: expected identifier or '(' before 'else'
   68 |   else
      |   ^~~~
main.c:69:14: error: too many decimal points in number
   69 |     for i in 2..x loop
      |              ^~~~
main.c:72:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
   72 |       end if;
      |           ^~
main.c:73:7: error: expected identifier or '(' before 'if'
   73 |       if Mod(x,i)=0 then
      |       ^~
main.c:75:9: error: expected identifier or '(' before 'goto'
   75 |         goto here;
      |         ^~~~
main.c:76:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
   76 |       end if;
      |           ^~
main.c:77:5: error: unknown type name 'end'
   77 |     end loop;
      |     ^~~
main.c:78:5: error: expected identifier or '(' before '<<' token
   78 |     <<here>>
      |     ^~
main.c:80:28: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   80 |       dbms_output.put_line('is prime');
      |                            ^~~~~~~~~~
main.c:81:5: error: expected identifier or '(' before 'else'
   81 |     else
      |     ^~~~
main.c:82:28: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   82 |       dbms_output.put_line('not prime');
      |                            ^~~~~~~~~~~
main.c:83:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
   83 |     end if;
      |         ^~
main.c:84:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
   84 |    end if;
      |        ^~
main.c:85:1: warning: data definition has no type or storage class
   85 | end;
      | ^~~
main.c:85:1: error: type defaults to 'int' in declaration of 'end' [-Wimplicit-int]
main.c:86:1: error: stray '`' in program
   86 | ```
      | ^
main.c:86:2: error: stray '`' in program
   86 | ```
      |  ^
main.c:86:3: error: stray '`' in program
   86 | ```
      |   ^