How to execute a statement in application process on new authentication

Hi all,
How can i execute a statement such as
set role TABLE_NAME identified by sunil;
in my application process?
I have tried exec('set role TABLE_NAME identified by sunil');, but wasn't successful. Does anybody knows the problem in my syntax?
Thanks,
Sunil Bhatia
Edited by: Sunil Bhatia on Jun 25, 2009 12:33 PM

Can you proceed me to this direction?No, it's still the wrong one.
DB roles are not used in APEX due to fundamentals of APEX and Oracle architecture: this is clear when it is understood Re: Priveleges to create procedures/functions in schemas (points 3 & 4 being most relevant to this issue – and read "APEX" for "HTML DB")
(If anyone knows of a more "official"/complete description of what goes on under the covers than the referenced Forum post it would be helpful to know about it.)

Similar Messages

  • How to find sql statement with Unix process pid

    Hi
    how to find sql statement with Unix process pid
    is there any view to find that.
    please if so let me know
    Thanks in advance

    this is how I am doing this:
    oracle 7352340 7459066 0 07:47:10 - 0:00 oracleJDERED (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    oracle 7459066 5386396 2 07:47:10 pts/1 0:01 sqlplus
    select sid,serial# from v$session where process='7459066';
    SID SERIAL#
    2178 6067
    select sql_text
    from
    v$sqlarea a,
    v$session b
    where a.hash_value = b.sql_hash_value
    and b.sid = 2178
    ;

  • How to execute a simple JSP application in Oracle 9iAs WE?

    Hi,
    How to execute a simple JSP application in Oracle 9iAs WE?
    Thanks
    Anupama

    Please "Preview" your future posts. Your formatting is awful. Especially learn to use the [ code ] tags.
    Are you sure DateTime.Now.ToString() returns a string in the format of 'MM/DD/YYYY HH:MI:SS.FF3'?
    Fix that and if you still having the problems, debug the actual result of your string.Format() and post that.

  • If-statement in application-process

    Hi,
    First I will tell you which APEX I am using: 3.0.1
    Ok, I have got a form where there are 4 fields:
    P13_ACCTNO (Popup LOV (fetches first rowset)),
    P13_LOCATION_NAME(Text Field (Disabled, saves state)),
    P13_COMP_ACCTNO( Popup LOV (fetches first rowset)),
    P13_LOCATION(Text Field (Disabled, saves state))
    In my table, the company is always filled in, no null values (but it is not the PK, this is the acctno). But location may be null.
    When I select a location (popup will only show fields which are filled in), then the other fields are filled in as well. So the Location (number) and the acctno is the same.
    Now, when I select a comp_acctno, the rest of the fields are filled in automatically. But the Location (number) will remain from the first select, although no location might be there.
    So I have got 2 javascript codes on the page and 2 applicationprocesses and 1 application item.
    I would like to have an if-statement in my application-process (instead of " HTP.prn ('<item id="P13_LOCATION">' || v_null || '</item>');", something like:
    if :p13_location_name is null then
    :p13_location = ' ';
    end if;
    But I don't know how to put this into the following code, because it is a mixture, which I don't understand completely.
    DECLARE
    v_acctno primemines.acctno%type;
    v_company primemines.company%type;
    v_mineloc primemines.mineloc%type;
    v_commodity primemines.commodity1%type;
    v_null varchar2(5);
    CURSOR cur_c
    IS
    SELECT acctno, mineloc, company, commodity1
    FROM primemines
    WHERE acctno = TO_NUMBER (:temporary_application_item);
    BEGIN
    FOR c IN cur_c
    LOOP
    v_acctno := c.acctno;
    v_company := c.company;
    v_mineloc := c.mineloc;
    v_commodity :=c.commodity1;
    END LOOP;
    v_null := '';
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P13_ACCTNO">' || v_company || '</item>');
    HTP.prn ('<item id="P13_LOCATION_NAME">' || v_MINELOC || '</item>');
    HTP.prn ('<item id="P13_COMMODITY">' || v_commodity || '</item>');
    HTP.prn ('<item id="P13_LOCATION">' || v_null || '</item>');
    HTP.prn ('</body>');
    and also I have discovered that the automatically filling of the fields is only working sometimes (i don't know whether it depends on the company I select). Any ideas, why this is happening?
    could somebody help me with the code please?
    Thanks,
    regards,
    Denise

    Hi,
    @Chad: thanks for the code, I think it works (UPDATE: no, it does not work :-( )
    now i am just left with the other problem that it works only sometimes
    @user512746: yes, i guess you have understood correctly. I have changed the items P13_ACCTNO source used to "always replace" and taken out the default value, which I had set to &P13_ACCTNO.
    But it still only works partly, I don't know why?
    any other ideas?
    Thanks so much for your help so far, both of you.
    Regards,
    Denise

  • How to execute sql statement under bat file?

    I want to execute following statement
    C:\>sqlplus /nolog
    SQL> conn scott/tiger
    SQL> select * from tab;
    I know I can realize it as following test.bat and testdb.sql file
    test.bat is follows:
    sqlplus /nolog @testdb.sql
    testdb.sql is follows:
    conn scott/tiger
    select * from tab;
    Now I don't want to use sql file,I only want to use bat file,like follows:
    test.bat is follows:
    sqlplus /nolog
    conn scott/tiger
    select * from tab;
    when I run test.bat,I find only sqlplus /nolog statement execute,the other statements don't execute.
    1)I want to know whether there is a method to execute sql statement only by bat file without a sql file? How to realize it?
    2)If I call sql file,how to hide passord of user? Because I don't want to other persons know scott password,if I use conn scott/tiger in testdb.sql,other person can see testdb.sql and know the password. Is there a good method to avoid?
    Thanks!

    I'm running *NIX, but works the same on Windows
    bcm@bcm-laptop:~$ cat here.sh
    sqlplus dbadmin/admindb << EOF
    select count(*) from user_objects;
    exit
    EOF
    bcm@bcm-laptop:~$ sh here.sh
    SQL*Plus: Release 11.2.0.1.0 Production on Mon May 17 18:14:09 2010
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
      COUNT(*)
          9
    SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    bcm@bcm-laptop:~$ Edited by: sb92075 on May 17, 2010 6:15 PM

  • How to execute commit statement in a procedure optionally?

    We have a procedure which has DML operations and at the end there is a commit statement.
    I want to execute commit statement optionally.
    Like, when procedure runs directly it must execute commit statement, but when this procedure is called from a trigger don't run commit.
    As you know commit operation is not allowed in triggers.
    How can I understant the code is triggered from a trigger or any other (manuel exec or from another procedure).
    I am looking for the reserved word that solve my problem. Like INSERTING, DELETING ....
    Serkan
    Thanks.

    Hi oraserkan,
    You do of course know it's dangerous to have a commit inside a procedure?
    Consider this:
    SQL> create table t (text varchar2(25))
    Table created.
    SQL> create or replace procedure p
    as
    begin
       insert into t(text)
           values ('Insert PROCEDURE');
       commit;
    end p;
    Procedure created.
    SQL> insert into t(text)
        values ('Insert SQL')
    1 row created.
    SQL> exec p
    PL/SQL procedure successfully completed.
    SQL> rollback
    Rollback complete.
    SQL> select * from t
    TEXT                    
    Insert SQL              
    Insert PROCEDURE        
    2 rows selected.You should instead clearly state the procedure has a commit by making it autonomous, and then have two procedures, one that commits, and one that don't
    SQL> drop procedure p
    Procedure dropped.
    SQL> drop table t purge
    Table dropped.
    SQL> create table t (text varchar2(25))
    Table created.
    SQL> create or replace procedure p_transactional
    as
    begin
       insert into t(text)
           values ('Insert PROCEDURE');
    end p_transactional;
    Procedure created.
    SQL> create or replace procedure p_autonomous
    as
       pragma autonomous_transaction;
    begin
       p_transactional;
       commit;
    end p_autonomous;
    Procedure created.
    SQL> insert into t(text)
        values ('Insert SQL')
    1 row created.
    SQL> exec p_autonomous
    PL/SQL procedure successfully completed.
    SQL> rollback
    Rollback complete.
    SQL> select * from t
    TEXT                    
    Insert PROCEDURE        
    1 row selected.
    SQL> drop procedure p_transactional
    Procedure dropped.
    SQL> drop procedure p_autonomous
    Procedure dropped.
    SQL> drop table t purge
    Table dropped.Regards
    Peter

  • How to call an "ON DEMAND" application process

    Dear HTML DB Team,
    With HTML DB you can define "on demand" application processes. ("On Demand: Run this application process when requested by a page process.") These should be callable from page processes.
    How should a call in a page process to such an "on demand process" be written?
    Tried several options, no success. Please help.
    Could not find any information in this forum or html.pdf and help.
    Regards, Erik

    when you create an application-level process in htmldb, you have the option of creating it with a "Point" of "On Demand: Run this application process when requested by a page process". after doing that, you can then add processes to your htmldb application pages with a "Type" of "On Demand - Run an 'on-demand' application process". the next screen after indicating that Type lets you choose the On Demand process you'd like to use.
    hope this helps,
    raj

  • How to call an On Demand Application Process on PL/SQL

    Hello
    I need your urgent help. I developed an On Demad Application Process that inserts a new record in a table. Then I need to call that Process from another page after while the user is pressing a button on that page. Do you know the code that does that?
    Thank you very much for your help

    Hi,
    APEX processes are written as anonymous blocks i.e. have no names. Procedures and functions stored in the database must have names. Packages are simply a way of grouping procedures and functions into manageable units. There are also security reasons which are not important for this explanation but use packages instead of stand-alone procedures and functions from the beginning. It is not difficult and it will save you some headaches in the future. Packages have a specification and a body. The specification is basically the interface to the package and the body contains the code. Just basically, no flames please from the PL/SQL gurus out there. The name of a procedure or function and their parameters must be published in the spec for the procedure or function to be called from outside the package.
    Creating a packaged procedure is as simple as this:
    Using SQL Workshop/SQL Scripts, create a script giving it a name like CREATE_MY_PACKAGE
    <pre>
    CREATE OR REPLACE PACKAGE my_package IS
    PROCEDURE helloworld;
    PROCEDURE log_user(p_app_user IN VARCHAR2);
    END my_package;
    CREATE OR REPLACE PACKAGE BODY my_package IS
    PROCEDURE helloworld IS
    BEGIN
    HTP.PRINT('Helloworld');
    END helloworld;
    PROCEDURE log_user(p_app_user IN VARCHAR2) IS
    BEGIN
    INSERT INTO my_table(app_user) VALUES (p_app_user);
    END log_user;
    END my_package;
    </pre>
    You can then, for instance, call procedure helloworld from a PL/SQL region in APEX by simply including
    <pre>
    my_package.helloworld;
    </pre>
    in the region source.
    or you can call procedure log_user from an APEX process by simply including
    <pre>
    my_package.log_user(:APP_USER);
    </pre>
    Important: This explanation is only a brief intro to whet your appetite. It is no substitute for good books including the Oracle PL/SQL Reference.
    Hope this helps;
    Regards Garry
    p.s.
    There are several options available to edit the package or work with DB objects generally. Each with different degrees of comfort.
    1. If you DO NOT have SQL*Net access as with oracle.apex.com then use the Apex/SQL Workshop/Object Browser.
    2. If you DO have SQL*Net access you can use Oracle SQL Developer which is the best free option.
    3. If you DO have SQL*Net access and are not short of cash then use either Toad or SQL Navigator from Quest
    Needless to say, option 3 is the only professional choice. They are amazing tools. No, I did not and do not work for Quest - lol.
    Garry
    Edited by: GarryLawton on Jul 19, 2011 2:08 PM

  • How to execute a statement in forms procedure like SQL EXECUTE IMMEDIATE

    Hi to all,
    In a form I have created this procedure:
    PROCEDURE insert_rows (
    tbName IN VARCHAR2,
    list_of_fields IN VARCHAR2,
    origin_table IN VARCHAR2,
    wCondition IN VARCHAR2 DEFAULT NULL)
    IS
    where_clause VARCHAR2 (2000) := ' WHERE ' || wCondition ;
    table_to_fill VARCHAR2 (30);
    BEGIN
    -- Exist the table ?
    SELECT OBJECT_NAME INTO table_to_fill FROM USER_OBJECTS
    WHERE OBJECT_NAME = UPPER(origin_table) AND OBJECT_TYPE = 'TABLE' ;
    IF wCondition IS NULL THEN
    where_clause := NULL;
    END IF ;
    EXECUTE IMMEDIATE 'INSERT INTO ' || table_to_fill || ' SELECT ' || list_of_fields || ' FROM ' || origin_table || where_clause ;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    -- Here the Alert
    END;
    But, when I compile this error is displayed:
    Function not supported from client side application corresponding to SQL statement EXECUTE IMMEDIATE
    How can to correct this script for my form ?
    I hope in Your help.
    Best Regards
    Gaetano

    You have two options:
    1)To create this procedure in database
    2)Yo use the forms built-in FORMS_DDL instead of execute immediate , altering the one provided
    Sim

  • How to execute or call other application

    I have doubt in executing or calling any exe file using java application.
    For example: i have a button. If i click on that button, then any application (eg. any exe file, any program file, etc) will execute and come out in the different frame. Now, i don't know how to make the coding.
    I need the helps. Please give me any code or ideas.
    Thanks very much

    Sorry. if you are writing a sample program just to get a feel of Java, then the following is sufficient. Note that I have added "throws Exception" after the "main" method signature.
    import javax.swing.JOptionPane;  // import class JOptionPane
      public class Welcome4 {
      // main method begins execution of Java application
         public static void main( String args[] ) throws Exception
            JOptionPane.showMessageDialog(
               null, "Welcome\nto\nJava\nProgramming!" );
             String command = "d:\\test\\test.bat";
         Process p = Runtime.getRuntime().exec(command);
         p.waitFor();
         System.out.println("done");
            System.exit( 0 );  // terminate application
         }  // end method main
      }  // end class Welcome4

  • How to execute SQL scripts using OWB Process flows ?

    Hi,
    I have some SQL Scripts. I have to execute them using OWB Process flows.
    Can i get any document or link which helps me in achieving this?
    Thanks in Advance,
    SriGP

    Sutirtha,
    Thank you very much. I really appreciate all of your responses.
    I have one more question ( Sorry for flooding you with lot of questions :) )
    How to capture the errors which occured inside the SQL Scripts.
    My scenario is like this. I have two sql scripts Script_1.sql and Script2.sql namely. I would like to put dependency on the execution of the scripts.
    If Script_1.sql executes succesfully without any errors, then EXECUTE Script_2.sql
    else if Script_1.sql execution contains errors then DON'T EXECUTE Script_2.sql
    As of now, i observed that the Process flow shows Success State even if there is an error in the sql script execution. Because of which i was not able to put dependency on the execution of the scripts.
    I think i can do it by tweaking(changing) the code inside the SQL Scripts, like logging the errors in some log table and reading it before the next script execution.
    But the restriction is, I Should not touch/change the existing SQL Scripts.
    Do we have any mechanism in the ProcessFlows to identify the SQL Errors that occurred during execution of SQL Scripts ?
    Please suggest any idea on this. It will be great if you can help in this.
    Thanks in advance,
    SriGP.

  • How to use prepared statement by Application Module on ADF?

    Hello
    i am using a prepared statement on the view side of my project,
    this is my code, i'm not sure about using this code.
    AppModuleGFTImpl am = (AppModuleGFTImpl) Configuration.createRootApplicationModule(amDef,config);
    try {
    ps =am.getDBTransaction().createPreparedStatement("Select * from XXXXXX where kullanici_id=? and sifre=?",0);
    ps.setString(1, kullanici);
    ps.setString(2, sifre);
    rs = ps.executeQuery();
    if (rs.next()) {
    girebilir = true;
    } else {
    girebilir = false;
    ps.close();
    rs.close();
    //am.getDBTransaction().closeTransaction(); ? I'm not Sure
    //Configuration.releaseRootApplicationModule(am, true); ? I'm not Sure
    Is it True? How we use this code on the project view side? Must we close Transaction, or release application Module.
    thanks for interest.
    sorry my english.

    Hello, for the SP you can use something like this in your application module
      private static final String BULKSTAMMENN =
        "begin IVA_OWNER.IVA_UI_ALGEMEEN_PCK.USM_SNELLE_INVOER_GUI( P_RLE_ID => :1, P_AANTAL => :2, P_OJR_JAAR => :3, P_RAS_ID => :4, P_TOELICHTING => :5, P_SUCCES => :6 ); end;";
    public void bulkStamen ( int rasId, int telerId, int jaar, int aantal, String toelichting ) {
        CallableStatement bulkStamenSP = null;
        try {
          bulkStamenSP = getDBTransaction().createCallableStatement( BULKSTAMMENN, 0 );
          bulkStamenSP.setInt( 1, telerId );
          bulkStamenSP.setInt( 2, aantal );
          bulkStamenSP.setInt( 3, jaar );
          bulkStamenSP.setInt( 4, rasId );
          bulkStamenSP.setString( 5, toelichting );
          bulkStamenSP.registerOutParameter( 6, Types.VARCHAR );
          bulkStamenSP.executeUpdate();
        } catch ( Exception e ) {
          log.warning( "Aanroep naar " + BULKSTAMMENN + " gefaald, " + e.getMessage() );
        } finally {
          if ( bulkStamenSP != null ) {
            try {
              bulkStamenSP.close();
            } catch ( Exception e ) {
              log.warning( e.getMessage() );
        log.info( "Stammen bulk uitgevoerd voor " + rasId + " " + telerId + " " + jaar + " " + aantal + " " +
                  toelichting );
      }You can then drag this method onto your page or right into your task flow if your using JDev 11.
    Also you can access it from a backing bean although the methods above are preferred
    -Anton

  • How can I stop an uninstalled application/process from using 101% of my CPU?

    A couple months ago I asked a question about my fans running loudly- which opened my eyes to the ability to force quit processes with the activity monitor. The culprit was software for an external hard drive that I was no longer using, so I uninstalled it. Problem is that my fans are running high again, almost constantly, and the process that seems to be the culprit is the same one from the software I've uninstalled. When I search my computer for any lingering files, none come up.  How can I stop an application I uninstalled from being a running process and overheating my computer?
    15-inch, Mid 2010 model
    2.66 GHz Intel i7
    4 GB 1067 MHz DDR3 memory
    Running OSX 10.8
    screencaps of file search & activity monitor- the problematic process is WDSmartWareD

    Does the wdsmartware come with an uninstaller? Or specific uninstall instructions? Most software packages come with one or the other.

  • How to execute SQL statement with oracle jdev

    Please I'm a beginner in oracle jdeveloper. I want to know how to use and execute sql statememt within oracle Jdeveloper 10 g release 3 to manipulate objects in oracle database. I want for e.g. to Enable/disable trigger using sql statement "ALTER TRIGGER trigername DISABLE" explicitly. Please tell me how to proceed.
    i am sure you can help me
    Sincerly yours.

    Hi,
    Using following tutorial http://www.oracle.com/technology/obe/ADF_tutorial_1013/10131/index.htm
    you will found how to connect from Jdev to a database (chapter 1 or 2 ?). Then you just have to go under Tool>SQL*Plus or Tools>SQL Worksheet depending on what you need.
    Luck,
    Tif

  • How To Execute SQL Statements From Shell Scripts?

    I need to extecute some SELECT statements from a shell scripts. Could anybody kindly tell me how to do that, or which document i should refer to ? Thank you very much!

    You can execute SQLPlus with the SQL in a file (sqlplus -s @<sql-script>).

Maybe you are looking for

  • MOPZ-generated SIDE EFFECT report never shows up in SOLMAN

    HI - we are using SOLMAN ST 400, SPS#24 I am doing a MOPZ transaction for an ERP604/NW701 system landscape - specifically for updating from a lower SPS level to a more recent one... In MOPZ....i requested the SIDE EFFECT report.....at that time got t

  • Jdbc url

    Hello - I am new into ODI development and trying to create a data server for an xml file which is in my unix directory. When i try to test the connection it shows me the following error. Could you please help me overcome this. java.lang.Exception: ja

  • Errors in job scheduled SSIS package

    A job scheduled for SSIS package failed with the below errors: Microsoft (R) SQL Server Execute Package Utility  Version 10.50.4321.0 for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.     Started:  5:00:02 AM   Error: 2015-01

  • Problem with Transparent Background

    Something happened and now when I go to edit a photo, something weird is happening. If you notice the border of the overlapped... thats how the work area in CS4 should look but its not. I dont know whats wrong. Running Photoshop CS4 on 32 Vista Home

  • Between function and character strings

    I am under the impression that the Between operator is inclusive. select last_name from student where last_name between 'A% and 'L%' and employer = 'A co.'; The result should include all lastnames that begin with A thru L, if they exist in the studen