1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How can i read a xml file from forms 6i?

Discussion in 'Oracle Forms and Reports' started by p2407, Jun 26, 2017.

  1. p2407

    p2407 Starter

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    spain
    I have a XML file that i must read from an old forms 6i program. I tried to load with text_io function but when i did text_io.get_line only had the first 250 characters and unfortunally then line had many more.
    Any ideas of how can i read all the line?
    Also i tried with:

    CREATE TABLE xml_clob(
    docname VARCHAR2(100) PRIMARY KEY,
    doc CLOB,
    insertdate DATE DEFAULT SYSDATE);


    CREATE OR REPLACE PROCEDURE INSERTXML (dirname IN VARCHAR2,
    filename IN VARCHAR2)
    IS
    xmlfile BFILE;
    myclob CLOB;
    BEGIN
    INSERT INTO xml_clob (docname, doc)
    VALUES (filename, empty_clob())
    RETURNING doc into myclob;

    -- get a handle to the xml file on the OS
    xmlfile := Bfilename(dirname,filename);

    -- open the file
    DBMS_LOB.fileOpen(xmlfile);

    -- copy the contents of the file into the empty clob
    DBMS_LOB.loadFromFile(myclob, xmlfile, dbms_lob.getLength(xmlfile));

    END INSERTXML;
    /


    CONN SYS/CHANGE_ON_INSTALL@xxx
    CREATE OR REPLACE DIRECTORY XML_DIR AS 'C:\TEMP;
    GRANT ALL ON DIRECTORY XML_DIR TO PUBLIC;
    GRANT READ ON DIRECTORY XML_DIR TO SCOTT;

    But always i got ora-22288 or ora-22285 when i tried to exec insertxml

    Please any idea?
     
  2. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    748
    Likes Received:
    145
    Trophy Points:
    830
    Location:
    Russian Federation
    ora-22285 - non-existent directory or file for string operation.

    "CREATE OR REPLACE DIRECTORY XML_DIR AS 'C:\TEMP;" -- without of symbol ' .
    check your directory : SELECT * FROM all_directories d WHERE d.DIRECTORY_NAME = 'XML_DIR';
     
  3. p2407

    p2407 Starter

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    spain
     
  4. p2407

    p2407 Starter

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    spain
    I did:

    SQL> CONN SYS/CHANGE_ON_INSTALL@AVI
    SQL> CREATE OR REPLACE DIRECTORY XML_DIR AS 'C:\AAA';

    Directorio creado.

    SQL> GRANT ALL ON DIRECTORY XML_DIR TO PUBLIC;

    Concesión terminada con éxito.


    SQL> SELECT * FROM all_directories d WHERE d.DIRECTORY_NAME = 'XML_DIR';

    OWNER DIRECTORY_NAME
    ------------------------------ ------------------------------
    DIRECTORY_PATH
    --------------------------------------------------------------------------------
    SYS XML_DIR
    C:\AAA


    SQL> EXEC INSERTXML ('XML_DIR','PRUEBA.XML');
    BEGIN INSERTXML ('XML_DIR','PRUEBA.XML'); END;

    *
    ERROR en línea 1:
    ORA-22288: fallo de la operación de fichero o LOB FILEOPEN
    El sistema no puede hallar el archivo especificado.
    ORA-06512: en "SYS.DBMS_LOB", línea 475
    ORA-06512: en "SYS.INSERTXML", línea 15
    ORA-06512: en línea 1


    The c:\aaa\prueba.xml file exists

    Any idea?
     
  5. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    748
    Likes Received:
    145
    Trophy Points:
    830
    Location:
    Russian Federation
    What is your OS version and Oracle version?
    The user ORACLE has right access on directrory C:\AAA?
    What is output this script : icacls c:\aaa ?
    The user Oracle included in the group "local administrator" ?
     
    Last edited: Jun 27, 2017
  6. p2407

    p2407 Starter

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    spain
    os: Windows 2008 server
    Oracle: oracle 8i
    icacls:
    c:\AAA NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
    BUILTIN\Administradores:(I)(OI)(CI)(F)
    BUILTIN\Usuarios:(I)(OI)(CI)(RX)
    BUILTIN\Usuarios:(I)(CI)(AD)
    BUILTIN\Usuarios:(I)(CI)(WD)
    CREATOR OWNER:(I)(OI)(CI)(IO)(F)

    Se procesaron correctamente 1 archivos; error al procesar 0 archivos

    i haven't "oracle" as windows user. the path c:\aaa have "full access" to all the users.
     
  7. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    748
    Likes Received:
    145
    Trophy Points:
    830
    Location:
    Russian Federation
    1) net user oracle
     
  8. p2407

    p2407 Starter

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    spain
    net user oracle <- user oracle don't exists

    net user
    Cuentas de usuario \\namepc
    Administrador invitado
     
  9. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    748
    Likes Received:
    145
    Trophy Points:
    830
    Location:
    Russian Federation
    Oracle is runned as service and what is user(invitado?) as owner oracle-service ?
    or
    Under what user you run the Oracle?
     
  10. p2407

    p2407 Starter

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    spain
    Yes Oracle is runned as service.
    i run Oracle with the only one windows user that i have on machine. Administrator. Full access at all.

    i don't know why net user shows the user invitado, it's means guess
     
  11. p2407

    p2407 Starter

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    spain
    I made it!!!!!!!!!!!!! The problem was, i run a database that are located in a Virtual Machine...... and the path must be on the virtual machine not in the local unit....... Goooood......
    Thanks