Oracle Table Demo statement

Source: Internet
Author: User


Oracle Table Demo statement SQL code www.2cto.com -- Created on 2010/07/29 by WANGNAN declare -- Local variables here i1 VARCHAR2 (20): = '1'; i2 VARCHAR2 (20): = '1 '; i3 VARCHAR2 (20): = '2'; i4 VARCHAR2 (20): = '3'; i5 VARCHAR2 (20): = '3'; i6 VARCHAR2 (20 ): = '3'; i7 VARCHAR2 (20): = '5'; I _before VARCHAR2 (20); TYPE t_type IS TABLE OF VARCHAR2 (20); t_table t_type; BEGIN -- Test statements here t_table: = t_type (); t_table.extend; t_table (1): = i1; t_table.extend; t_table (2): = i2; t_table.extend; t_table (3 ): = i3; t_table.extend; t_table (4): = i4; t_table.extend; t_table (5): = i5; t_table.extend; t_table (6): = i6; t_table.extend; t_table (7 ): = i7; FOR I IN 1 .. t_table.count loop if I _before is null or I _before <> t_table (I) THEN I _before: = t_table (I); dbms_output.put_line (t_table (I); END IF; END LOOP; exception when others then dbms_output.put_line (Sqlerrm); end;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.