Guest User

Untitled

a guest
Jul 28th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 1.29 KB | None | 0 0
  1. CREATE OR REPLACE
  2. PACKAGE FILE_API AS
  3.  
  4.   /* TODO enter package declarations (types, exceptions, methods etc) here */
  5.   /* small subset of possible functionality for now, no exceptions etc) */
  6.  
  7.   /* file_upload function, returns id of newly uploaded file */
  8.   FUNCTION file_upload (
  9.     p_name VARCHAR2,            /* IN name of the file e.g. myResume.pdf */
  10.     p_upload_time DATE,         /* IN upload time of the file */
  11.     p_content_type VARCHAR2,    /* IN content type e.g. application/pdf */
  12.     p_data BLOB,                /* IN binary data of file */
  13.     p_data_size INTEGER)        /* IN size of file in bytes */
  14.     RETURN INTEGER;             /* IN returns id of the uploaded file */
  15.    
  16.   /* file_download function takes in ID and sets output parameters */
  17.   PROCEDURE file_download (
  18.     p_id INTEGER,               /* IN id of the file to download */
  19.     p_name VARCHAR2,            /* OUT name of the file e.g. myResume.pdf */
  20.     p_upload_time DATE,         /* OUT upload time of file */
  21.     p_content_type VARCHAR2,    /* OUT content type of file e.g. application/pdf */
  22.     p_data BLOB,                /* OUT binary data of file */
  23.     p_data_size INTEGER         /* OUT size of file in bytes */
  24.   );
  25.  
  26.   /* exceptions... file does not exist exception etc. */
  27. END FILES_API;
  28. /
Add Comment
Please, Sign In to add comment