Samedi 17 novembre 2007

Steve Cosner, on the OTN Forms' forum explains how he successfully installed Forms 6i on Windows Vista.

par Francois Degrelle publié dans : Oracle Forms
ajouter un commentaire commentaires (0)    créer un trackback recommander
Mardi 6 novembre 2007
This Java Bean allows to process massive updates to the Forms source files (.FMB) through an XML input file.


The goal is to hide the complexity of the Java/JDAPI stuff for those people that do not have time/skill to implement this Java API.

 
All the work expected to be done on the FMB files is described in a XML file.

JDAPI Utility

Read the article
par Francois Degrelle publié dans : Oracle Forms
ajouter un commentaire commentaires (0)    créer un trackback recommander
Vendredi 26 octobre 2007
It seems that many people would like to apply massive changes within their existing Forms applications, but do not have the skill (or the time) to deal with the Oracle JDAPI stuff.

I have started a project targeting to do this kind of massive changes from a JavaBean, so a simple Forms module, fed by an XML input file.
Actually, the project is able to do the following transformations:

Triggers:
 - Add pl/sql code to existing trigger (before or after existing code). Create the trigger if it does not exist.
 - Remove an existing trigger
 - Change the execution hierarchy of an existing trigger
 - Replace some PL/SQL code by another one
 - Delete some PL/SQL code

Program units:
 - Add a program unit
 - Replace some PL/SQL code by another one
 - Delete some PL/SQL code

PL/SQL Libraries:
 - Rename all attached libraries to lowercase or uppercase
 - Attach a library
 - Detach a library

Object libraries:
 - Subclass a component from an Object library

Miscellaneous:
 - Compile the module after changes


I need your participation, and wait for your comments to add more valuable features.
If you already have this kind of problem to solve, feel free to send me your comments and give details about what you would be expecting from this project.
par Francois Degrelle publié dans : Oracle Forms
ajouter un commentaire commentaires (4)    créer un trackback recommander
Samedi 29 septembre 2007
par Francois Degrelle publié dans : Oracle Forms
ajouter un commentaire commentaires (0)    créer un trackback recommander
Mardi 25 septembre 2007

It is frequently asked how to load a BLOB table column from the content of an external file.
This can be achieved by using the DBMS_LOB package's functions.
Sometimes it is also useful to extract the BLOB content back to a file.

Here is a procedure that achieves this task:
(Available since Oracle database 9i, that introduced the UTL_FILE.PUT_RAW() function)

CREATE OR REPLACE PROCEDURE Write_Binary_file
(
   PC$Directory IN VARCHAR2
  ,PC$File_Name IN VARCHAR2
  ,PC$SQL_Order IN VARCHAR2
  ,PB$Raise     IN BOOLEAN DEFAULT FALSE
)
-- -------------------------------------------
-- Procedure to dump a BLOB column onto a file
-- -------------------------------------------
-- parameters:
-- PC$Directory : name of an existing Oracle Directory
-- PC$File_Name : name of the expected output file
-- PC$SQL_Order : SQL order to select the BLOB column
-- PB$Raise     : boolean to indicate if the process
--                would be stopped after an error
--

IS
  src_lob    BLOB;
  buffer     RAW(16384);
  amt        BINARY_INTEGER := 16384;
  pos        INTEGER := 1;
  LF$FicOUT  UTL_FILE.FILE_TYPE ;
  LC$Msg     VARCHAR2(2000) ;
BEGIN

-- get the BLOB column --
BEGIN
  EXECUTE IMMEDIATE PC$SQL_Order INTO src_lob ;
EXCEPTION
  WHEN NO_DATA_FOUND THEN
    LC$Msg := 'Write_Binary_File(): NO_DATA_FOUND' ;
    IF PB$Raise THEN
      RAISE_APPLICATION_ERROR( -20100, LC$Msg ) ;
    END IF ;
    Dbms_Output.Put_Line(LC$Msg) ;
  RETURN ;
END ;

-- open the output file --
LF$FicOUT := UTL_FILE.FOPEN( PC$Directory, PC$File_Name, 'W', 32764 ) ;

-- write the file --
LOOP
  -- read the chunks --
  Dbms_Lob.READ (src_lob, amt, pos, buffer);
  -- write the chunks --
  Utl_File.Put_Raw(LF$FicOut, buffer);
  pos := pos + amt;
END LOOP;
-- close the file --
Utl_File.Fclose(LF$FicOut);

EXCEPTION
  WHEN NO_DATA_FOUND THEN
    utl_file.fclose(LF$FicOut);
  WHEN OTHERS THEN
    LC$Msg := 'Write_Binary_File() Error : ' || TO_CHAR( SQLCODE ) || ' while managing file ('
|| PC$Directory || ') ' || PC$File_Name ;
    IF PB$Raise THEN
      RAISE_APPLICATION_ERROR( -20100, LC$Msg ) ;
    END IF ;
    Dbms_Output.Put_Line(LC$Msg);
END Write_Binary_file;
/


Here is a calling sample:
BEGIN
  Write_Binary_file
  (
     'OUTPUT_DIRECTORY'
    ,'image.jpg'
    ,'select image from images where id=3'
  );
END;

par Francois Degrelle publié dans : Oracle PL/SQL
ajouter un commentaire commentaires (2)    créer un trackback recommander
Créer un blog sur over-blog.com - Contact - C.G.U. - Rémunération en droits d'auteur avec TF1 Network - Signaler un abus