Follow the following steps..... :)
1) Create a table
CREATE TABLE my_docs (
name VARCHAR2(200) NOT NULL,
doc BLOB NOT NULL
);
2)Create a directory object which stores all your doc
CREATE OR REPLACE DIRECTORY documents AS 'C:\work';
3)Create a procedure
CREATE OR REPLACE PROCEDURE load_file_to_my_docs (p_file_name IN my_docs.name%TYPE)
AS
v_bfile BFILE;
v_blob BLOB;
BEGIN
INSERT INTO my_docs (name, doc)
VALUES ( p_file_name, empty_blob())
RETURN doc INTO v_blob;
v_bfile := BFILENAME('documents', p_file_name);
Dbms_Lob.Fileopen(v_bfile, Dbms_Lob.File_Readonly);
Dbms_Lob.Loadfromfile(v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
Dbms_Lob.Fileclose(v_bfile);
COMMIT;
END;
/
4)Execute the db procedure...
[This is sgalaxy solution form Oracle forum]
Saturday, February 17, 2007
Monday, February 12, 2007
Hacking SQL Server
In this presentation at the Jacksonville SQL Server Users Group, Bayer White playS the part of a developer protecting his application and Brian Knight attempts to hack his application using SQL Injection and cross-site scripting. Then, Bayer will show you how to protect yourself from the hacker and then Brian tries again. Back and forth the chess match goes until someone wins!
Tuesday, February 06, 2007
Understanding Relationships in E-R Diagrams
Few articles about E-R diagrams worth to read:
Understanding Relationships in E-R Diagrams (part 1, 2, 3)
Documenting Entities, Attributes & Relationships
E-R Diagram Relationship Integrity Constraints
Interpreting Cardinality and Dependency on an E-R Diagram
Guidelines for Naming E-R Attributes
Recursion in E-R Relationships
Notations on Entity-Relationship Models
Entity-Relationship Diagram Checklist
Understanding Relationships in E-R Diagrams (part 1, 2, 3)
Documenting Entities, Attributes & Relationships
E-R Diagram Relationship Integrity Constraints
Interpreting Cardinality and Dependency on an E-R Diagram
Guidelines for Naming E-R Attributes
Recursion in E-R Relationships
Notations on Entity-Relationship Models
Entity-Relationship Diagram Checklist
Subscribe to:
Posts (Atom)