Search This Blog

Wednesday, July 27, 2022

Create Sequence in IFS

DECLARE
   seq_exists_   NUMBER;
   sql_stmt_     VARCHAR2(2000);
   
   CURSOR check_exists IS
      SELECT 1
      FROM   all_objects
      WHERE  object_name = 'SEQUENCE_NAME_SEQ'
      AND    object_type = 'SEQUENCE';
BEGIN
   OPEN  check_exists;
   FETCH check_exists INTO seq_exists_;
   IF (check_exists%NOTFOUND) THEN
      seq_exists_ := 0;
   END IF;
   CLOSE check_exists;
   
   IF (seq_exists_ = 0) THEN
      Database_SYS.Create_Sequence('SEQUENCE_NAME_SEQ', 'MINVALUE 1 START WITH 1 INCREMENT BY 1');
   END IF;
END;
/

No comments:

Post a Comment

Read file content from an Oracle Directory in PL/SQL/ in IFS

Read single file DECLARE file_handle_ UTL_FILE.FILE_TYPE; directory_name_ CONSTANT all_directories.directory_name%TYPE := '...

Popular Posts