No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Haneef_Dapper_ODP
packages
.gitattributes
.gitignore
Haneef_Dapper_ODP.sln
Haneef_Dapper_ODP.v12.suo
README.md

README.md

Haneef_Dapper_ODP_Net -- www.haneefputtur.com

Installation of Oracle Dadatabase Express Edition and Integration with ASP.Net MVC C# Using Dapper and ODP.net

Sample Package Creation and Using Procedures.

Link : http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html

Create a USER

create user hputtur identified by test1000;

Grant Permission

Grant CREATE SESSION, ALTER SESSION, CREATE DATABASE LINK, CREATE MATERIALIZED VIEW, CREATE PROCEDURE, CREATE PUBLIC SYNONYM, CREATE ROLE, CREATE SEQUENCE, CREATE SYNONYM, CREATE TABLE, CREATE TRIGGER, CREATE TYPE, CREATE VIEW, UNLIMITED TABLESPACE to hputtur;

Login to TOAD

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LOCALHOST)(PORT=1521))(CONNECT_DATA=(SID=XE)))

CREATE TABLE EMPLOYEE

ALTER TABLE HPUTTUR.EMPLOYEE DROP PRIMARY KEY CASCADE;

DROP TABLE HPUTTUR.EMPLOYEE CASCADE CONSTRAINTS;

CREATE TABLE HPUTTUR.EMPLOYEE ( EMPLOYEE_ID NUMBER NOT NULL, EMPLOYEE_NAME VARCHAR2(200 CHAR) NOT NULL, EMPLOYEE_MOBILE VARCHAR2(50 BYTE) NOT NULL, EMPLOYEE_DEPARTMENT VARCHAR2(50 BYTE) NOT NULL ) TABLESPACE SYSTEM RESULT_CACHE (MODE DEFAULT) LOGGING NOCOMPRESS NOCACHE NOPARALLEL MONITORING;

CREATE UNIQUE INDEX HPUTTUR.EMPLOYEE_PK ON HPUTTUR.EMPLOYEE (EMPLOYEE_ID) LOGGING TABLESPACE SYSTEM NOPARALLEL;

/* Formatted on 21-Sep-16 12:17:58 AM (QP5 v5.185.11230.41888) */ CREATE OR REPLACE TRIGGER HPUTTUR.EMPLOYEE_TRG BEFORE INSERT ON HPUTTUR.EMPLOYEE REFERENCING NEW AS New OLD AS Old FOR EACH ROW BEGIN -- For Toad: Highlight column EMPLOYEE_ID :new.EMPLOYEE_ID := EMPLOYEE_SEQ.NEXTVAL; END EMPLOYEE_TRG; /

ALTER TABLE HPUTTUR.EMPLOYEE ADD ( CONSTRAINT EMPLOYEE_PK PRIMARY KEY (EMPLOYEE_ID) USING INDEX HPUTTUR.EMPLOYEE_PK ENABLE VALIDATE); Insert into HPUTTUR.EMPLOYEE (EMPLOYEE_ID, EMPLOYEE_NAME, EMPLOYEE_MOBILE, EMPLOYEE_DEPARTMENT) Values (1, 'Haneef Puttur', '354354354345', 'Computer'); Insert into HPUTTUR.EMPLOYEE (EMPLOYEE_ID, EMPLOYEE_NAME, EMPLOYEE_MOBILE, EMPLOYEE_DEPARTMENT) Values (2, 'Lewis 2', 'y676756565', 'Computer'); Insert into HPUTTUR.EMPLOYEE (EMPLOYEE_ID, EMPLOYEE_NAME, EMPLOYEE_MOBILE, EMPLOYEE_DEPARTMENT) Values (3, 'Lewis Veruga', '67868768768', 'Computer'); Insert into HPUTTUR.EMPLOYEE (EMPLOYEE_ID, EMPLOYEE_NAME, EMPLOYEE_MOBILE, EMPLOYEE_DEPARTMENT) Values (4, 'Haneef 2', 'yutyutyut', 'IT'); Insert into HPUTTUR.EMPLOYEE (EMPLOYEE_ID, EMPLOYEE_NAME, EMPLOYEE_MOBILE, EMPLOYEE_DEPARTMENT) Values (5, 'Haneef 3', 'yutyutyut', 'Computer'); COMMIT;

Create Package

CREATE OR DROP PACKAGE HPUTTUR.EMP;

/* Formatted on 21-Sep-16 12:18:31 AM (QP5 v5.185.11230.41888) */ CREATE OR REPLACE PACKAGE HPUTTUR.EMP AS PROCEDURE p_EMPLOYEE (p_dept IN VARCHAR2, p_emp_list OUT SYS_REFCURSOR); END; / DROP PACKAGE BODY HPUTTUR.EMP;

/* Formatted on 21-Sep-16 12:18:33 AM (QP5 v5.185.11230.41888) */ CREATE OR REPLACE PACKAGE BODY HPUTTUR.EMP AS PROCEDURE p_EMPLOYEE (p_dept IN VARCHAR2, p_emp_list OUT SYS_REFCURSOR) IS BEGIN OPEN p_emp_list FOR SELECT * FROM EMPLOYEE WHERE EMPLOYEE_DEPARTMENT = p_dept; END; END; /

##################

Credits & tools:

Dapper

Oracle

Microsoft

haneefputtur