Save a script or copy a script with SQL Script  editor

Hello,
I try to rename a script in the script repository I've loaded using the upload command.
I enter the new script name in the text field and save with the new name as the pdf doc explain (page 18-8).
It does not create any new script in the repository.
Also when i make a change and save it does not save the modification and the last modification date remains the upload date.
Can you help me ?
Thx.
Jean-Paul

Scott,
Thx for your help. I use Application Express 3.1.0.00.32 and the document I refer is Application Express User’s Guide Release 3.1 E10499-01 chapter 18 page 18-8 "Copying a script".
What I do is the following :
1) upload a file name pks_test with encoding scheme 'Western European ISO-8869-1' (to preserve accentuation characters used in the french language)
2) Edit it then modify it in the editor then save it.
3) The re-open it : the modification made at previous step has disapeared !
4) Change the name from pks_test to test_pks and the name is not changed.
Also the 'Last Updated' info is updated as if there were no change since the
script creation time.
If i do the same steps with the Hosted version of APEX (thx to Oracle) all work
fine.
There is a difference between the 2 environment :
my local (in France) display text in english (Home/Application Builder/SQL workshop ...)
the hosted (somewhere in the world) display text in french (Page d'accueil/Application Builder/SQL workshop ...)
Thx for the help

Similar Messages

  • BPA_DEMO - Problem With SQL Scripts

    Hi,
    In order to understand BPA functionality i have downloaded
    1.oracle_BPA_SUite_10.1.3.4_download.zip
    2.oracle BPA Suite 10.1.3.4 Sample
    I am trying to setup the BPA Suite and execute the Case Study in the sample -oracle BPA Suite 10.1.3.4 Sample.
    But the sql scripts requuired does not have create table scripts. the SQl scripta are placed in oracle_BPA_SUite_10.1.3.4_download.zip\samples\sql. The Scripts are:
    1.createSchema.sql
    2.populateSchemaTables.sql
    These scripts have the code for creating users and datas to be inserted in the tables but they donot have the code for creating these tables.
    If anyone has got the code to create those tables then please post.

    There's a specific [SQL Developer Forum|http://forums.oracle.com/forums/forum.jspa?forumID=260] where they're probably more knowledgeable of that tool, or readily available to give you an adequade response, if you don't mind reposting there.

  • COPY command not working SQL Commands editor

    Hi All,
    I want to have a simple 'one-button-solution' for copying few tables from an external DB into the database where my Apex application is running.
    When I issue the following from the sqlplus command line I get the following output:
    SQL> COPY FROM schema/password@tnsnames_sid TO schema/password@tnsnames_sid REPLACE TABLE_TEST USING select * from TABLE_FOREIGN;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    Table TABLE_TEST dropped.
    Table TABLE_TEST created.
    2 rows selected from schema@tnsnames_sid.
    2 rows inserted into TABLE_TEST.
    2 rows committed into TABLE_TEST at schema@tnsnames_sid.
    SQL>
    However, if I try exactly the same command from within the Apex 'SQL Commands' editor, I get the following error message:
    ORA-00900: invalid SQL statement
    NOTE that the reason I use COPY command is to overcome problems with LONG datatype which arise when doing simply CREATE TABLE AS.... with dblink.
    In anycase, how can I make this work from within the 'SQL Commands' editor (and therefore in a button process).
    Regards,
    Pawel.

    Hi Harman,
    yes, this is a known issue.
    It's fixed with NW04 SPS 13.
    Regards Matthias Röbig-Landau

  • Problem with SQL Script in report

    Post Author: danish
    CA Forum: Data Connectivity and SQL
    Hi
    Can someone tell me why I'm not getting the right answer.Basically I want to pick up all creditors invoices that have been invoiced to the 31/12/2007 and then I don't want to count those that have been paid before the 31/12/2007 and therefore getting a listing of creditors with just the outstanding invoices up to a certain date.
    This is what I'm currently got defined as my selection script, but I keep getting every invoice up to 31/12/2007.
    SELECT vCreditorTransactions.InvoiceDueDate, vCreditorTransactions.InvoiceDescription, vCreditorTransactions.InvoiceNumber, vCreditorTransactions.GLFullCode, vCreditorTransactions.GLDescription, vCreditorTransactions.GLAmount, vCreditorTransactions.NameSortSequence, vCreditorTransactions.CreditorID, vCreditorTransactions.CreditorPayeeName, vCreditorTransactions.InvoiceDate, vCreditorTransactions.GrossAmount, vCreditorTransactions.TaxAmount FROM   SynergyOneFinance.dbo.vCreditorTransactions vCreditorTransactions  WHERE  InvoicePostingDate <= '31 Dec 2007' AND ISNULL(ChequePostingDate,'9999-01-01') <= '31 Dec 2007'ORDER BY vCreditorTransactions.CreditorPayeeName, vCreditorTransactions.CreditorID
    Regards Torben

    Post Author: pvierheilig
    CA Forum: Data Connectivity and SQL
    Another consideration will be to make certain all date formats used for comparisons in your SQL are in the same format.  Are you able to run the SQL statement in some other program against your database and have the desired results returned?

  • Help with sql scripts

    query #1
    can anyone helpme set up two scripts.
    1 i need to list all users that belong to a single role or for all roles,which would be grouped by role,the number of users in the role,when the role was granted,what options went with the grant and who granted it to them.
    i need a sample or the the views that need to be involved to extract that information.
    query #2
    another script that i need is the following:
    i need to list object privileges by user or all users,
    appropriately grouped,given to the user,the name and type of the object,when the grant was given and with what options they were granted,and who granted them the privilege.
    so if any body could help in these two scripts i 'll be very appreciative.
    thanks in advance.

    You want to run reports at least for intervals of an hour. A whole day's report wouldn't contain anything that would stand out because everything levels out when looking at everything that occurred over a long period of time. AWR snapshots are automatically scheduled to be taken every hour because that's the ideal range to look at reports for.

  • Shell with SQL Script (Login authentication)

    First I hava shell script(create_ydb.sh), the content is :
    #!/bin/sh
    sqlplus /nolog @create_ydb.sql
    Then the content of the create_ydb.sql:
    set verify off
    PROMPT specify a password for sys as parameter 1;
    DEFINE sysPassword = &1
    host /ORACLE_HOME_PATH/bin/orapwd file=/ORACLE_HOME_PATH/dbs/orapwYDB password=&&sysPassword force=y
    @CreateDB.sql
    Then the content of the CreateDB.sql:
    connect "SYS"/"&&sysPassword" as SYSDBA
    The first problem is , after the user input the password for sysPassword , he is not able to change it;
    so I tried to move the "input password part" to the shell script, but I don't know how to pass the
    value of sysPassword to the create_ydb.sql.
    The second problem is , if the user input the wrong password, how can I know that in the CreateDB.sql
    so that I can stop it to run and display the error message to the user.
    I hope someone can help me out, thanks ^_^

    Rather use the Linux/Unix shell read command and assign the password to a standard environmental variable. The prompt command and substitution variables in SQL*Plus are limited in what can be done. There's a lot more flexibility stepping into SQL*Plus with ready-to-use environment variables.
    Something like follows:
    /home/billy> cat x.sh
    #!/bin/sh
    read -p "Enter password> " PASSWORD
    sqlplus /nolog << EOF
            prompt you have entered password ${PASSWORD}
            set define on
            set verify off
            -- create a substitution var for password
            define password=${PASSWORD}
            prompt substitution variable contains &PASSWORD
            exit
    EOF
    /home/billy> ./x.sh
    Enter password> test
    you have entered password test
    substitution variable contains test
    /home/billy>

  • Help With SQL Script

    Hi All ,
    Here is my usecase. I have a table of following structure (History table):
        Column A - Unique key
        Column B - Foreign Key
        Start Date
        End Date.
      My Data is corrupted due to some reason .  Its supposed to be 
                StartDate         End Date
      1   MyID    2010-04-01         2013-10-07
      2   MyID    2013-10-07         3000-12-31
      It got corrupted and now it is
                StartDate         End Date
      1   MyID    2010-04-01         2013-10-07
      2   MyID    2010-04-01         3000-12-31
      Basically I want end date of first row to be updated as start date of second row. Because of some coding issue this corruption happened. 
      Now i want to find out all the cases for which this happened.
      I could find out all the rows for which multiple entries are there using :
      Select * from table where B in (
      Select B from table group by b having count(*) >1)
      But i need only corrupted records.  Can some one help me   ??
      Thanks in advance.
      B1

    Since you have not provided proper data, hope below table format matches your record set.
    WITH T1 AS
    ( SELECT  1 COL1, 1 COL2,  TO_DATE('2010-04-01','YYYY-MM-DD') START_DATE, TO_DATE('2013-10-07','YYYY-MM-DD') END_DATE FROM DUAL UNION ALL
      SELECT 2, 1,TO_DATE('2013-10-07','YYYY-MM-DD'),TO_DATE('2013-11-30','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 3,1, TO_DATE('2013-10-07','YYYY-MM-DD'),TO_DATE('3000-12-31','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 4,2,TO_DATE('2014-01-01','YYYY-MM-DD'), TO_DATE('2014-03-31','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 5,2,TO_DATE('2014-01-01','YYYY-MM-DD'), TO_DATE('2014-12-31','YYYY-MM-DD') FROM DUAL)
      SELECT * FROM T1;
    OUTPUT:
          COL1       COL2 START_DAT END_DATE
             1          1 01-APR-10   07-OCT-13
             2          1 07-OCT-13   30-NOV-13
             3          1 07-OCT-13   31-DEC-00
             4          2 01-JAN-14   31-MAR-14
             5          2 01-JAN-14   31-DEC-14
    Seems like you look for records whose START_DATE is not matching with the previous record's END_DATE. The logic I have used is (according to your data), the START_DATE of RECORD1=START_DATE of RECORD2. This is what you are looking for. Below is the query.
    WITH T1 AS
    ( SELECT  1 COL1, 1 COL2,  TO_DATE('2010-04-01','YYYY-MM-DD') START_DATE, TO_DATE('2013-10-07','YYYY-MM-DD') END_DATE FROM DUAL UNION ALL
      SELECT 2, 1,TO_DATE('2013-10-07','YYYY-MM-DD'),TO_DATE('2013-11-30','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 3,1, TO_DATE('2013-10-07','YYYY-MM-DD'),TO_DATE('3000-12-31','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 4,2,TO_DATE('2014-01-01','YYYY-MM-DD'), TO_DATE('2014-03-31','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 5,2,TO_DATE('2014-01-01','YYYY-MM-DD'), TO_DATE('2014-12-31','YYYY-MM-DD') FROM DUAL)
      SELECT COL1,COL2,START_DATE,END_DATE FROM(
      SELECT COL1,COL2,START_DATE,END_DATE,
             LEAD(START_DATE) OVER(PARTITION BY COL2 ORDER BY COL1,COL2) LEAD_COL
      FROM T1)
      WHERE
      START_DATE = LEAD_COL
      OR LEAD_COL IS NULL;
    OUTPUT:
          COL1       COL2 START_DAT END_DATE
             2          1 07-OCT-13 30-NOV-13
             3          1 07-OCT-13 31-DEC-00
             4          2 01-JAN-14 31-MAR-14
             5          2 01-JAN-14 31-DEC-14
    Method 2 is also considering the condition END_DATE of record1 NOT EQUAL TO START_DATE OF record2.
    WITH T1 AS
    ( SELECT  1 COL1, 1 COL2,  TO_DATE('2010-04-01','YYYY-MM-DD') START_DATE, TO_DATE('2013-10-07','YYYY-MM-DD') END_DATE FROM DUAL UNION ALL
      SELECT 2, 1,TO_DATE('2013-10-07','YYYY-MM-DD'),TO_DATE('2013-11-30','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 3,1, TO_DATE('2013-10-07','YYYY-MM-DD'),TO_DATE('3000-12-31','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 4,2,TO_DATE('2014-01-01','YYYY-MM-DD'), TO_DATE('2014-03-31','YYYY-MM-DD') FROM DUAL UNION ALL
      SELECT 5,2,TO_DATE('2014-01-01','YYYY-MM-DD'), TO_DATE('2014-12-31','YYYY-MM-DD') FROM DUAL)
      SELECT COL1,COL2,START_DATE,END_DATE FROM(
      SELECT COL1,COL2,START_DATE,END_DATE,LAG(END_DATE)OVER(PARTITION BY COL2 ORDER BY COL1,COL2) LAG_COL,
             LEAD(START_DATE) OVER(PARTITION BY COL2 ORDER BY COL1,COL2) LEAD_COL
      FROM T1)
      WHERE
      START_DATE!=LAG_COL
      OR START_DATE = LEAD_COL
      OR LAG_COL IS NOT NULL
      OR LEAD_COL IS NULL;
    OUTPUT:
         COL1       COL2 START_DAT END_DATE
            2          1 07-OCT-13 30-NOV-13
            3          1 07-OCT-13 31-DEC-00
            4          2 01-JAN-14 31-MAR-14
            5          2 01-JAN-14 31-DEC-14

  • Help with SQL Script please

    Hi there,
    What I`m trying to accomplish here is the following guys;
    This would be the pseudo code that I`m trying to convert into proper SQL;
    Declare @Parameter varchar(50)
    now I`m trying to find out how to find whatever is in the @Parameter in the values of table column. something like this;
    If @Parameter exists in (select column from table) then do something here else something else....
    Thanks very much in advance for your help.

    do you want some thing like below
    Declare @Parameter varchar(50)
    If exists (select column from table where column = @Parameter)
    begin
    --do something here
    END
    else
    Begin
    --something
    END
    Thanks
    Saravana Kumar C

  • Export scheduler job but chain step and chain rule failed with ORA-24150 ORA-06512 during executed sql script.

    Hi Folks,
    I used expdp utility to export all Oracle scheduler jobs and chains with below method, after that generate sql script by impdp, later on executing sql script encountered some errors.
    Only chain step and chain rule for executing script. Does anyone bright me some light? Thanks!
    My env: Oracle 11g + Oracle Linux 5.5
    My steps as below:
    1. export(expdp) oracle scheduler job(chain)
    2. generate sql script by impdp.
    3. remove orginal scheduler job(chain)
    4. execute sql script
    5. job with no chain well but job with chain failed
    [oracle@linux1 ~]$ expdp scott/tiger directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:\" in \(select \
    > name from sys.obj$ where type\# in \(46,59,66,67,68,69,72,74,79\)\)\"  schemas=scott
    Export: Release 11.2.0.1.0 - Production on Tue Dec 3 17:42:31 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Starting "SCOTT"."SYS_EXPORT_SCHEMA_01":  scott/******** directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:" in (select name from sys.obj$ where type# in (46,59,66,67,68,69,72,74,79))" schemas=scott
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
      /u03/database/usbo/BNR/dump/scott_job.dmp
    Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 17:42:54
    [oracle@linux1 ~]$ impdp scott/tiger sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Import: Release 11.2.0.1.0 - Production on Tue Dec 3 17:43:04 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
    Starting "SCOTT"."SYS_SQL_FILE_FULL_01":  scott/******** sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:43:07
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.
    scott_job.dmp  scott_job.sql 
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.sql
    -- CONNECT SCOTT
    ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
    -- new object type path: SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_1"','1=1',NULL, 'First link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_2"',':"CHAIN_STEP_1".COMPLETED = ''TRUE''',NULL, 'Second link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_3"',':"CHAIN_STEP_2".COMPLETED = ''TRUE''',NULL, 'Third link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_4"',':"CHAIN_STEP_3".COMPLETED = ''TRUE''',NULL, 'End of the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
    END;
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_1"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_1'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for first link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_3"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_3'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for last link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_2"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_2'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for second link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
    , rule_set_name=>'"SCHED_RULESET$1"   '
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_job('"TEST_CHAIN_1_JOB"',
    job_type=>'CHAIN', job_action=>
    'test_chain_1'
    , number_of_arguments=>0,
    start_date=>TO_TIMESTAMP_TZ('03-DEC-2013 05.38.56.718161000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=>
    'freq=minutely; interval=2'
    , end_date=>TO_TIMESTAMP_TZ('03-DEC-2013 06.08.56.000000000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'),
    job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>TRUE,comments=>
    NULL
    COMMIT;
    END;
    [oracle@linux1 ~]$ export ORACLE_SID=usbo
    [oracle@linux1 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 3 17:44:43 2013
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    sys@USBO> show parameter db_name
    NAME                                 TYPE                              VALUE
    db_name                              string                            usbo
    sys@USBO> conn scott/tiger;
    Connected.
    --remove job and chain.
    scott@USBO> EXEC DBMS_SCHEDULER.drop_job(job_name => 'test_chain_1_job');
    EXEC DBMS_SCHEDULER.drop_chain (chain_name  => 'test_chain_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_2');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_3');
    PL/SQL procedure successfully completed.
    scott@USBO> @/u03/database/usbo/BNR/dump/scott_job.sql
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24150: evaluation context SCOTT.SCHED_EV_CTX$1 does not exist
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_IMP_OBJ", line 40
    ORA-06512: at line 3
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    PL/SQL procedure successfully completed.

    Thanks all of you!
    Hi DK2010,
    I took some test that the data dict(dba_rule_sets/dba_evaluation_contexts) no any data returned after I had removed the job.
    So I tried to create evaluation context and re-executed script(only exception setion.) the first error has gone. For the second still have some issue.
    ---->no any returned
    scott@USBO> select * from dba_rule_sets where rule_set_owner='SCOTT';       
    no rows selected
    scott@USBO> select * from dba_evaluation_contexts WHERE evaluation_context_owner='SCOTT';
    no rows selected
    -->add new EVALUATION CONTEXT
    scott@USBO> exec DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT('SCOTT.SCHED_EV_CTX$1');
    PL/SQL procedure successfully completed.
    --->now it looks fine
    scott@USBO> BEGIN
      2  BEGIN
      3  dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
      4  END;
      5 
      6  COMMIT;
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    --->add new rule set, it prompt aleady exists
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1') 
    BEGIN DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1'); END;
    ERROR at line 1:
    ORA-24153: rule set SCOTT.SCHED_RULESET$1 already exists
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_ADM", line 138
    ORA-06512: at line 1
    -->chain rule still could not find.
    scott@USBO> @job_chain_rules.sql
    no rows selected
    -->rerun
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists 
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    -->drop chain
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1');
    BEGIN dbms_scheduler.drop_chain('TEST_CHAIN_1'); END;
    ERROR at line 1:
    ORA-27479: Cannot drop "SCOTT.TEST_CHAIN_1" because other objects depend on it
    ORA-06512: at "SYS.DBMS_ISCHED", line 1319
    ORA-06512: at "SYS.DBMS_ISCHED", line 1222
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1854
    ORA-06512: at line 1
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist   --->still returned no rule set
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1')
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    Would you like to give me more clue?
    Thanks again.

  • How to directly edit PL/SQL Scripts

    I can't open PL/SQL source files directly into a PL/SQL editor - they're opened as SQL scripts. The tool still seems targeted towards database maintenance rather than developing code held in a separate version control system.
    Whilst technically the PL/SQL source files are just SQL scripts this doesn't make for easy PL/SQL development.
    A change to a PL/SQL source file involves:
    - Open source file into SQL script tab.
    - Choose connection to run script against.
    - Run as a SQL script.
    - Close source file.
    - Navigate to package spec/body in tree browser and open read-only in a view tab.
    - Click to edit object source - opens in new tab.
    - Edit source and compile.
    - Add 'create or replace' at top and '/' at end.
    - Select 'Save As...' and navigate to original source file.
    - Close script window that this automatically opens for newly saved file, and close edit source tab. Same task in PL/SQL developer:
    - Open source file into a Program Window.
    - Edit source and compile.
    - Click save.
    Making a single change is bad enough - try it when you're making substantial changes to a source file and you want to regularly check compilation and save changes.
    Can anyone help make this easier ?

    The tool still seems targeted towards database maintenance rather than developing code held in a separate version control system.They'll get to it eventually...
    I can't open PL/SQL source files directly into a PL/SQL editor - they're opened as SQL scriptsIs the extension .sql? Change it to .pls or .pks/.pkb. They seem to use the dumb extension-based system to find out what files they are dealing with, instead of parsing the contents.
    If the code doesn't get syntax coloured, open a function or procedure from database first, that seems to wake him up.
    Also make sure the files are as the same as in the DB (with create or replace, without final slash), so you can compile them directly from the same file-based editor.
    You still have to assign connection and navigate to the PL/SQL in the DB to view compilation errors and run/debug though. There are some requests on the announced SQL Developer Exchange for these (http://htmldb.oracle.com/pls/otn/f?p=42626:37:260789750723810::NO:::). Please vote for them to see them implemented.
    K.

  • How to load SQL scripts from a text file.

    Hi, i tried several time to load a text file/SQL script with 10 different tables and data, but 10g Express doesen't allows me to do that, any one can direct me or point out to me what i should do or do i need to adopt any special method to to get this done. i am sure there must be some thing where you can upload SQL scripts from a text file (in SQL command editor!). thanks

    Hi,
    see my other answer here:
    SQL command editor doesn't take more than 1 insert command
    This seems to be a duplicate question, right? Or am I missing something?
    Regards,
    ~Dietmar.

  • Use SQL Workshop SQL Scripts function

    When I tried the following 5 steps,
    I cannot enter the ddl in the SQL editor window.
    The fact is that I cannot enter anything.
    Anyone can point out what is wrong with my procedure??????
    Thanks!
    Create the HT_EMP Table
    To create the HT_EMP table and the appropriate associated objects:
    1. Click SQL Workshop on the Workspace home page.
    2. Click SQL Scripts.
    3. When the SQL Scripts Repository appears, click Create.
    The Script Editor appears.
    4. In Script Name, enter HT_EMP
    5. In the Script Editor, enter the following DDL:
    CREATE TABLE ht_emp (
    emp_id NUMBER primary key,
    emp_first_name VARCHAR2(30) not null,
    emp_middle_initial VARCHAR2(1),
    emp_last_name VARCHAR2(45) not null,
    emp_part_or_full_time VARCHAR2(1) not null check (emp_part_or_full_time in
    ('P','F')),
    emp_salary NUMBER,
    emp_dept VARCHAR2(20) check (emp_dept in
    ('SALES','ACCOUNTING',
    'MANUFACTURING','HR')),
    emp_hiredate DATE,
    emp_manager NUMBER references ht_emp,
    emp_special_info VARCHAR2(2000),
    emp_telecommute VARCHAR2(1) check (emp_telecommute in ('Y')),
    rec_create_date DATE not null,
    rec_update_date date)
    /

    You need to upload the file to the SQL scripts area of ApEx. If you upload it to the static files area it's not going to be treated as a SQL script.
    Barring that as the problem - did you verify the contents of the script file on your workstation before you uploaded it - to make sure that the script actually contained the correct contents of the script?
    I've never had any significant problems with script uploads and running scripts in ApEx that couldn't be traced back to operator error. :>)
    Try explaining in detail the steps that you took to try to make this work - then we'll know where to start.
    Earl
    Message was edited by:
    Earl

  • R12 AR Transaction SQL script

    Hi guys,
    In R12
    Could someone please help me with sql script that I could use to find out what Receivables Transactions/Invoices that was raised with TAX EXEMPT.
    Thanks in advance.
    Tim

    The query you are looking for....
    select trx_number as "Invoice Number"
    from RA_CUSTOMER_TRX_ALL
    where DEFAULT_TAX_EXEMPT_FLAG = 'Y'
    Thanks
    Pradeep

  • What tool I need to download to execute SQL scripts inOracle? please Help!

    I'm a SQL Server developer trying to pratice SQL scriptinging in ORACLE environment. Can any subject matter expert let me know exactly which tool I need to download to experiment with SQL scripting? It's kind of confusing as ORACLE has so many components. If I'm correct, SQL Plus might be the tool and PL/SQL is the ORACLE version of SQL language/scripting. I know that i can download 180 days of evaluation version software. Can someone tell me the exact link of the oracle tool where I can execute my SQL scripts?
    Thank you so much in advanced.
    Thanks
    Syed Islam

    Try Oracle Express Edition (XE)
    Completely free.
    You can use SQL*Plus, but coming from Windows/SQL world, you'll definitely enjoy using SQL Developer as well. That's a separate download. You'll have a worksheet, visual query builder, object navigator/browser, etc - much like you see in SSMS.

  • Calling a SQL script from the PL/SQL block.

    Hello All,
    I am using oracle 11g database.
    My requirment is as follows. I have a SQL script to alter the table. But before alter the table I need to test some condition , if the condition satisfy then I have to alter the table through the SQL script. For the checking the condition I have to use the plsql block and inside I need to call the SQL script.
    Can I call a SQL script from PL/SQL block, if yes then how?
    I am tring to use START, RUN and @ command but it is throughing error.
    Thanks
    SUN

    [PL/SQL manual|http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions55a.htm#77600] Ctrl-F start, finds nothing. [SQLPlus manual|http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/toc.htm] Ctrl-F start finds this. Isn't it wonderful that Oracle documents this stuff so we don't have to guess.
    Can I call a SQL script from PL/SQL block, if yes then how? No.
    You could call the stored procedure in a SQL*Plus script before the alter table and have it raise an exception if the condition is not met and have the script quit when there is an error.

Maybe you are looking for

  • Problem in main window of smartform

    Hi experts, I have a secondary window in my page of smartform. and then a main window in which i have used a table to display line item from internal table. Now my problem is that when the data exceeds first page the remaining part of dat in mainwind

  • Initializing the date field in tabular form

    i m creating one time sheet application. in that i hv created one tabular form to take timesheet entries. current_date attribute is one of them. the problem is that i want to initialize the current date with the sysdate as the form loads and then aft

  • Changing default on 'Save for Web'

    On my previous 'XP' computer I'm sure that when I saved a graphic the default was jpeg but on this computer which runs Windows7 the default is gif.  Is there a way I can change this?

  • Rehearsal view during presentation

    Excused my ignorance, but is it possible to run my computer in rehearsal view and have the audience see the full presentation? I would love to see the next event and slide and the notes while the audience sees the full presentation. If this is possib

  • Query Search

    My Tangosol Cache key is simple string and value is java object. I would like to know is there any API exist or better way to query my cache (based on key string) by passing partial key string. I really appreciate your help on this. Thanks!