emp表有主键字段empno,现需要查询empno为100的ename,并赋值给变量v_ename,请写出PL/SQL块实现该功能,要求在PL/SQL块中能够捕捉到不存在记录的异常和其它未知异常,并显示出来。
emp表有主键字段empno,现需要查询empno为100的ename,并赋值给变量v_ename,请写出PL/SQL块实现该功能,要求在PL/SQL块中能够捕捉到不存在记录的异常和其它未知异常,并显示出来。
相关考题:
View the Exhibit for some of the current parameter settings. A user logs in to the HR schema and issues the following commands:SQL CREATE TABLE emp(empno NUMBER(3),ename VARCHAR2(20),sal NUMBER(8,2));SQL INSERT INTO emp(empno,ename) VALUES(1,‘JAMES‘);At this moment, a second user also logs in to the HR schema and issues the following command:SQL ALTER TABLE emp MODIFY sal NUMBER(10,2);What happens in the above scenario?()A. The second user‘s session immediately produces the resource busy error.B. The second user‘s command executes successfully.C. The second user‘s session waits for a time period before producing the resource busy error.D. A deadlock is created.
在 Oracle中,关于PL/SQL下列描述正确的是() A.PL/SQL提供的四种内置数据类型是character integer,float,booleanB.PUSQ代表 Power Language/SQLC.PLQL块包括声明部分,可执行部分和异常处理部分D.PL/SQL不支持面向对象编程
在Oracle中,关于PL/SQL下列描述正确的是()。A.PL/SQL代表PowerLanguage/SQLB.PL/SQL不支持面向对象编程C.PL/SQL块包括声明部分、可执行部分和异常处理部分D.PL/SQL提供的四种内置数据类型是character,integer,float,boolean
在PL/SQL中定义一个可以存放雇员表(EMP)的员工名称(ENAME)的PL/SQL表类型,应该() A.type array arr_type[emp.ename%type] index by binary_integer;B.type table arr_type[emp.ename%type] index by binary_integer;C.type arr_type is table of emp.ename%type index by binary_integer;D.type arr_type is pl_sql table of emp.ename%type index by binary_integer;
关于PL/SQL说法错误的是()。A、PL/SQL是达梦数据库的过程化语言B、PL/SQL并不能支持所有的SQL数据类型和SQL函数C、包括一整套的数据类型、条件结构、循环结构和异常处理结构D、PL/SQL可以执行SQL语句,SQL语句中也可以使用PL/SQL函数
在PL/SQL中定义一个可以存放雇员表(EMP)的员工名称(ENAME)的PL/SQL表类型,应该()A、type array arr_type[emp.ename%type] index by binary_integer;B、type table arr_type[emp.ename%type] index by binary_integer;C、type arr_type is table of emp.ename%type index by binary_integer;D、type arr_type is pl_sql table of emp.ename%type index by binary_integer;
下面的查询中哪一个会产生笛卡尔集()A、SELECT e.empno,e.ename, e.deptno, d.deptno,d.loc FROM emp e,dept d WHERE e.deptno=d.deptnoB、SELECT e.empno, e.ename, e.deptno, d.deptno,d.loc FROM emp e,dept dC、SELECT e.empno, e.ename, e.deptno, d.deptno,d.loc FROM emp e,dept d WHERE e.empno=101 and e.deptno=d.deptnoD、SELECT e.empno, e.ename, e.deptno, d.deptno,d.loc FROM emp e,dept d WHEREe.deptno=d.deptno and d.deptno=60
关于存储和匿名的PLlSQL程序块下列说法错误的是()。A、与存储的PL/SQL程序块相比,匿名的PL/SQL程序块效率较高B、匿名的PL/SQL程序块由于可能在多台机器上分布源代码,会引发源代码管理的问题C、匿名的程序块只运行一次,因此必须在执行时被编译D、过程存储的PL/SQL程序块可以预先被编译
数据库中有一张表名为Emp,包含有如下列:EmpNO(雇员编号,Varchar(20),Pk),Job(职位Varchar(10)),HirDate(雇佣日期,Date),Sal(月薪,Float),Comm(奖金,Float,可为空)。查询出雇员编号不为791,792,793的雇员信息应该是用哪些数据查询?()A、Select * From Emp Where EmpNO Not In('791','792','793')B、Select * From Emp Where EmpNO !='791' AND EmpNO!='792' And EmpNO='793'C、Select * From Emp Where EmpNO '791' AND EmpNO792' And EmpNO=793'D、Select * From Emp Where EmpNO =!'791' AND EmpNO =!'792' And EmpNO =!'793'
数据库中有一张表名为Emp,包含有如下列:EmpNO(雇员编号,Varchar(20),Pk),Job(职位Varchar(10)),HirDate(雇佣日期,Date),Sal(月薪,Float),Comm(奖金,Float,可为空)。查询出雇员编号为791,792,793的雇员信息是()A、Select * From Emp Where EmpNO In('791','792','793')B、Select * From Emp Where EmpNO ='791' Or EmpNO='792' OR EmpNO='793'C、Select * From Emp Where EmpNO ='791' And EmpNO='793'D、Select * From Emp Where EmpNO '791' And EmpNO'793'
以下关于PL/SQL块的说法正确的是()A、匿名块(Anonymous Blocks)是在客户端解析后再送到服务器端执行的B、子程序(Subprograms)是被命名的PL/SQL块,存储在数据库服务器端C、匿名块比子程序执行效率要高D、无论是匿名块还是子程序,其实都是PL/SQL块,在定义变量前都要以DECLARE关键字开始E、过程(procedure)无返回值,而函数(function)是有返回值的
关于PL/SQL块的说法正确的是()A、执行部分是必须的,因此声明部分也可以放到执行部分中来B、PL/SQL块在执行时,是统一传输给数据库服务器进行执行的C、在PL/SQL中SELECT的语句的用法与在SQL*PLUS中完全一致D、匿名PL/SQL块的执行效率要高于命名PL/SQL块
在Oracle中,关于PL/SQL下列描述正确的是()。A、PL/SQL代表Power Language/SQLB、PL/SQL不支持面向对象编程C、PL/SQL块包括声明部分、可执行部分和异常处理部分D、PL/SQL提供的四种内置数据类型是character,integer,float,boolean
单选题在PL/SQL中定义一个可以存放雇员表(EMP)的员工名称(ENAME)的PL/SQL表类型,应该()Atype array arr_type[emp.ename%type] index by binary_integer;Btype table arr_type[emp.ename%type] index by binary_integer;Ctype arr_type is table of emp.ename%type index by binary_integer;Dtype arr_type is pl_sql table of emp.ename%type index by binary_integer;
单选题Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP table?()ACREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);BCREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));CCREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));DCREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));
多选题User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK,or any data definition language (DDL) command: SQL SELECT job FROM emp 2 WHERE job=’CLERK’ FOR UPDATE OF empno; SCOTT has opened another session to work with the database. Which three operations would wait when issued in SCOTT’s second session?()ALOCK TABLE emp IN SHARE MODE;BLOCK TABLE emp IN EXCLUSIVE MODE;CDELETE FROM emp WHERE job=’MANAGER’;DINSERT INTO emp(empno,ename) VALUES (1289,’Dick’);ESELECT job FROM emp WHERE job=’CLERK’ FOR UPDATE OF empno;
多选题User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK, or any data definition language (DDL) command: SQL SELECT ename FROM emp 2 WHERE job=’CLERK’ FOR UPDATE OF empno; SCOTT has opened another session to work with the database instance. Which three operations wouldwait when issued in SCOTT’s second session()ALOCK TABLE emp IN SHARE MODE;BLOCK TABLE emp IN EXCLUSIVE MODE;CUPDATE emp SET sal=sal*1.2 WHERE job=MANAGER;DINSERT INTO emp(empno,ename) VALUES (1289,’Harry’);ESELECT ename FROM emp WHERE job=’CLERK’ FOR UPDATE OF empno;
多选题User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK, orany data definition language (DDL) command: SQL SELECT ename FROM emp WHERE job=’CLERK’ FOR UPDATE OF empno; SCOTT has opened another session to work with the database instance. Which three operations would waitwhen issued in SCOTT’s second session()ALOCK TABLE emp IN SHARE MODE;BLOCK TABLE emp IN EXCLUSIVE MODE;CUPDATE emp SET sal=sal*1.2 WHERE job=ANAGER?UPDATE emp SET sal=sal*1.2 WHERE job=?ANAGER?DINSERT INTO emp(empno,ename) VALUES (1289,’Harry’);ESELECT ename FROM emp WHERE job=’CLERK’ FOR UPDATE OF empno
单选题Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table?()ACREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) NOT NULL CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);BCREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));CCREATE TABLE EMP (empno NUMBER(4) ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));DCREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp deptno fk REFERENCES dept (deptno));
单选题关于PL/SQL块的说法正确的是()A执行部分是必须的,因此声明部分也可以放到执行部分中来BPL/SQL块在执行时,是统一传输给数据库服务器进行执行的C在PL/SQL中SELECT的语句的用法与在SQL*PLUS中完全一致D匿名PL/SQL块的执行效率要高于命名PL/SQL块
在oracle中,下列关于PL/SQL的说法正确的是? (1.0分) [多选] A. PL/SQL 支持DML B. PL/SQL 支持游标操作和事务 C. 可执行部分的是必须的 D. 异常处理部分是必选的 E. PL/SQL 支持DDL 和DCL