Need suggestion on PLSQL Create and EXECUTE IMMEDIATE

Most of you already know plsql doesn't like create table, so we have to use EXECUTE IMMEDIATE for creating table. What if I want to see if the table exist, if not then create the table, later I will insert data into that table.
My problem is it returned me the error saying I am try to insert into a non existing table when trying to compile my code. I think plsql doesn't pick up the execute statement.
what I did is, both create and insert are executed by using EXECUTE IMMEDIATE. Anyone have such experience before and willing to share your knowledge?
PS: I am having same problem for creating sequence as well.

I think plsql doesn't pick up the execute statement.Since it is a runtime instruction, it will pick it up at runtime. but to be able to run, it needs to compile the code and in order to compile (so it can run) the code it needs that table/sequence you are referencing to exist already. So, you need to run the code to get the table and run needs to compile the code and compile needs the table to compile. can't go from here to there when you try to mix dynamic sql with static sql on the same object within the same program unit (or dependent units).

Similar Messages

  • We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a

    We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a printer."C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /T "\\<Application Server>\Report\<TEST.PDF>" "<Printer Name>". Current Situation: The above command line parameter when executed is working as expected in a User's Workspace. When executed in a command line on the Application Server is working as expected. But, the same is not working while executing it from Deployed environment.Software being used: 1. Adobe 11.0 enterprise version. 2. Webshpere Application Server 8.5.5.2. Please let us know if there is a way to enable trace logs in Adobe Reader to further diagnose this issue.

    This is the Acrobat.com forum.  Your question will have a much better chance being addressed in the Acrobat SDK forum.

  • How to create and execute a function whose return value is  a table

    hi folks ,
    i would like know how to create and execute a function whose return value is a table ,
    am new to pl/sql ,
    my statement for the function is
    SELECT ct.credential_code, c.expiration_date
    FROM certifications c, credential_types ct
    WHERE ct.crdnt_id = c.crdnt_id
    AND c.person_id = person_id;
    i would like to have the result of the above query as return value for the function.
    Thanks in advance ,
    Ashok.c

    hi Ps ,
    Can you please do small sample ,
    that would help me in clear understanding
    thanks in advance
    ashok.c

  • Possible bug with TREAT and EXECUTE IMMEDIATE

    Hello, i experienced a strange behavior which seems to be a bug.
    Consider following definitions:
    CREATE OR REPLACE TYPE T_Base FORCE AS OBJECT (
      DummyProperty NUMBER
    ) NOT FINAL;
    CREATE OR REPLACE TYPE T_Child UNDER T_Base (
      AnotherDummyProperty  NUMBER
    CREATE OR REPLACE FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER IS
    BEGIN
      -- some specific validation is done here, not important for the example
      RETURN NULL;
    END;
    CREATE OR REPLACE PROCEDURE ValidateIt (iValue T_Child) IS
      lResult NUMBER;
    BEGIN
      -- The principle used here is that each client can have its own implementation of validation function, and when it does not exist, we do not care.
      -- In reality we put functions and procedures into packages, I narrowed it to a minimal working example.
      BEGIN
        EXECUTE IMMEDIATE 'BEGIN :lResult := SpecificValidation(:iValue); END;'
          USING OUT lResult, IN iValue;
      EXCEPTION WHEN OTHERS THEN
        IF INSTR(SQLERRM, 'PLS-00201') = 0 THEN
          RAISE;
        END IF;
      END;
    END;
    CREATE OR REPLACE PROCEDURE Process (iValue T_Base) IS
    BEGIN
      -- in fact we know that iValue must be of typ T_Child, it is checked using IS OF ( ) operator and exception is raised if this check fails
      -- This does not work for some reason.
      -- It fails in EXECUTE IMMEDIATE with PLS-00306. I don't really get why, because ValidateIt accepts a value of type T_Child and it passes it to the validation procedure, which also expects value of type T_Child.
      ValidateIt(TREAT(iValue AS T_Child));
    END;
    CREATE OR REPLACE PROCEDURE Process2 (iValue T_Base) IS
      lChild  T_Child;
    BEGIN
      -- The only difference here is that result of TREAT is saved to a variable.
      -- This works as expected.
      lChild := TREAT(iValue AS T_Child);
      ValidateIt(lChild);
    END;
    In reality it is much more complex, I narrowed it to a minimal working example.
    Now when running this:
    DECLARE
      lItem T_Base := T_Child(5, 2);
    BEGIN
      BEGIN
        -- This call will end up with PLS-00306 error.
        Process(lItem);
        dbms_output.put_line('Process completed successfully.');
      EXCEPTION WHEN OTHERS THEN
        dbms_output.put_line('Exception when calling Process.');
        dbms_output.put_line(SQLERRM);
        dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
      END;
      BEGIN
        Process2(lItem);
        dbms_output.put_line('Process2 completed successfully.');
      EXCEPTION WHEN OTHERS THEN
        dbms_output.put_line('Exception when calling Process2.');
        dbms_output.put_line(SQLERRM);
        dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
      END;
    END;
    then call to Process fails with PLS-00306 on EXECUTE IMMEDIATE.
    The only difference between Process and Process2 is that in Process2, result of TREAT is saved to a variable of type T_Child.
    Is this behavior documented somwhere or is it a bug?

    That's interesting. I would say it is, or should be, a bug.
    Also interesting is, when I re-write your example to eliminate dynamic SQL and instead rely on dynamic method dispatch, the problem goes away... first, the changes:
    drop type T_Child;
    drop type T_Base
    CREATE OR REPLACE TYPE T_Base FORCE AS OBJECT ( 
      DummyProperty NUMBER 
    ) NOT FINAL
    CREATE OR REPLACE TYPE T_Child UNDER T_Base ( 
      AnotherDummyProperty  NUMBER 
    create or replace type T_Base_Processor as object (
      dummyProperty    number
    , static FUNCTION GetClientProcessor(iClientId varchar2) RETURN T_Base_Processor
    , member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER
    , member PROCEDURE ValidateIt (iValue T_Child)
    , member PROCEDURE Process (iValue T_Base)
    , member PROCEDURE Process2 (iValue T_Base)
    ) NOT FINAL
    create or replace type T_Another_Processor under T_Base_Processor (
      overriding member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER
    create or replace type body T_Base_Processor
    is
      static FUNCTION GetClientProcessor(iClientId varchar2) RETURN T_Base_Processor IS
    BEGIN
      return    case
            when upper(iClientId) = 'ADMINISTRATOR' then
                new T_Another_Processor(null)
            else
                new T_Base_Processor(null)
            end;
    END;
      member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER IS 
    BEGIN 
      -- some specific validation is done here, not important for the example 
      dbms_output.put_line('T_Base_Processor.SpecificValidation');
      RETURN NULL; 
    END; 
      member PROCEDURE ValidateIt (iValue T_Child) IS 
      lResult NUMBER; 
    BEGIN 
      -- No more need for dynamic SQL, instead rely on dynamic dispatch
      lResult := SpecificValidation(iValue);
    END; 
      member PROCEDURE Process (iValue T_Base) IS 
    BEGIN 
      -- in fact we know that iValue must be of typ T_Child, it is checked using IS OF ( ) operator and exception is raised if this check fails 
      -- This does not work for some reason. 
      -- It fails in EXECUTE IMMEDIATE with PLS-00306. I don't really get why, because ValidateIt accepts a value of type T_Child and it passes it to the validation procedure, which also expects value of type T_Child. 
      ValidateIt(TREAT(iValue AS T_Child)); 
    END; 
      member PROCEDURE Process2 (iValue T_Base) IS 
      lChild  T_Child; 
    BEGIN 
      -- The only difference here is that result of TREAT is saved to a variable. 
      -- This works as expected. 
      lChild := TREAT(iValue AS T_Child); 
      ValidateIt(lChild); 
    END;
    end;
    create or replace type body T_Another_Processor
    is
      overriding member FUNCTION SpecificValidation (iValue T_Child) RETURN NUMBER
    is
    begin
      -- some other specific validation is done here, not important for the example 
      -- You could even call the overridden method as well using
      --   treat(self as T_Base_Processor).SpecificValidation(iValue)
      dbms_output.put_line('T_Another_Processor.SpecificValidation');
      RETURN NULL; 
    end;
    end;
    And again with slight modifications, your test block:
    DECLARE 
      lProcessor T_Base_Processor := T_Base_Processor.getClientProcessor('JOE');
      lItem T_Base := T_Child(5, 2); 
    BEGIN 
      BEGIN 
        -- This call no longer throws a PLS-00306 error. 
        lProcessor.Process(lItem); 
        dbms_output.put_line('Process completed successfully.'); 
      EXCEPTION WHEN OTHERS THEN 
        dbms_output.put_line('Exception when calling Process.'); 
        dbms_output.put_line(SQLERRM); 
        dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE); 
      END; 
      -- Demonstrate dynamic dispatch by choosing a different processor
      lProcessor := T_Base_Processor.getClientProcessor('ADMINISTRATOR');
      BEGIN 
        lProcessor.Process2(lItem); 
        dbms_output.put_line('Process2 completed successfully.'); 
      EXCEPTION WHEN OTHERS THEN 
        dbms_output.put_line('Exception when calling Process2.'); 
        dbms_output.put_line(SQLERRM); 
        dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE); 
      END; 
    END; 
    T_Base_Processor.SpecificValidation
    Process completed successfully.
    T_Another_Processor.SpecificValidation
    Process2 completed successfully.
    Gerard

  • Display results from dynamic query created and executed inside procedure

    Hi;
    I have created this code:
    CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, VAR3 IN VARCHAR2) AS
    -- Do something
    -- That ends up with a variable holding a query.... (just an example)
    MainQuery :='select sysdate from dual';
    end RunDynamicQuery;
    How can I run this procedure and see the result on the dymanic query generated inside it?
    BEGIN
    compare_tables_content('VAR1','VAR2','VAR3');
    END;
    Expected Output for this given example:
    20-05-2009 11:04:44 ( the result of the dymanic query inside the procedure variable MainQuery :='select sysdate from dual';)
    I tested with 'execute immediate':
    CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, filter IN VARCHAR2) AS
    -- Do something
    -- That ends up with a variable holding a query.... (just an example)
    MainQuery :='select sysdate from dual';
    execute immediate (MainQuery );
    end RunDynamicQuery;
    BEGIN
    compare_tables_content('VAR1','VAR2','VAR3');
    END;
    Output:"Statement processed'' (no sysdate displayed ! )
    Please consider that the collums in the query are always dynamic... PIPELINE Table would not work because I would need to define a container, example:
    CREATE OR REPLACE TYPE emp_tabtype AS TABLE OF emp_type;
    FUNCTION RunDynamicQuery (p_cursor IN sys_refcursor)
    RETURN emp_tabtype PIPELINED
    IS
    emp_in emp%ROWTYPE;
    BEGIN
    LOOP
    FETCH p_cursor
    INTO emp_in;
    EXIT WHEN p_cursor%NOTFOUND;
    PIPE ROW (...)

    That would be a nice solution, thanks :)
    ''For now'' I implemented like this:
    My dynamic query now returns a single string ( select col1 || col2 || col3 from bla)
    This way I don't have dynamic collumns issue, and from business side, this ''string'' format works for them.
    This way I can use the pipelines to get the result out...
    OPEN myCursor FOR MainQuery;
    FETCH myCursor
    INTO myRow;
    WHILE (NOT myCursor%notFound) LOOP
    PIPE ROW(myRow);
    FETCH myCursor
    INTO myRow;
    END LOOP;
    CLOSE myCursor;

  • PLSQL table in EXECUTE IMMEDIATE

    Hi All,
    This is just a sample code.Table name may be changed in next run.
    when I run this program ,getting error in EXECUTE IMMEDIATE -" V_FIELDS invalid identifier",Also the way I am doing,that's right?
    create table TEMP
    col1 VARCHAR2(200),
    col2 VARCHAR2(200),
    col3 DATE )
    DECLARE
    v_fields dbms_sql.varchar2a;
    v_col_str VARCHAR2(200);
    v_insert VARCHAR2(200);
    v_idx INTEGER := 0;
    v_tab VARCHAR2(30) := 'TEMP';
    BEGIN
    FOR i IN (SELECT s.column_name, s.data_type
    FROM user_tab_cols s
    WHERE s.table_name = v_tab
    ORDER BY s.column_id)
    LOOP
    v_col_str := v_col_str || i.column_name || ',';
    IF i.data_type = 'DATE'
    THEN
    v_insert := v_insert || 'TO_DATE(v_fields(' || v_idx || '),' ||
    '''MM/DD/YYYY''' || '),';
    ELSE
    v_insert := v_insert || 'v_fields(' || v_idx || '),';
    END IF;
    v_idx := v_idx + 1;
    END LOOP;
    v_insert := '( ' || RTRIM(v_insert, ',') || ' )';
    v_col_str := 'INSERT INTO ' || v_tab || ' ( ' || RTRIM(v_col_str, ',') ||
    ' ) VALUES ';
    dbms_output.put_line(v_col_str || v_insert);
    v_fields(0) := 1;
    v_fields(1) := 'AB';
    v_fields(2) := SYSDATE;
    EXECUTE IMMEDIATE v_col_str || v_insert;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Err: ' || SQLERRM);
    END;
    Thanks,

    The dynamic SQL generated is
    INSERT INTO TEMP ( COL1,COL2,COL3 ) VALUES ( v_fields(0),v_fields(1),TO_DATE(v_fields(2),'MM/DD/YYYY') ) PL/SQL engine sends this SQL to SQL engine. And guess what, SQL Engine has no clue what v_fields is. Why? because v_fields a private variable defined in a PL/SQL block for which SQL Engine has zero access.
    Try this
    DECLARE
        v_fields  dbms_sql.varchar2a;
        v_col_str VARCHAR2(200);
        v_insert  VARCHAR2(200);
        v_idx     INTEGER := 0;
        v_tab     VARCHAR2(30) := 'TEMP';
    BEGIN
        FOR i IN (SELECT s.column_name, s.data_type
                    FROM user_tab_cols s
                   WHERE s.table_name = v_tab
                   ORDER BY s.column_id)
        LOOP
            v_col_str := v_col_str || i.column_name || ',';
            IF i.data_type = 'DATE'
            THEN
                v_insert := v_insert || 'TO_DATE(:' || v_idx || ',' ||
                            '''MM/DD/YYYY''' || '),';
            ELSE
                v_insert := v_insert || ':' || v_idx || ',';
            END IF;
            v_idx := v_idx + 1;
        END LOOP;
        v_insert  := '( ' || RTRIM(v_insert, ',') || ' )';
        v_col_str := 'INSERT INTO ' || v_tab || ' ( ' || RTRIM(v_col_str, ',') ||
                     ' ) VALUES ';
        v_fields(0) := 1;
        v_fields(1) := 'AB';
        v_fields(2) := to_char(SYSDATE, 'MM/DD/YYYY');
        execute immediate v_col_str || v_insert using v_fields(0), v_fields(1), v_fields(2);
    END;
    / I personally don't encourage dynamic SQL. Dynamic SQL is always a pain and a result of bad design.
    And the most worst thing, the thing that is terrible than dynamic SQL is this
    WHEN OTHERS THEN
    dbms_output.put_line('Err: ' || SQLERRM);
    END; Whats the logic and possible benefit behind this code? Its NONE. Don't do that, NEVER. WHEN OTHERS without a RAISE is a bug in your code. So never do that. And DBMS_OUTPUT is not the correct way to render error message to user.

  • How to create and execute PL/SQL program or Procedure from Java (JDBC)

    hi all,
    user will enter the Pl/Sql program from User-Interface. that program has to be create in DB and execute that.
    due to some confusions, how to execute this from Java, i (user) entered the same logic through a Procedure.
    my Java code is
    Statement st = con.createStatement();
    Statement.execute(procedure_query); // procedure name is myPro
    CallableStatement cs = con.prepareCall("{call myPro}");
    (as given in SUN docs - http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html)
    but its not creating the procedure.
    and i tried to run a procedure (which is already created) with CallableStatement, and this is also not working.
    how to get this.
    thanks and regards
    pavan

    Hi,
    SInce the PL/SQL block is keyed in dynamically, you probably want to use the anonymous PL/SQL syntax for invoking it:
    // begin ? := func (?, ?); end; -- a result is returned to a variable
    CallableStatement cstmt3 =
    conn.prepareCall(“begin ? := func3(?, ?); end;”);
    // begin proc(?, ?); end; -- Does not return a result
    CallableStatement cstmt4 =
    Conn.prepareCall(“begin proc4(?, ?); end;”);
    SQLJ covered in chapter 10, 11, and 12 of my book furnish a more versatile dynamic SQl or PL/SQL mechanisms.
    Kuassi
    - blog http://db360.blogspot.com/
    - book http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html

  • Need suggestion on Multi currency and Unicode character set use in ABAP

    Hi All,
    Need suggestion. In one of the requirement I saw 'multi-currency and Unicode character set experience in FICO'.
    Can you please elaborate me how ABAPers are invlolved in multi currency as I think this is FICO fuctional area.
    And also what is Unicode character set exp.? Please give me some document of you have any.
    Thanks
    Sreedevi
    Moderator message - This isn't the place to prepare for interviews - thread locked
    Edited by: Rob Burbank on Sep 17, 2009 4:45 PM

    Use the default parser.
    By default, WebLogic Server is configured to use the default parser and transformer to parse and transform XML documents. The default parser and transformer are those included in the JDK 5.0.
    The built-in WebLogic Server DOM factory implementation class is com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.
    The DocumentBuilderFactory.newInstance method returns the built-in parser.
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

  • Need a bapi which creates and assigns notification to maintenance order

    Hi,
       I am currently using a bapi "BAPI_ALM_ORDER_MAINTAIN" in PM  to create an order with its operations. Now my requirement is to create and assign a notification to certain types of orders. This bapi is not able to handle notifications.
    Thanks
    Pradeep

    Hi Karthikeyan,
    Since this issue is resolved long back I don't remember everything related to it. But as far as I remember, the behavior of transaction IW32 is such that, while saving the work order, it cross checks with table T350. If field "NOTDAT" in T350 is checked for that order type  then it automatically creates a notification and assigns to that order. I just made use of this behavior and used BDC approach to solve this issue.
    Hope the things are clear.
    Regards,
    Pradeep.

  • Need suggestion regarding File compression and splititng

    Hi,
    I want to split and compress the big files into small chucks. On later any standard zip utility i.e. winzip, 7z etc can merge(extract) all the chunks to generate the original file. I am looking for any java library which provide the split and compression functionality.
    As Java also supports in built compression utility. Should I use those library or any other open source is available to do this? I welcome your suggestion regarding how can I start.
    Thanks

    If you're just looking for something to be used internally, it'd be pretty simple:
    1. Open your source InputStream.
    2. Create a standard read/write loop to pump the stream.
    3. Add a counter that determines how much you've pushed into your current target. After you reach a certain value, close your current target, create a new target stream, and reset the counter.
    4. Conclude by closing your source and your current target.
    For compression, you can use the built-in GZIPOutputStream or a third-party library of your choice. I usually find GZIP sufficient for my needs.
    Of course, if you want the output to be compatible with other programs like 7-Zip, you've got a lot more work on your hands complying with the file format spec. :)

  • Need suggestion for a burner and set up....

    Hi
    Last week I downloaded latest addition of I-tunes and have imported some songs. I want to put on a basic CD for listening in car. My computer (windows XP Home) doesn't have a built in CD burner so I need to purchase an external CD burner.
    I just need the basics. Any suggestions? How does one hook this up to the computer and how will I know if it will work with I-tunes? Thanks much

    They can hook up via USB/Firewire. I would get it from here,
    http://www.tigerdirect.com/applications/category/category_slc.asp?CatId=478&Nav=
    Or here,
    http://www.amazon.com/s/ref=nbssgw/103-3031257-3011057?url=search-alias%3Daps&field-keywords=externalcdburner&Go.x=0&Go.y=0&Go=Go
    and they should work just fine with iTunes.

  • Newbee needs suggestions for a search and replace script

    I can't figure out this scripting stuff. I looked at the scripting guide I downloaded from adobe some time ago. I am not a programmer.
    I do not need a script that says "hello world."
    I need a script that will do the following:
    Search selected text from one point to another. let me explain.
    I create a table of contents in InDesign CS4. We separate our book sections by "section". So the TOC looks like:
    Section 1
    item one.... 1
    item two... 2-4
    item three... 5
    Section 2
    item one... 1-3
    item two... 4-5
    item three... 6
    and so forth.
    I then manually go in and change the TOC to:
    Section 1
    item one... 1 - 1
    item two... 1 - 2-4
    Section 2
    item one... 2 - 1-3
    item two... 2 - 4-5
    Where the page reference in the TOC contains the section prefix and the page number provides the page range (if more than one page). Should mention that when I create the TOC I use a place holder in the TOC style set up for the section prefix; that is, my TOC initially looks like:
    Section 1
    item one.... X - 1
    item two.... X - 2, etc. I then highlight a range and find/change for each range.
    So, the script would do the following:
    Look in selected text (the entire TOC) frame which at times spans two or three pages from Section 1 to Section 2:
    Change the "^t (tab before number) to "^t (section number)(space)(hyphen)(space)":
    And then look at next number (i.e "4") and change the previous end of previous line from "1" to "1-3"
    Then repeat for range from Section 2 to Section 3, etc.
    Currently, I do it manually. That is ok, but it would be great to have a script that would do this for me.
    Thanks in advance,
    RPP

    The last thing you need is a script.
    When you want to make your TOC, go to Pages, Numbering and Section Options, and put a section prefix in like 1- for each section (both 1 and 2 in your case). Click "Include Prefix When Numbering Pages".
    Then make your TOC.
    It will have all the section prefixes. ("1-1", "2-2-4", examples)
    Now just change the Numbering and Section Options BACK to your pre-TOC defaults. As long as  you don't update the TOC under Layout/Update TOC, your TOC text will contain the prefix, but your page numbers will look normal. If you have to change the text in the TOC for any reason, do it manually.
    Let me know if that works.
    Greg Ledger
    www.macproductionartist.wordpress.com

  • Moss - create and execute playlists of arbitrary commands

    I've been a happy user of MPD for several years, but I've often found that I want to put other things in my playlist besides audio files under a specific directory on my filesystem--and even if I could put those things in my playlist, MPD wouldn't know how to play them. To this end, I've created Moss, a client/server program that allows you to put whatever you want in a playlist. By default, playlist items are passed to /bin/sh -c for execution, but Moss can easily be configured to invoke a different program if the item matches a given regular expression.
    For mpc users, the interface should be very familiar. Essentially no setup is required, except for optionally writing a ~/.mossrc or ~/.config/mossrc file (you could use the example file from the git repo as a starting point).
    An AUR package is available. Let me know if you find a bug, have a suggestion, or just want to give general feedback.

    So this hasn't got much attention, but I've been using Moss for the past week or so and have found it to be useful and stable, so I implemented a couple more features and pushed out version 1.0.0. One of the new features is the -stdin flag, which allows additional arguments to be read from standard input. Among other things, this is useful for saving and loading playlists to/from files using moss ls > file and moss -stdin add < file. You could also shuffle the current playlist using (moss ls | shuf && moss clear) | moss -stdin add.
    The other new feature is an optional <format> argument to the status command, which lets you easily print specific information like playlist index, playlist length, current item, process ID of current command, et cetera. If you have a song currently playing and want to view its metadata, you could use something like soxi `moss status %f`--or remove everything before the current playlist item using seq $(expr `moss status %i` - 1) | moss -stdin del.
    The point is, I think I've made something that's nicely programmable and "composable", where a lot of functionality emerges from the design. There are probably a number of potential applications and patterns that haven't occurred to me yet.

  • Creating and executing a job inside oracle

    I must launch a batch inside oracle, i have defined program and job like this
    begin
    dbms_scheduler.create_program
    program_name => 'PGM2',
    program_type => 'EXECUTABLE',
    program_action => 'C:\GLOBE\CPONYIN.BAT',
    enabled => TRUE,
    comments => 'CREA FILE UTENTE IN INPUT PER ONYX'
    end;
    begin
    dbms_scheduler.create_job
    job_name => 'JOB2',
    program_name => 'PGM2',
    comments => 'Move FILE ONYX IN INPUT',
    enabled => TRUE
    end;
    Are they correct ?
    what can I do for launching the job JOB2?
    I have tried :
    BEGIN
    DBMS_JOB.RUN( job => JOB2);
    END
    But oracle answers : PLS-00201 Identifier JOB2 must be declared
    Thanks for your answers

    Hi,
    dbms_scheduler and dbms_job are two different package and create different types of jobs. In 10gR1 and up you shoulod not have to use dbms_job at all since dbms_scheduler is its replacement.
    To run a dbms_scheduler job immediately you can use dbms_scheduler.run_job which is documented in the PL/SQL packages guide under dbms_scheduler .
    Hope this helps,
    Ravi.
    PS you will run into other issues with your example. A bat file cannot be run directly. You must do e.g.
    c:\win32\cmd.exe /q /c C:\GLOBE\CPONYIN.BAT
    which is done by setting number_of_arguments to 3 in create_program
    and after doing create_job (enabled=>false), you will have to call set_job_argument_value 3 times with '/q', '/c' and 'C:\GLOBE\CPONYIN.BAT' and then call dbms_scheduler.enable to enable the job .

  • Licence types for users creating and executing BW reports

    Hi Friends,
    Will users who are writing queries attract a full professional licence or a limited professional licence.
    Will users who are only executing queries need an ERP employee licence, limited professional or full professional licence?
    Thanks,
    Ramesh

    Hi,
    User who are executing the reports, they will have execute authorisation of the query only. They dont require full authorisation.
    Developer who created the query they will have full authorisation of the query.
    I am not getting what are you talking about License.Can you explain ??

Maybe you are looking for

  • How come I can't convert the root variable to a MovieClip?

    In one of my custom classes for my program I am trying to access the main timeline from within it. The following is code which I have used before, but for some reason does not seem to be working now. The full error I get (During runtime, not during c

  • How do i get my music back after reset

    my I pod side it was corrupt needed to be reset so I reset it now I can't reload the music back on it

  • Role problems

    Our organization is beginning to implement roles and I was doing some testing. I added a role with following attributes in our SunONE 5.2 patch 2 directory: dn: cn=role1,ou=roles,o=calgary regional health authority objectclass: top objectclass: LDAPS

  • Why Toshiba places is not working?

    two days ago Toshiba Places stop working on my TV 40TL939. No changes in internet connection Restering settings give no effect. Internet connection testing ok. Is it TV bug or your sever down?

  • No one in ApEx forum knows how to modify report layout!!!

    Hi dear firends, I have got Named column report layout (XSL-FO, <!--Generated by Oracle BI Publisher 10.1.3.4.1-->) that was designed by another programmer. To change it , I downloaded the current file (xml extension file) using the download button o