Just learn Oracle and learn the code of others. This code is extracted from the following blog post: http://www.cnblogs.com/mq0036/p/4155774.html
Declarel_deptinteger:= -; Currtime Date:=sysdate; L_namvarchar2( -) :=To_char (Add_months (Trunc (sysdate),- A),'YYYYMMDD');--to_char (sysdate, ' MM ') -13;type Num_list isVarray (4) of Number; arr_id num_list:=Num_list ( -,101,123, -,234); beginl_dept:= -; Dbms_output.put_line (l_dept); Dbms_output.put_line (Currtime); Dbms_output.put_line (L_nam); Dbms_output.put_line (arr_id (1)); End;
Discover Oracle's SQL syntax for PL and SQL Server is really a big damn difference.
The first thing I can bear is that in a PL/SQL statement block, the data that you query must be stored in one place for later use. Either store to the appropriate variable or use a cursor, and so on. SQL Server is not used and can be output directly.
You can see that there are no arrays under SQL Server under Oracle.
The variable assignment method under Oracle is variable: =xxx;
Oracle->> Variable Assignment Demo