Variable case resolution in PL/SQL

Source: Internet
Author: User

1. Scalar:

AG1:

Declare

V_ename emp.ename%type;--itself is called a univariate

Begin

Select Ename to V_ename from EMP where empno=&no;

Dbms_output.put_line (' Employee Name ' | | V_ename);

End

Ag2:

Declare

Type test1 is record (T1 emp.ename%type,t2 emp.sal%type);--Define record type variables

V_tt Test1;--v_tt is a compound variable test1

Begin

Select Ename,sal to V_tt from EMP where empno=&no;

Dbms_output.put_line (' Employee Name ' | | v_tt.t1| | ' Salary ' | | V_TT.T2);

End

AG3:

Declare

Type test2 is table of Emp.ename%type index by Binary_integer;--pl/sql table type

V_ename test2;

Begin

Select Ename to V_ename (0) from EMP where empno=7788;

Dbms_output.put_line (' Employee Name: ' | | V_ename (0));

End

Variable case resolution in PL/SQL

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.