Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews DB Oracle Interviews:Concepts and ArchitectureData AccessDatabase ArchitectureDatabase ManagementDatabase Security OracleDistributed ProcessingFlexfieldForms ReportsGeneral OracleMemory ManagementMTO-SAP Financial AccountingOCIOracle AOLOracle AROracle Backup RecoveryOracle D2KOracle DatabaseOracle Database DeveloperOracle DB OptimizationOracle DBAOracle DeveloperOracle ETLOracle Forms 3.0Oracle Forms 4.0Oracle GLOracle PL-SQLOracle RMANOracle ScenariosOracle SecurityOracle SQLOracle System ArchitectureOracle Technology Network (OTN)Programmatic ConstructsRAC (Real Application Clusters)SQL Plus
Copyright © 2018. All Rights Reserved
Oracle Database Interview Question:
Can DML Statements Be Used in PL/SQL?
Submitted by: AdministratorYes, you can run almost any DML statements in PL/SQL directly. To manipulate Oracle database data you can include INSERT, UPDATE, and DELETE statements, directly in PL/SQL programs, without any special notation, as shown in the following sample code:
(Connect to XE with SQL*Plus)
CREATE TABLE student (id NUMBER(5) PRIMARY KEY,
first_name VARCHAR(80) NOT NULL,
last_name VARCHAR(80) NOT NULL);
Table created.
SELECT COUNT(*) FROM student;
COUNT(*)
----------
0
CREATE OR REPLACE PROCEDURE HELLO AS
BEGIN
INSERT INTO student VALUES(29, 'Bob', 'Henry');
INSERT INTO student VALUES(30, 'Joe', 'Bush');
UPDATE student SET first_name = 'ggl' WHERE id = 30;
DELETE FROM student WHERE id = 29;
END;
/
SELECT * FROM student;
<pre>ID FIRST_NAME LAST_NAME
-------- ----------- ----------
30 ggl Bush</pre>
Submitted by: Administrator
(Connect to XE with SQL*Plus)
CREATE TABLE student (id NUMBER(5) PRIMARY KEY,
first_name VARCHAR(80) NOT NULL,
last_name VARCHAR(80) NOT NULL);
Table created.
SELECT COUNT(*) FROM student;
COUNT(*)
----------
0
CREATE OR REPLACE PROCEDURE HELLO AS
BEGIN
INSERT INTO student VALUES(29, 'Bob', 'Henry');
INSERT INTO student VALUES(30, 'Joe', 'Bush');
UPDATE student SET first_name = 'ggl' WHERE id = 30;
DELETE FROM student WHERE id = 29;
END;
/
SELECT * FROM student;
<pre>ID FIRST_NAME LAST_NAME
-------- ----------- ----------
30 ggl Bush</pre>
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.