A text_io problem: ORA-302000

Hi,all:
I have 2 apps on form.
The first one is to read from file, and the second is to write on the file.
Firstly, i have created the file on the server, and the file(abc.txt)'s permission is rwxr--r--.
Then i tested the first one, it can read from file well.
But when i tested the second, it throwed a exception: ORA-302000.
I was so confused. why it can read from file with text_io, but can not write?
Can anyone help me to solve this problem, Thanks so much.
Here's my code:
1.WHEN-BUTTON-PRESSED(to read): works fine
DECLARE
     in_file text_io.file_type;
     line_bufer varchar2(80);
     lv_strtmp varchar2(100);
     errnum NUMBER                := ERROR_CODE;
     errtxt VARCHAR2(80) := ERROR_TEXT;
     errtyp VARCHAR2(3)      := ERROR_TYPE;
BEGIN
     in_file := text_io.fopen('/home/cn01278/abc.txt', 'r');
     text_io.Get_Line(in_file,line_bufer);
     lv_strtmp := substr(line_bufer, 1,10);
     :blk_text.txt_content := :blk_text.txt_read_err || lv_strtmp;
     text_io.Fclose(in_file);
END;
2.WHEN-BUTTON-PRESSED(to write): thown an exception
DECLARE
          out_file text_io.file_type;
          line_bufer varchar2(80);
          lv_strtmp varchar2(100);
          lv_content varchar2(100);
          errnum NUMBER := ERROR_CODE;
          errtxt VARCHAR2(80) := ERROR_TEXT;
          errtyp VARCHAR2(3) := ERROR_TYPE;
BEGIN
     message('111',acknowledge);
          out_file := text_io.fopen('/home/cn01278/abc.txt', 'w');
          message('222',acknowledge);
          text_io.put('123');
          text_io.new_line;
          text_io.put_line(out_file, 'abcd...');
     text_io.fclose(out_file);
END;
3.ON-ERROR Trigger
DECLARE
     errnum NUMBER := ERROR_CODE;
     errtxt VARCHAR2(80) := ERROR_TEXT;
     errtyp VARCHAR2(3) := ERROR_TYPE;
BEGIN
message('error:',acknowledge);
     Message(errtyp||'-'||TO_CHAR(errnum)||': '||errtxt,acknowledge);
     --:blk_text.txt_err := errtyp||'-'||TO_CHAR(errnum)||': '||errtxt;
     text_io.fclose(out_file);
     RAISE Form_Trigger_Failure;
END;
-----------------------------------------------------------------------------------

Thanks for attension.
the problem is resolved, it's a access/right problem with the file(abc.txt).
after i change the file permission from rwxr--r-- to rwxrw-rw-, then it works fine.
But I have some confuse about it.
1.The file must exist firstly. if not, then read or wirte the file will cause the ORA-302000 error. Can the file not exist? Can anyone tell me how to create file(abc.txt) with text_io if the file not exist.
2.If the file was created by A, and A have rw rights, but the group owner have no rw rights, then you run the form by A(connect DB by A), it would cause ORA-302000 error too(both read and write).Why the group owner must have rw rights, or the form can not works fine?
By the way, my DB account and my App server(Linux) account are same(both A).

Similar Messages

  • URGENT : ORA 302000 when using TEXT_IO.fopen

    Hi,
    I get this error ORA 302000 when using TEXT_IO package, the code I use is
    new_file:=text_io.fopen('c:\text.txt','r')
    i don't have the description of this ORA 302000 , pls does anyone have it?

    Hi,
    I know it's been 2 years but it's still up to date for me.
    I tried the suggested piece of code to trace the error but it did not bring anything more
    EXCEPTION
    When Others then
    srw.Message( 2, 'EXCEPTION ' || SQLCODE || ' in common package. Can not open the file ');
    IF SQLCODE = -302000 then
    LOOP
    EXIT WHEN TOOL_ERR.NERRORS = 0;
    SRW.MESSAGE( 667, TO_CHAR(TOOL_ERR.CODE) || ': ' || TOOL_ERR.MESSAGE);
    TOOL_ERR.POP;
    END LOOP;
    END IF;
    srw.Message( 3, 'EXCEPTION ' || SQLCODE || ' in com package. Can not open the file ' || I_Desname || ' : ' || SQLERRM );
    Only Message 2 and 3 are displayed in the trace file
    Any other suggestion?
    Manu

  • ORA-302000 Error On client_text_io.fopen()

    i am using a webutil library - client_text_io.fopen() on the form that was compiled on 10.1.2.3 version and this webutil_file.file_selection_dialog() built-in package. the webutil_file.file_selection_dialog() works but not the client_text_io.fopen(). when the form is run on the application server it is getting this error ORA-302000.
    PROCEDURE prc_load_proj_alloc_data IS
      vFilename             VARCHAR2(100) := :control.drv_filename;
      vInputFile             client_text_io.FILE_TYPE;
      vLinebuf               VARCHAR2(2000);
      vCommaPosition     NUMBER := 0;
      TYPE                array_type IS VARRAY(10) OF VARCHAR2(100);
      vColumn            array_type := array_type('');
      vCtr                  BINARY_INTEGER := 1;
      vRowCtr            number := 0;
      vLineLoadCnt     number := 0;
    begin
      -- cursor must be placed on the block
      go_block('MRC_PROJ_ALLOC_INTERFACE');
      go_item('MRC_PROJ_ALLOC_INTERFACE.ATTRIBUTE1'); 
      --extend and initialize the array to 9 columns
      vColumn.EXTEND(9,1);
      -- open the file for reading
      begin
        vInputFile := client_text_io.fopen(vFilename,'r');
      exception
           when others then
             alertme('note','SQLCODE '||SQLCODE);
             if SQLCODE = -302000 then
                  alertme('note',errtyp||'-'||TO_CHAR(errnum)||': '||errtxt);
            loop
              alertme('note',TO_CHAR(TOOL_ERR.CODE) || ': ' || TOOL_ERR.MESSAGE);
              TOOL_ERR.POP;
              exit when TOOL_ERR.NERRORS = 0;
            end loop;
          end if;
      end;
    end;
        the file that i am trying to read is in csv format and is not currently in use. i tried any other file from my local C:\ or D:\ drive and i am getting the same error. what could possiblly that i am missing? thanks.

    we figured it out that the cause of issue was that the webutil.plx was on our application executable directory. basically we have the webutil.plx on a common directory applicable to other application and when we removed the webutil.plx on our application directory the ORA-302000 error was solved.

  • Fundamental Problem: ORA-12154: TNS:could not resolve service name

    Hello,
    I am faced with a fundamental problem:
    ORA-12154: TNS:could not resolve service name
    I can say with a high level of confidence that the TNSNAMES.ora configuration file is not the problem. My peer is using the exact same file with no issues. I am using the TOAD database utility to connect to the db host. Also, I have ORACLE_HOME defined and the file is located in /network/ADMIN.
    Any ideas?

    Hello,
    Make sure your toad looking into right tnsnames.ora; also try this from command line after adding following entry to your tnsnames.ora.
    sqlplus username/password@ECDEV
    ECDEV =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS =
            (PROTOCOL = TCP)
            (HOST = rscdd01)  --> you can try ipaddress of your server name as well
            (PORT = 1521)
        (SDU = 8192)
        (CONNECT_DATA =
          (SERVICE_NAME =ECDEV)
          (INSTANCE_NAME=ECDEV)
      )Edited by: OrionNet on Dec 23, 2008 2:22 PM

  • ORA-302000 error

    I am getting a error ORA-302000 which is not showing in Oracle documentation help from my Developer form. Please help.
    regards.

    we figured it out that the cause of issue was that the webutil.plx was on our application executable directory. basically we have the webutil.plx on a common directory applicable to other application and when we removed the webutil.plx on our application directory the ORA-302000 error was solved.

  • The Script root.sh problem - ora.asm and ASM and Clusterware Stack failed

    Folks,
    Hello. I am installing Oracle 11gR2 RAC using 2 VMs (rac1 and rac2) whose OS are Oracle Linux 5.6 in VMPlayer according to the website http://appsdbaworkshop.blogspot.com/2011/10/11gr2-rac-on-linux-56-using-vmware.html
    I am installing Grid infrastructure. On step 9 of 10 - execute script /u01/app/grid/root.sh for 2 VMs rac1 and rac2.
    After run root.sh in rac1 successfully. I run root.sh in rac2 and get an error as below:
    [root@rac2 grid]# ./root.sh
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
    ORACLE_OWNER= ora11g
    ORACLE_HOME= /u01/app/grid
    Enter the full pathname of the local bin directory: [usr/local/bin]: /usr/local/bin
    Copying dbhome to /usr/local/bin ...
    Copying oraenv to /usr/local/bin ...
    Copying coraenv to /usr/local/bin ...
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    2012-03-05 16:32:52: Parsing the host name
    2012-03-05 16:32:52: Checking for super user privileges
    2012-03-05 16:32:52: User has super user privileges
    Using configuration parameter file: /u01/app/grid/crs/install/crsconfig_params
    Creating trace directory
    LOCAL ADD MODE
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    Adding daemon to inittab
    CRS-4123: Oracle High Availability Services has been started.
    ohasd is starting
    CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminating
    An active cluster was found during exclusive startup, restarting to join the cluster
    CRS-2672: Attempting to start 'ora.mdnsd' on 'rac2'
    CRS-2676: Start of 'ora.mdnsd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.gipcd' on 'rac2'
    CRS-2676: Start of 'ora.gipcd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'rac2'
    CRS-2676: Start of 'ora.gpnpd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'
    CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.cssd' on 'rac2'
    CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'
    CRS-2676: Start of 'ora.diskmon' on 'rac2' succeeded
    CRS-2676: Start of 'ora.cssd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.ctssd' on 'rac2'
    Start action for octssd aborted
    CRS-2676: Start of 'ora.ctssd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac2'
    CRS-2672: Attempting to start 'ora.asm' on 'rac2'
    CRS-2676: Start of 'ora.drivers.acfs' on 'rac2' succeeded
    CRS-2676: Start of 'ora.asm' on 'rac2' succeeded
    CRS-2664: Resource 'ora.ctssd' is already running on 'rac2'
    CRS-4000: Command Start failed, or completed with errors.
    Command return code of 1 (256) from command: /u01/app/grid/bin/crsctl start resource ora.asm -init
    Start of resource "ora.asm -init" failed
    Failed to start ASM
    Failed to start Oracle Clusterware stack
    [root@rac2 grid]#
    As we see the output above, at the end of the output
    1) Start of resource ora.asm -init failed
    2) Failed to start ASM
    3) Failed to start Oracle Clusterware stack
    The runInstaller is in the first VM rac1. My question is:
    Do any folk understand how to solve the script root.sh in rac2 problem ( 3 fails of ora.asm, ASM and Clusterware stack as above) ?
    Thanks.

    Please check there is no firewall exist:
    try this like:
    root.sh fails on second node
    MOS note:
    11gR2 Grid: root.sh Fails to Start the Clusterware on the Second Node Due to Firewall on Private Network [ID 981357.1]
    Grid Infrastructure 11.2.0.2 Installation or Upgrade may fail due to Multicasting Requirement [ID 1212703.1] (Most probabily this issue)

  • Strange problem: ORA-01403: no data found when report has a sort

    Hi,
    I have a report which behaves very strangely but only for one particular user. The report runs fine when no columns are set as sort-by in the report attributes. As soon as I try and set a column to sort (any column, it doesn't matter) this user gets the error message:
    failed to parse SQL query:
    ORA-01403: no data found
    appear where the report should be on the page. The rest of the page displays OK. No other users are affected. If I remove the sort then the report is OK for this user (unsorted though!)
    The report is a structured query with custom column headings, nothing unusual, quite basic. I have tried exporting and reimporting the page but it doesn't fix it. Same behaviour for this particular page in our test system as well.
    I could rebuild the page but I'd rather know what is wrong in case it happens to some other region.
    Thanks,
    Steve

    Steve,
    The reports engine stores the sort settings in the user preferences. This is done so that when you return to a report, it maintains the earlier sort settings. Like in your response to the HTML DB studio posting, you would keep your report sorted by "Created On" descending or ascending even when you come back another time. It's save to remove those preferences; all that's going to happen is that your users will see the report using the report's default settings the next time they go to that page. I will try to investigate this problem further, whatever additional information you can provide, will be helpful,
    Marc

  • Ldap problem, ORA-06521: PL/SQL: Error mapping function

    I am getting this error(s)
    ORA-06521: PL/SQL: Error mapping function
    ORA-06512: at "SYS.DBMS_LDAP_API_FFI", line 0
    ORA-06512: at "SYS.DBMS_LDAP", line 1338
    ORA-06512: at "SYS.DBMS_LDAP", line 1273
    ORA-06512: at "SYS.DBMS_LDAP", line 529
    ORA-06512: at line 127
    after binding and searching an ldap directory.
    Line 127 is:
    my_dn := DBMS_LDAP.get_dn(my_session, my_entry);
    Both of the 'my_xx' parameters have been successfully set earlier in the script I believe as they produce no errors and DBMS_LDAP.count_entries(my_session, my_message) returns = 1.
    I am following the example at:
    http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96577/smplcode.htm#636994
    In fact any of the functions used in the 'while loop' in the above example give a similar error.
    Apparently SYS.DBMS_LDAP_API_FFI is a call to an external C program, but this would be a standard Oracle one, not one I have written.
    I am connecting to a non-Oracle ldap server, and have tried several (OpenLDAP 2.X, & Windows 2000 AD), with same results.
    Any suggestions gratefully received.
    Cheers
    KIM

    Scott,
    Thanks for your concern. I should have explained. I am working in HTMLdb, successfully using ldap to authenticate, but now need to get the logged-in user's name and other details. All my attemps to use the wwv_flow_ldap functions have failed, and I am no resorting to DBMS_LDAP to get what I want. I am hoping thatsome helpful person can shed some light on this problem
    Cheers
    KIM

  • Oracle DR Setup Problems / ORA - 600 /

    Dear All,
    Recently we have implemented DR(Disaster Recovery setup Using Oracle data guard in 10g, GUI configurations ) in our Production server. The DR setups are based on the Maximum performance with Realtime apply mode.
    The configuration went fine and both servers(DR and ) were syncing fine together as well.
    But unfortunately, there was a power failure in the DR site(Which is on the other network) and also the UPS also went down after some time, the real problem started here,
    Once the DR server was down, after sometime we are not able to login in to the production system, Interestingly, both DB server and application server are running fine. But we are not able to login into server - SAPGUI hangs. There are no such error written in SAP level and but in oracle alert log, we found out ORA 600 error and also connection timed out for placing the archive log(log_destination_2) in the standby server(This is the DR server - And due to power failure, its not able to reach the server for placing the archive log file )
    Temporary solution,
    If we restart the production server, we are able to work continuously in the production system without any problem.
    So, my query is that, what makes the production system hangs if DR server is unavailable and how it work if we restart the instance? Is this the normal procedure in DR setup? or its a bug in the oracle data guard or in the parameter log_archive_dest2?
    Looking forward for your answers with your valuable suggestions
    For the reference, I am pasting a part of alert log
    Detected ARCH process failure
    ARCH: STARTING ARCH PROCESSES
    ARC1: Archival started
    ARCH: STARTING ARCH PROCESSES COMPLETE
    ARC1 started with pid=92, OS id=4296940
    ARC1: Becoming the heartbeat ARCH
    Sat Oct 30 02:30:54 2010
    WARNING: inbound connection timed out (ORA-3136)
    Sat Oct 30 02:31:54 2010
    WARNING: inbound connection timed out (ORA-3136)
    Sat Oct 30 02:33:33 2010
    Incremental checkpoint up to RBA [0x2e2b7.cf96.0], current log tail at RBA [0x2e2b7.cf96.0]
    Sat Oct 30 02:37:14 2010
    WARNING: inbound connection timed out (ORA-3136)
    Sat Oct 30 02:37:52 2010
    GES: Potential blocker (pid=2056210) on resource CF-00000000-00000000;
    enqueue info in file /oracle/XXX/saptrace/background/xxx_rsm0_2015456.trc
    Sat Oct 30 02:38:14 2010
    WARNING: inbound connection timed out (ORA-3136)
    Sat Oct 30 02:38:22 2010
    Errors in file /oracle/XXX/saptrace/background/xxx_rsm0_2015456.trc:
    ORA-00600: internal error code, arguments: [2103], [1], [0], [1], [900], [], [], []
    Sat Oct 30 02:40:30 2010
    GES: Potential blocker (pid=2056210) on resource CF-00000000-00000000;
    enqueue info in file /oracle/xxx/saptrace/background/xxx_arc0_4329544.trc
    Sat Oct 30 02:41:00 2010
    Errors in file /oracle/xxx/saptrace/background/xxx_arc0_4329544.trc:
    ORA-00600: internal error code, arguments: [2103], [1], [0], [1], [900], [], [], []
    Sat Oct 30 02:41:02 2010
    Errors in file /oracle/xxx/saptrace/background/xxx_arc0_4329544.trc:
    ORA-00600: internal error code, arguments: [2103], [1], [0], [1], [900], [], [], []
    Sat Oct 30 02:41:02 2010
    Errors in file /oracle/xxx/saptrace/background/xxx_arc0_4329544.trc:
    ORA-00600: internal error code, arguments: [2103], [1], [0], [1], [900], [], [], []
    Sat Oct 30 02:41:02 2010
    Errors in file /oracle/xxx/saptrace/background/xxx_arc0_4329544.trc:
    ORA-00600: internal error code, arguments: [2103], [1], [0], [1], [900], [], [], []
    Sat Oct 30 02:41:02 2010
    Errors in file /oracle/xxx/saptrace/background/xxx_arc0_4329544.trc:
    ORA-00600: internal error code, arguments: [2103], [1], [0], [1], [900], [], [], []
    Sat Oct 30 02:41:02 2010
    Errors in file /oracle/xxx/saptrace/background/xxx_arc0_4329544.trc:
    ORA-00600: internal error code, arguments: [2103], [1], [0], [1], [900], [], [], []
    Sat Oct 30 02:41:06 2010
    ARCH: Detected ARCH process failure
    ARCH: STARTING ARCH PROCESSES
    ARC0: Archival started
    ARCH: STARTING ARCH PROCESSES COMPLETE
    ARC0 started with pid=91, OS id=1642728
    ARC0: Becoming the 'no FAL' ARCH
    ARC0: Becoming the 'no SRL' ARCH
    Sat Oct 30 02:42:20 2010
    WARNING: inbound connection timed out (ORA-3136)
    Sat Oct 30 02:42:33 2010
    GES: Potential blocker (pid=2056210) on resource CF-00000000-00000000;
    enqueue info in file /oracle/xxx/saptrace/background/xxx_arc1_4296940.trc
    Sat Oct 30 02:43:03 2010
    Errors in file
    Thanks and Regards
    Vijay Kumar G

    Hi Vijay,
    Get oracle metalink ID from service market place and search for  you will get handy information
    ORA-600 [2103] "Timeout on 'Control file' or 'Checkpoint Progress' Enqueue" [ID 28045.1]
    Also one very good tool to analyse [Metalink|https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=153788.1]
    Regards,

  • Outer join problem (ORA-01799)

    We have a database design roughly as follows:
    - A STAFF table (columns don't matter here).
    - Resources have a cost per hour that varies over time, so we have a STAFF_COST table with an effective date and a cost per hour
    - A PROJECT table (columns don't matter here).
    - Projects can have staff assigned, so we have a PROJECT_STAFF table which has foreign keys to the PROJECT and STAFF table.
    - Project staff have a cost per hour, which can vary over time, and be different to the (default) staff costs. So we have a PROJECT_STAFF_COST table which uses the PROJECT_STAFF foreign key, with an effective date and a cost per hour
    - Staff work on tasks so we have a TIMESHEET_TASK and TIMESHEET_DAY tables which define a project worked on, task within the project (optional as time can be 'entered against the project', who is recording the time, the hours worked and the day the hours were worked.
    So when timesheet information is entered we have three scenario's that we need to cover.
    1) The resource is a member of the project and the hours were worked on a day for which we have a project staff cost. That is, the project staff cost table has one or more rows for the staff member assigned to the given project with an effective date before the date the hours were entered against.
    2) The resource is a member of the project but the hours were worked on a day for which we do not have a project staff cost. That is, the project staff cost table has one or more entries for the staff member assigned to the given project, but all the effective dates are after the date the hours were entered against.
    3) The resource is not a member of the project. That is, the project staff cost table does not have any rows for the staff member. Time was entered 'against the project'.
    We need to work out the actual cost of the project. So we need to retrieve every day's timesheet entry, returning the hours assigned and the cost per hour relevant for that day. I have the following query:
    select tsh.staff_id, s.full_name, tsd.entry_date, tsd.hours as ProjectHours,
    psCOST_INFO.cost_per_hour as ProjectCost
    from timesheet_day tsd
    inner join timesheet_task tst on tst.timesheet_task_id = tsd.timesheet_task_id
    inner join timesheet_header tsh on tst.timesheet_header_id = tsh.timesheet_header_id
    inner join staff s on s.staff_id = tsh.staff_id
    left join (Select ps.project_id, ps.staff_id, psc.project_staff_id, psc.effective_date, psc.cost_per_hour
    from project_staff ps
    inner join project_staff_cost psc on ps.project_staff_id = psc.project_staff_id) as psCOST_INFO
    on psCOST_INFO.staff_id = tsh.staff_id and psCOST_INFO.project_id = tst.project_id
    and psCOST_INFO.effective_date = (select max(ps2.effective_date) from project_staff_cost ps2
    where ps2.project_staff_id = psCOST_INFO.project_staff_id
    and ps2.effective_date <= tsd.entry_date)
    where tst.project_id = 55825
    Using the left join covers scenario's 2 and 3 above because I will get null in the cost columns and can then take appropriate action. If I were to use an inner join, then hours in timesheets from scenario's 2 and 3 would be excluded, which is not what we want.
    The subselect using the MAX aggregate function is required to get the cost per hour most relevant for the timesheet day. That is, if there are several effective dates for the project staff member before the date in question, we want the most recent one. We can't just use the MAX one, however in case there is an effective date after the particular timesheet date. Sheesh...
    This query works fine in SQL Server. It it not allowed in Oracle and returns an ORA-01799 column may not be outer joined to a subquery.
    I'm not going to bother to ask why not. I just need a way to do what I want. I've spent days trying to move the code around but I either end up with an inner join (which returns fewer rows than I want) or it just plain don't work.
    Can someone help me rework this query to achieve the result I want?
    Thanks, Andrew

    Thanks for your reply, Laurent. In my experience trying to cut important corners in explaining a problem only serves to make it more difficult to solve. That pretty much was the smallest reproducable query that demonstrates the complexity of the problem I have. I'm not just trying to get which publishers live in the 'CA' state here...
    From what I have just read about rank() it serves the same purpose as max() on a given column, and getting the maximum or top ranked one just doesn't cut it. As I said in my original post that provided all the relevant (and no spurious) information on the problem, it is possible that there are effective dates AFTER the date we are interested in and they have to be excluded.
    I have to get the project staff cost row with the latest date that is before the timesheet date. That means I have to reference data in the outer query. Oracle seems to have a problem with that when used in an outer join.
    We are currently going down the track of 3 UNION'd statement to cover the 3 scenario's. A single query would be more efficient so if anyone can provide guidance I would appreciate it.
    Thanks, Andrew

  • Materialized view problem ORA-00904: "from$_subquery$_ error

    Hello everyone,
    I've created data warehouse star schema and I'm trying to set up materialized view. DBMS_MVIEW.EXPLAIN_MVIEW passes and also the select query passes and is executed with no problems but when I try to CREATE MATERIALIZED VIEW... then error ORA-00904: "from$_subquery$_003"."SERVICE_ID_2_2": invalid identifier pops-up. How does Oracle 9i (9.2.0.1.0) managed to do this ? How to make it to work ?
    This is the query, and the schema:
    CREATE MATERIALIZED VIEW analiza_profitabilnosti
    BUILD IMMEDIATE
    REFRESH FAST
    ON COMMIT
    AS
    select
    GROUPING_ID(t.y,t.q,t.m,t.w,t.d,s.service_type,s.service_id,c.customer_category) as g_id,
    t.y, t.q, t.m, t.w, t.d,
    s.service_type , s.service_id ,
    c.customer_category ,
    COUNT(*) as c_star,
    SUM(cost) cost, COUNT(cost) c_cost,
    SUM(number_of_units) number_of_units, COUNT(number_of_units) as c_number_of_units
    from fact f
    inner join timeline t on f.datum = t.datum
    inner join service s on f.service_id = s.service_id
    inner join customer_category c on f.customer_category=c.customer_category
    group by
    ROLLUP(t.y, t.q, t.m, t.w, t.d),
    ROLLUP(s.service_type, s.service_id),
    ROLLUP (c.customer_category)
    and the schema:
    FACT (
    DATUM DATE,
    HOST_ID NUMBER,
    SERVICE_ID NUMBER (5),
    CALLED_PREFIX_ID NUMBER (10),
    CUSTOMER_CATEGORY NUMBER,
    TRAFIC_PERIOD_ID NUMBER (5),
    CALL_DURATION NUMBER,
    COST NUMBER,
    NUMBER_OF_UNITS NUMBER,
    NUMBER_OF_CALLS NUMBER)
    TIMELINE (
    Y VARCHAR2 (5),
    Q VARCHAR2 (5),
    M VARCHAR2 (5),
    W VARCHAR2 (5),
    D VARCHAR2 (5),
    DATUM DATE NOT NULL)
    SERVICE (
    SERVICE_ID NUMBER (5) NOT NULL,
    SERVICE_CODE VARCHAR2 (15) NOT NULL,
    SERVICE_NAME VARCHAR2 (63),
    SERVICE_TYPE NUMBER (5),
    SERVICE_TYPE_CODE VARCHAR2 (4) NOT NULL,
    S_ID NUMBER (5))
    CUSTOMER_CATEGORY (
    CUSTOMER_CATEGORY_NAME VARCHAR2 (65) NOT NULL,
    CUSTOMER_CATEGORY NUMBER NOT NULL)
    Thanks,
    Igor

    Yes, thank you. I suspected that version is problem, and patch 9.2.0.6 helped. It works under 9.2.0.6

  • Inconsistent datatypes problem (ORA-00932)

    Hi all,
    Given the following two tables , located in two different schemas :
    CREATE TABLE schema1.national_desc
    (     ENT CHAR(18 CHAR),
         COD_MAJ CHAR(1 CHAR),
         SID_DESC_COD_ADD NUMBER(8,0),
         ID_LANG CHAR(2 CHAR) DEFAULT 'FR',
         SID_COD_ADD NUMBER(8,0),
         ID_TYP_COD_ADD CHAR(1 CHAR),
         COD_ADD CHAR(3 CHAR),
         L_DESC NCLOB,
         DAT_MAJ DATE DEFAULT SYSDATE,
         DAT_MAD DATE,
         LL_DESC NCLOB,
         CONSTRAINT pk_national_desc PRIMARY KEY (SID_DESC_COD_ADD, ID_LANG)
    CREATE TABLE schema2.european_desc
    (     ENT CHAR(18 CHAR),
         COD_MAJ CHAR(1 CHAR),
         SID_DESC_COD_ADD NUMBER(8,0),
         ID_LANG CHAR(2 CHAR),
         SID_COD_ADD NUMBER(8,0),
         ID_TYP_COD_ADD CHAR(1 CHAR),
         COD_ADD CHAR(3 CHAR),
         L_DESC NCLOB,
         CONSTRAINT pk_european_desc PRIMARY KEY (SID_DESC_COD_ADD, ID_LANG)
    )we try this query :
    SELECT
    '1' origine,
    sid_cod_add,
    l_desc desc_cod_add,
    TO_CHAR (dat_mad, 'dd/mm/yyyy') dat_mad,
    TO_CHAR (dat_maj, 'dd/mm/yyyy') dat_maj
    FROM
    N24510
    WHERE
    dat_maj > '01/01/2010'
    AND id_lang='FR'
    UNION
    SELECT
    '0',
    sid_cod_add,
    l_desc,
    NULL,
    NULL
    FROM
    F24510
    where
    id_lang='FR'and Oracle complains with this error : ORA-00932.
    We have tried to "cast" the L_DESC column with TO_CHAR but some column value exceeds 4000 chars.
    Casting with TO_CLOB give the same first error.
    Any idea ?
    Stephan
    Oracle 10Gr2 - 10.2.0.3.0
    Linux 64bits

    Hi ,
    Thanks for your reply. We have finally find the problem :)
    Instead of UNION, we perform an UNION ALL. With UNION Oracle had to check unicity
    between rows containing NCLOB columns...
    Hopefully, in our case UNION ALL does the trick !
    Stephan

  • Procedure Problem ORA-20000 / ORA-20001

    Hello,
    I have problems with the following procedure - in both cases the problem seems to be in line 115 (RAISE;):
    CREATE OR REPLACE PROCEDURE EFWP."P_BUILD_VOP_ENVELOPE"(
    paramPlanungId LONG,
    paramEnvelopeWKTPolygon VARCHAR)
    AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    -- bereits bestehende alte Daten löschen
    DELETE
    FROM EFWP.TEFWP_VOP_PL T0
    WHERE T0.PLANUNG_ID = paramPlanungId;
    -- neue Daten erstellen
    INSERT
    INTO EFWP.TEFWP_VOP_PL
    WID_ID,
    OBJEKT,
    GEMOESTAT,
    WIDMUNG,
    STAND,
    EMASST,
    BESCHTXT,
    BEZEICHNG,
    FESTLEGUNG,
    FESTLEG02,
    ZAEHLER,
    ANZ_FRZTWS,
    ANZ_BETTEN,
    ANZ_RAEUME,
    FL_KUNDEN,
    FL_KUNDLM,
    BETRIEBTYP,
    SV_EBENE,
    SV_EBENENR,
    SV_KENN,
    BEFRISTUNG,
    CREATEUSER,
    CREATETIMESTAMP,
    UPDATEUSER,
    UPDATETIMESTAMP,
    EFWP_ID,
    STATUS,
    PLANUNG_ID,
    SHAPE,
    OBJECTID
    SELECT FW.WID_ID,
    FW.OBJEKT,
    FW.GEMOESTAT,
    FW.WIDMUNG,
    FW.STAND,
    FW.EMASST,
    FW.BESCHTXT,
    FW.BEZEICHNG,
    FW.FESTLEGUNG,
    FW.FESTLEG02,
    FW.ZAEHLER,
    FW.ANZ_FRZTWS,
    FW.ANZ_BETTEN,
    FW.ANZ_RAEUME,
    FW.FL_KUNDEN,
    FW.FL_KUNDLM,
    FW.BETRIEBTYP,
    FW.SV_EBENE,
    FW.SV_EBENENR,
    FW.SV_KENN,
    FW.BEFRISTUNG,
    FW.CREATEUSER,
    FW.CREATETIMESTAMP,
    FW.UPDATEUSER,
    FW.UPDATETIMESTAMP,
    FW.EFWP_ID,
    FW.STATUS,
    paramPlanungId,
    SDE.ST_DIFFERENCE (FW.SHAPE, PB.SHAPE),
    DBATOOLS.F_GET_NEXT_OBJECTID('EFWP', 'TEFWP_VOP_PL')
    FROM
    (SELECT T0.WID_ID,
    T0.OBJEKT,
    T0.GEMOESTAT,
    T0.WIDMUNG,
    T0.STAND,
    T0.EMASST,
    T0.BESCHTXT,
    T0.BEZEICHNG,
    T0.FESTLEGUNG,
    T0.FESTLEG02,
    T0.ZAEHLER,
    T0.ANZ_FRZTWS,
    T0.ANZ_BETTEN,
    T0.ANZ_RAEUME,
    T0.FL_KUNDEN,
    T0.FL_KUNDLM,
    T0.BETRIEBTYP,
    T0.SV_EBENE,
    T0.SV_EBENENR,
    T0.SV_KENN,
    T0.BEFRISTUNG,
    T0.CREATEUSER,
    T0.CREATETIMESTAMP,
    T0.UPDATEUSER,
    T0.UPDATETIMESTAMP,
    T0.EFWP_ID,
    T0.STATUS,
    SDE.ST_INTERSECTION(SDE.ST_POLYGON( paramEnvelopeWKTPolygon , DBATOOLS.F_GET_SRID('EFWP', 'TEFWP_PL')), T0.SHAPE) AS SHAPE
    FROM EFWP.TEFWP_PL T0
    WHERE T0.STATUS = '1'
    AND SDE.ST_INTERSECTS(T0.SHAPE, SDE.ST_POLYGON( paramEnvelopeWKTPolygon , DBATOOLS.F_GET_SRID('EFWP', 'TEFWP_PL'))) = 1
    ) FW,
    EFWP.TEFPBER_PL PB
    WHERE PB.PLANUNG_ID = paramPlanungId ;
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    -- log_error( .... );
    RAISE;
    /* this is crucial, you MUST re-raise the exception */
    END;
    The problems:
    1. CALL EFWP.P_BUILD_VOP_ENVELOPE(629,'POLYGON ((84162.4 238985.685, 84162.4 239479.37, 84616.79999999999 239479.37, 84616.79999999999 238985.685, 84162.4 238985.685))'); ==>
    sqldeveloper: no problems
    toad:
    CALL EFWP.P_BUILD_VOP_ENVELOPE(629,'POLYGON ((84162.4 238985.685, 84162.4 239479.37, 84616.79999999999 239479.37, 84616.79999999999 238985.685, 84162.4 238985.685))')
    Error at line 1
    ORA-29903: Fehler bei der Ausführung von Routine ODCIIndexFetch()
    ORA-20001: OCI-21500: Interner Fehlercode, Argumente: [17112], [0x001DEF178], [], [], [], [], [], []
    ORA-06512: in "EFWP.P_BUILD_VOP_ENVELOPE", Zeile 115
    2. call efwp.p_build_vop_envelope (1006, 'POLYGON ((84890.215 238977.38, 84890.215 239301.585, 85119.685 239301.585, 85119.685 238977.38, 84890.215 238977.38))' ); ==>
    sqldeveloper:
    call efwp.p_build_vop_envelope (1006, 'POLYGON ((84890.215 238977.38, 84890.215 239301.585, 85119.685 239301.585, 85119.685 238977.38, 84890.215 238977.38))' )
    Fehlerbericht:
    SQL-Fehler: ORA-29902: Fehler bei der Ausführung von Routine ODCIIndexStart()
    ORA-20000: Failed to get OCI Memory
    ORA-06512: in "EFWP.P_BUILD_VOP_ENVELOPE", Zeile 115
    29902. 00000 - "error in executing ODCIIndexStart() routine"
    *Cause:    The execution of ODCIIndexStart routine caused an error.
    *Action:   Examine the error messages produced by the indextype code and
    take appropriate action.
    Any ideas? Thanks for your help!
    Roland
    toad: no problems ("Method called.")

    The problems are likely related to using the LONG data type.
    Your code defines:
    paramPlanungId Long;.. and then uses it as a bind variable:
    WHERE T0.PLANUNG_ID = paramPlanungId;The LONG data type dates back to Oracle 7. Since Oracle 8, Oracle has specifically recommend NOT using it. In Oracle 11g, there is no relevant reasons to use it. Even legacy issues should have been addressed through versions 8 to 10g.
    As TOAD and SQL-Developer do not support LONGs as bind variables, and as you are supplying the value as a number, implicit number to long conversion is likely happening. This could be part of the issue that triggers the exception.
    Simple and recommended solution - remove the LONG data type from your tables and your code.

  • ExtractValue Problem----- ORA-03113: end-of-file on communication channel

    Dear Friend
    My system is now on this version
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE 9.2.0.3.0 Production
    TNS for Linux: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production
    earlier it was
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for Linux: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    I took the cold backup and restore in this version. after that my total system is working very fine, is very fast using than the previous. But only one SQL command is not working which is very urgent to solve
    when i am using this
    SELECT extractValue(value(t),'/produit/cod_pro') cod_pro
    FROM XMLTABLE X,
    TABLE ( xmlsequence (extract(XML_data,'/com/lProducts_list/produit'))) t;
    the table structure is
    SQL> desc XMLTABLE
    Name Null? Type
    DOC_ID NUMBER
    FILE_NAME VARCHAR2(100)
    FILE_DATE DATE
    XML_DATA XMLTYPE
    I got this error
    ORA-03113: end-of-file on communication channel
    Please guide me what to do to resolve this problem
    Farhad

    The error, ORA-03113: end-of-file on communication channel, is a client driver error.
    The client driver simply says "hey, the database server process servicing me has torn down our communication channel!". The communication channel is usually a TCP socket connection.
    The client driver has no idea why. Thus you have to find the answer on the server.
    The usual cause of this communication channel being closed, is the Oracle server process servicing the client session, crashing.
    When an Oracle server process crashes, it does not tell the client. It usually writes an entry to the Oracle alert log, dump a trace file, and terminates. When terminating, it tears down any communication channels (TCP sockets) it may have opened.
    Therefore you must look in
    - the alert log file for an error message listing the crash (which will include the dump file name)
    - look at this trace dump file (which is difficult if you're not familiar with Oracle internals)
    - investigate the stack trace and error codes on Metalink (which often turns up the bug notes for this, plus any workarounds or available patches)
    Usually however, one should log these types of Oracle server errors as a TAR with Oracle Support.

  • Text_io problem

    Hi everyone,
    I have a problem which I would like to share here.
    I want to make a text file from a table in Form 5.0.
    spool is not acceptable. I have made a procedure for
    that but it is working up ok point. If I left the rest
    columns then it is ok. otherwise it gives a window
    message "F50dbg32 Illigal operation" and terminates.
    PROCEDURE make_text IS
    in_file Text_IO.File_Type;
    out_file Text_IO.File_Type;
    linebuf VARCHAR2(132);
    cursor c1 is
    select * from emp;
    begin
    out_file := Text_IO.Fopen('echo.txt', 'w');
    for c1rec in c1
    LOOP
    Text_IO.New_Line(out_file,1);
    Text_IO.Putf(out_file,to_char(c1rec.empno));
    Text_IO.Putf(out_file,' '); -- for gap between columns
    Text_IO.Putf(out_file,c1rec.ename);
    Text_IO.Putf(out_file,' ');
    Text_IO.Putf(out_file,c1rec.job);
    Text_IO.Putf(out_file,' ');
    ----ok -- upto here
    Text_IO.Putf(out_file,to_char(c1rec.mgr));
    Text_IO.Putf(out_file,to_char(c1rec.hiredate));
    Text_IO.Putf(out_file,to_char(c1rec.sal));
    Text_IO.Putf(out_file,to_char(c1rec.comm));
    Text_IO.Putf(out_file,to_char(c1rec.deptno));
    END LOOP;
    EXCEPTION
    WHEN no_data_found THEN
    Text_IO.Fclose(out_file);
    END;
    Other requirement is the text in the file gets zig zag.
    I want to start every column from a fixed column in the
    text file.
    My text looks like this :-
    7499 ALLEN SALESMAN
    7521 WARD SALESMAN
    7566 JONES MANAGER
    requirement is :-
    7499 ALLEN SALESMAN
    7521 WARD SALESMAN
    7566 JONES MANAGER
    7654 MARTIN SALESMAN
    7698 BLAKE MANAGER
    If someone have solution pl suggest asap.
    thanks
    [email protected]

    I think you can try to use your own buffer to construct a text line. For example:
    buf varchar2(4000);
    LOOP
    buf:=
    to_char(c1rec.empno) || ' ' ||
    c1rec.ename || ' ' ||
    to_char(c1rec.deptno);
    text_io.put_line( buf );
    END LOOP
    I think It may solve the problem.
    I want to start every column from
    a fixed column in the text file.You could use the LPAD or RPAD functions. For example:
    buf:=
    lpad( to_char(c1rec.empno), 10, ' ' ) || ' ' ||
    lpad( c1rec.ename, 50, ' ' ) || ' ' ||

Maybe you are looking for

  • In user_tab_cols the data_type is 'undefined' for view columns

    Can anyone please confirm if this is the correct behaviour ? select table_name, column_name, data_type from user_tab_cols where table_name = 'AR_RCT_CUST_H_V' AR_RCT_CUST_H_V     RCT_CUST_ACCOUNT_NUMBER     UNDEFINED      AR_RCT_CUST_H_V     RCT_CUST

  • Ship to Party / Customer address is not correct in Third party PO Printouts

    Hi, I am creating Third party PO, concevrted from Qutation-SalesOrder -automatic PR to PO.   In these  POs,  Ship to Party address is replaced by Vendor's address in PO Printout(ME9F). How to avoid this? Is there any setting avilable in SD or MM. Thi

  • When click on button in jsp portlet, the portlet is reloaded

    Hi all I have a jsp portlet containing a number of divs and buttons. When the user clicks on a specific button, I use javascript to hide and/or display specific divs. However, in Weblogic Portal 10.3 (using IE 8 or FF 3.5.3) the whole portlet is relo

  • Issue BAPI_PO_CREATE1

    Hi, I am creating Purchase order using the BAPI , BAPI_PO_CREATE1, but the problem is that, when I am passing new Net_price  in ITEM and 'X' in ITEMX for the same, the Po is created but the price I passed is not there it is adopted from OLD.  What Pa

  • Safari "unexpectedly quitting" help please!!!

    i just got a MacBook Pro yesterday and after transferring the data from my old MacBook to the new MacBook Pro, the safari keeps "unexpectedly quitting". what should i do?!? im seriously panicking like crazy since i just LITERALLY got my MacBook Pro y