Problem listing code of a store procedure

i am trying to list code of a store procedure by running following sql
select text from user_source where name = 'sp_insert_hpemployee' and type = 'procedure';
it says
no rows selected
can you please let me know where i am going wrong.

select text from user_source where UPPER(name) = 'SP_INSERT_HPEMPLOYEE' and upper(type) = 'PROCEDURE';
or
select dbms_metadata.get_ddl('PROCEDURE','SP_INSERT_HPEMPLOYEE') from dual;

Similar Messages

  • Mapping to store procedure

    Hi,
    I want to have a custom mapping to a database table. the only difference
    that I need in synchronization between JDO and table is during insert. I
    need to execute a store procedure that do actual insert in the table and
    after that makes some other inserts in another table. I've already have
    the code for that store procedure but I don't know how to make the mapping
    between the JDO and table and insert stored procedure.
    Thank you
    Stefan

    Stefan-
    Check out the samples/timestampField/ directory in the Kodo 2.5.0
    distribution for a simple example of using a custom mapping. You can
    adapt this mapping to execute the custom logic when you need to do the
    insert.
    See also:
    http://docs.solarmetric.com/javadoc/com/solarmetric/kodo/impl/jdbc/ormapping/ClassMapping.html#insert(com.solarmetric.kodo.runtime.StateManagerImpl,%20com.solarmetric.kodo.impl.jdbc.SQLExecutionManager)
    In article <b5snsj$jkq$[email protected]>, stefan wrote:
    Hi,
    I want to have a custom mapping to a database table. the only difference
    that I need in synchronization between JDO and table is during insert. I
    need to execute a store procedure that do actual insert in the table and
    after that makes some other inserts in another table. I've already have
    the code for that store procedure but I don't know how to make the mapping
    between the JDO and table and insert stored procedure.
    Thank you
    Stefan--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Permission problem calling a java object from a store procedure

    When I run my store procedure
    CREATE OR REPLACE PACKAGE BODY confirms_write_to_file
    AS
    FUNCTION translate(in_en_var in VARCHAR2)
    RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'translate.translatePath(java.lang.String) return java.lang.String';
    PROCEDURE write_to_file(in_file_name IN VARCHAR, in_en_var IN VARCHAR)
    IS
    file_handle               UTL_FILE.FILE_TYPE;
    file_location VARCHAR2(50);
    BEGIN
    file_location := translate(in_en_var);
    dbms_output.put_line ('opened file location' ||file_location);
    END write_to_file;
    END confirms_write_to_file;
    I get the following error:
    exec confirms_write_to_file.write_to_file('zzzz','$RIMS_LOG');
    SQL> exec confirms_write_to_file.write_to_file('zzzz','$RIMS_LOG');
    Exception java.security.AccessControlException: the Permission
    (java.io.FilePermission <<ALL FILES>> execute) has not been granted by
    dbms_java.grant_permission to
    SchemaProtectionDomain(RIMS|PolicyTableProxy(RIMS))
    opened file locationProcess problem
    PL/SQL procedure successfully completed.
    When I try to to grant myself the permissions
    begin
    dbms_java.grant_permission('rims','java.io.FilePermission','*','execute');
    dbms_java.grant_permission('rims', 'java.lang.RuntimePermission', '*','writeFileDescriptor' );
    end;
    I get the following Error:
    oracle.aurora.vm.IdNotFoundException: rims is not a user or role
    at oracle.aurora.rdbms.DbmsRealm.getId(DbmsRealm.java)
    at oracle.aurora.rdbms.DbmsRealm.getId(DbmsRealm.java)
    at
    oracle.aurora.rdbms.security.PolicyTableManager.findAll(PolicyTableManager.java)
    at oracle.aurora.rdbms.security.PolicyTableManager.find(PolicyTableManager.java)
    at
    oracle.aurora.rdbms.security.PolicyTableManager.activate(PolicyTableManager.java
    at
    oracle.aurora.rdbms.security.PolicyTableManager.grant(PolicyTableManager.java)
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.aurora.vm.IdNotFoundException: rims is not a user or role
    ORA-06512: at "SYS.DBMS_JAVA", line 0
    ORA-06512: at line 2
    My java code is as follows
    import java.io.*;
    import java.util.*;
    class translate
         public static String translatePath(String envar)
              Runtime rt = Runtime.getRuntime();
              int bufSize = 4096;
              byte buffer[] = new byte[bufSize];
              String path = null;
              Process p = null;
              int len = 0;
              try
                   p = rt.exec("echo "+envar);
                   BufferedInputStream bis = new BufferedInputStream(p.getInputStream());
                   while ((len = bis.read(buffer, 0, bufSize)) != -1)
                        System.out.write(buffer, 0, len);
                   path = new String(buffer);
                   p.waitFor();
              catch(Exception e)
                   System.out.println("Exception "+e);
                   return "Process problem ";
              return path;

    Tony,
    I answered this very same question that you posted at the JavaRanch forum.
    Good Luck,
    Avi.

  • Problem when call store procedure over a database link

    Hi all,
    I've create a database link in server "EAST" similar like:
    CREATE DATABASE LINK db_link CONNECT TO tiger IDENTIFIED BY scott USING 'abc';
    and from server "EAST" i ran the procedure located in server "WEST" somethin like:
    exec testing_procedure@db_link('test');
    testing_procedure is look like:
    Create or Replace procedure testing_procedure (p_testing in varchar2)
    as
    cursor check_space is
    select sum(bytes)/1024/1204 tb_size
    from dba_data_files;
    my_check_space%ROWTYPE;
    begin
    open check_space;
    loop
    fetch check_space into my_check_space;
    exit when check_space%NOTFOUND;
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);
    end loop;;
    close check_space;
    end;
    and my problem is when i'm run procedure from "EAST" server, the values in test_tf table is the same as when you run that procedure from "WEST" server. I've check the size for both server "EAST", and "WEST" by select sum(bytes)/1024/1204 command. And the value is completely different. And i guest somehow it reuse the value of "WEST" server no matter when you run that procedure in "EAST" server. Any suggesttion, please give me some advices.
    Thanks,
    Kevin

    If this procedure is in WEST server then even if you call it from some another planet using db link, the cursor inside the procedure will fetch the data from that server only means WEST server. So "select sum(bytes)/1024/1204 tb_size
    from dba_data_files;" statement in your procedure always fetch the size of the datafiles belongs to the WEST database.
    If you want to store the data of two different databases then you have to create the similar procedure in EAST database also.
    BTW, you said the you created a database link "db_link" in EAST database to point to WEST database and on WEST database you have that procedure BUT I don't understand why r u using "db_link" in your procdure code in WEST server in this insert statement:
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);Is there a database link on that box also?? Where it is pointing to?? And if not then this code should not be compiled.
    Daljit Singh

  • I have a problem for download in app store . it shows error code : 1009

    i have a problem for download in app store . it shows error code : 1009

    https://discussions.apple.com/thread/2439043

  • Problem with Pie chart, Store Procedure and Category Axis

    Hi All,
    I'm having a problem when i try to use a Pie Chart with a store procedure
    when Category Axis - Field value is "none", the chart appears, but the description say Undefined
    but when i put any field from store procedure, the chart doesn't show.
    when I try the same with a normal SQL statement, all data was displayed
    my store procedure only have 2 columns
    n - numeric
    state - text
    The Store Procedure and the SQL, returns the same data in the same order
    Thanks in advance
    Cristian

    Hi guys,
    I need guide on creating a system using store procedure, referring to this thread: JDBC System Connection VS BI JDBC System Connection
    Hope you can help me out.
    Thanks a lot,
    Sarah

  • Problem of retrieve a set of data when calling store procedure using vb with ODBC

    when I use ODBC, it can return 1 record (1 field) using pass and retrieve the parameter. but it cannot success when return a set of data (using recordset to store it), when i do it, the error message (Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if availabl. No work was done.). Why ? and how can solve it ?\
    Thanks in advance.

    oh, really ? it is not use ODBC to connecto to oracle ?
    Here is my program code:
    STORE PROCEDURE:
    PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
    IS
    BEGIN
    OPEN BasicCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
    OPEN RiderCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
    END getInforcePolicy;
    PACKAGE oraoledb AS
    TYPE m_refcur IS REF CURSOR;
    END oraoledb;
    Program:
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    Dim cmd As New ADODB.Command
    Dim paramclient As New ADODB.Parameter
    Dim parampolicy As New ADODB.Parameter
    Dim I As Integer
    cn.Open "ridev", "abc","abc"
    cmd.ActiveConnection = cn
    Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
    Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
    paramclient.Value = "0000023011"
    parampolicy.Value = "HK0010021U"
    cmd.Parameters.Append paramclient
    cmd.Parameters.Append parampolicy
    cmd.CommandText = "{call getInforcePolicy}"
    Set rs = cmd.Execute
    Do While Not rs.EOF
    Loop
    Set rs2 = rs.NextRecordset
    Do While Not rs2.EOF
    loop
    Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE"

  • JTA (EJB-- Store Procedure) Problem

    I'm currently facing a problem that I'm not sure how to fix it.
              I have a Controller class that is accessing many EJB (Session Stateless Container Managed) that are a kind of Store Procedures' Wrappers.
              The Controller initializes the transaction using the UserTransaction and it commits or rollback as needed, also de EJBs at some points use the setRollbackOnly() and also inside the store procedures are some explicit commits.
              What should I expect in the following scenario:
              UserTransaction ut=null;
              try {
              ut = getUserTransaction();
              ut.begin();
              ejb1.update(); //Calls a store procedure that in the pl/sql calls commit
              ejb2.delete(); //Inside the Ejb some component throws an exception and is catched by the Ejb, then it calls setRollbackOnly() and throws a new Exception
              ut.commit();//This is not called because the previous exception
              } catch(Exception e){
              ut.rollback();//Rollback is called
              1) Is the modified data inside ejb1.update saved?
              2) Is this all wrong?
              3) What could it be a right approach to refactor this?
              Thanks,
              Johann

    johann renck wrote:
              > There is one store proc who cares about logging that is called by many others sp that
              > is the one who does commit and also is wrapped by an Ejb so it is also called inside
              > the application. Have this sp its own transaction context so when it does commit it
              > just commits the logging?
              >
              > Thanks,
              > Johann
              Yes, always. Any procedure that calls begin tran, commit, rollback, or any other call that
              changes the transactional behavior of the session, must be isolated from everything that
              WebLogic thinks is part of a transaction. Otherwise you're just going to jeopardize the
              integrity of your WebLogic-defined transactions. Ideally, you want all your transactions
              defined and controlled at one level. From the EJB/WebLogic point of view it would be much
              safer and superior to never call any procedure that had such stuff, and then do logging
              as it's own WLS EBJ tx, called everywhere needed, from within but separate from larger EJB
              transactions. Even if a logging EJB did nothing besides writing one log row, the procedure
              shouldn't call commit. The EJB system will do that.
              Note well: Anything that calls that logging procedure with the commit, commits it's
              current possibly partial transaction to that point. The DBMS connection only has one
              transaction going on at a time, and a commit permanently locks in everything changed since
              the last commit. It is not good architecture to have commits in any utility procedure.
              At the very least, if your procedures want a transaction, they should start and end
              in one procedure, eg:
              BEGIN
                   declare boolean variable in_tx
              set in_tx true if @@trancount > 0
                   if (not in_tx) BEGIN TRAN -- Otherwise, just become part of current tx
                   ... do work... this is only needed for multi-update work
              if (not in_tx) COMMIT TRAN
              END
              If the procedure only does one update/insert/delete *you don't need any
              tx control*! eg:
              BEGIN
                   insert into mylogtable values (.....)
              END
              That one insert will be part of any ongoing tx if extant, or
              will be it's own one auto-commit tx.
              If you have a procedure that must be it's own tx, then you must
              do:
              BEGIN
                   if (@@trancount > 0) raiserror("Can't call this procedure from an ongoing transaction. It must be able to commit immediately")
              END

  • Am having problems buying app from App Store ... It's not recognizing my credit card security code... It's says " incorrect code" any help pls wot do I do

    Am having problems buying app from App Store ... It's not recognizing my credit card security code... It's says " incorrect code" any help pls wot do I do

    This can be caused by a few things.
          Make sure the billing card address, the one on the statement is the exact
                 same as in iTunes.
          Note even the zip code being off can cause this.
           Try a different CC
          and the way the always works
              An iTunes GC.

  • TS1702 I upgraded my iPad 2 to ios6 & now certain apps (YouTube ) are gone & are not listed in the App Store. Another app (ny1 news) no longer works! Again it's not listed in the App Store. How do you correct this problem?

    What happened to mt apps after uploading ios6
    some are gone, some don't work & they are not listed in the App Store anymore

    I found the following in the Macbook Help, and the last bullet worked for me.
    "You can uninstall apps you got from the Mac App Store, from other websites, or from discs. You can’t uninstall apps that are part of OS X, such as Safari and Mail.
    Apps downloaded from the Mac App Store: Click the Launchpad icon in the Dock, hold down an app’s icon until all the icons begin to jiggle, then click an app’s delete button . If you later want the app, you can reinstall it from the Mac App Store.If an icon doesn’t have a delete button, it can’t be uninstalled in Launchpad. For more information about Launchpad, see Use Launchpad to view and open apps.
    Apps that have an uninstaller: In the Finder sidebar, click Applications. If an app is inside a folder, it might have an Uninstaller. Open the app’s folder. If you see Uninstall [App] or [App] Uninstaller, double-click it and follow the onscreen instructions.
    Apps that don’t have an uninstaller: In the Finder sidebar, click Applications. Drag the app from the Applications folder to the Trash (located at the end of the Dock), then choose Finder > Empty Trash.If you change your mind, before emptying the Trash, select the app in the Trash, then choose File > Put Back.WARNING: When you empty the Trash, the app is permanently removed from your Mac. If you have any files that you created with the app, you may not be able to open them."

  • Exec XP_CMDSHELL cannot find store procedure problem

    I run EXEC sp_configure 'xp_cmdshell', 1
    Message is"....change from 1 to 1 "
    Then
    EXECXP_CMDSHELL 'Dir N:'
    cannot find store procedure xp_cmdshell
    I check master database.
    No dbo.xp_cmdshell under store procedure.
    How to fix it? I need run command
    EXECXP_CMDSHELL 'Dir N:'
    Thanks

    Hallo Bestrongself,
    - what SQL Server version do you use?
    - since SQL 2005 xp_cmdshell is located in the sys-schema and the procedure itself is located in the resource database of Microsoft SQL Server.
    You can check xp_cmdshell by using the following command:
    SELECT * FROM sys.all_objects WHERE name = 'XP_CMDSHELL'
    I bet you will see it in the master database because you cannot drop system procedures and will return an error if you try to do so:
    USE master;
    GO
    BEGIN TRANSACTION
    DROP PROCEDURE dbo.xp_cmdshell;
    DROP PROCEDURE sys.xp_cmdshell;
    DROP PROCEDURE xp_cmdshell;
    ROLLBACK TRANSACTION
    To execute xp_cmdshell you need to have [CONTROL SERVER] permissions otherwise it won't work. Let's say I have a login which I grant exclusive permissions to execute xp_cmdshell it will fail!
    USE master;
    GO
    -- create the login and the user in master-database
    CREATE LOGIN test WITH PASSWORD = 'glmdpf12345', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF;
    CREATE USER test FROM LOGIN [Test];
    GO
    -- grant explicit permission to execute the xp_cmdshell
    GRANT EXECUTE ON sys.xp_cmdshell TO test;
    GO
    -- tryp to execute xp_cmdshell as test
    EXECUTE AS login = 'test'
    EXEC xp_cmdshell 'DIR C:';
    REVERT
    -- Housekeeping
    REVOKE EXECUTE ON sys.xp_cmdshell TO test;
    DROP USER 'test';
    DROP LOGIN 'test';
    As you can see from the above statement the login "Test" got exclusive permission to execute xp_cmdshell but the execution will fail with the following error message:
    The xp_cmdshell proxy account information cannot be retrieved or is invalid. Verify that the '##xp_cmdshell_proxy_account##' credential exists and contains valid information.
    The above error message is clear. Test is a "normal" user which has the permission to execute the proc BUT due to missing permissions to retrieve the information about the service account it fails!
    You have to grant SERVER CONTROL to the account.
    So - next step...
    What is your permission on server level?
    You can check your permissions by using the following statement:
    -- what are my permissions on server level
    -- check for CONTROL SERVER!
    SELECT * FROM sys.fn_my_permissions (NULL, 'SERVER') ORDER BY permission_name;
    -- what are my permissions for the object xp_cmdshell
    SELECT * FROM sys.fn_my_permissions('xp_cmdshell', 'OBJECT');
    Can you provide us with the results of the above query?
    BTW: xp_cmdshell is a well documented statement and official command which is fully supported by Microsoft. You can find all information about functionality and security of xp_cmdshell here:
    http://technet.microsoft.com/en-us/library/ms175046.aspx
    MCM - SQL Server 2008
    MCSE - SQL Server 2012
    db Berater GmbH
    SQL Server Blog (german only)

  • Insert and update same record of table using store procedure in oracle 10g

    Hi,
    I am using oracle sql developer for this.
    I have created Store procedure which run after every 30mins of interval.
    the problem is Ii need to insert data for first time of day then later that same record should update for particular field(here its plan code).
    if new field is coming (if new plan code is generated) then it should insert data and again update same for interval.
    means for each plan individual record(i.e. plan wise summary) should be there for only a day. next day new record for same plan.

    Hi,
    You should use Merge like shown below:-
    Merge into original_table a
    using second_table b
    on (a.primary_key=b.primary_key and a.primary_key........)
    when match then
    update set column_list=b.column_list
    when not match then
    isert into (column list)
    values(a.column_list)If you dont know much about merge then follow below link..
    http://www.oracle-developer.net/display.php?id=203
    http://www.oracle-base.com/articles/10g/merge-enhancements-10g.php

  • Java Store Procedures

    Hi Guys,
    Does anyone know if it is possible to implement a java store procedure that will be subsequently called in a "select" operation within a "where" statement in Oracle 9R2?
    Thanks,
    Andrea

    Hi Andrea,
    From your sample code, I get the impression that you aren't too familiar
    with Oracle (and perhaps even databases in general?). This leads me
    to believe that you are looking for someone who will do your work for
    you. If that is the case, then I suggest you employ an independent
    contractor (or consultant) who, I'm sure, will be more than happy to
    accomodate you -- and I'm sure will do a much better job than I can
    (via this forum).
    Please forgive me if my interpretation is incorrect, however I feel,
    that with a little effort on your behalf, you can find the solutions
    to your problem by looking through the Oracle documentation, sample
    code and "how-to" documents that are available from Oracle's "Technet"
    web site:
    http://technet.oracle.com
    If, after that, you run into a specific problem, then please ask a
    specific question on this forum and I will try to provide a specific
    answer (if I can :-).
    Good Luck,
    Avi.

  • About JDBC CALL STORE PROCEDURE with out parameter is greater than 4000

    Hi Guys,
    I have a problem call store procedure with a large string.
    as i know varchar2 can contain 32767 characters in pl/sql .
    But when i used varchar2 as a out parameter in a store procedure, if the out parameter is greater than 4000 characters , it always give me error message as 'the buffer is too small'.
    why it happened?
    I read some article that says i need configure a property in data-source.xml , and jdbc 10g driver already solved this problem, but i used jdev 10.1.3.2 ,the driver should be fine.
    How can i solve this problem?
    Thanks in advance,
    AppCat

    Object is Foundation, Execute Script
    This is for a query, you can change to a stored procedure call. Pull the value back in the Java code then put into the process variable.
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import java.sql.*;
    PreparedStatement stmt = null;
    Connection conn = null;
    ResultSet rs = null;
    try {
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:IDP_DS");
    conn = ds.getConnection();
    stmt = conn.prepareStatement("select FUBAR from TB_PT_FUBAR where PROCESS_INSTANCE_ID=?");
    stmt.setLong(1, patExecContext.getProcessDataLongValue("/process_data/@inputID"));
    rs = stmt.executeQuery();
    rs.next();
    patExecContext.setProcessDataStringValue("/process_data/outData", rs.getString(1));
    } finally {
    try {
    rs.close();
    } catch (Exception rse) {}
    try {
    stmt.close();
    } catch (Exception sse) {}
    try {
    conn.close();
    } catch (Exception cse) {}

  • Deski report which is using a Store Procedure - Redirecting connection

    I have a DeskI report which is using a Store Procedure as its data provider.
    This is an Oracle based Store Procedure.
    Where can i see wich connection (connections listed in CMC) is used in DeskI report ?
    How can i redirect one connection to point to another on report?
    Thanks
    Georg

    Marina,
    The strategy for displaying LOV via Infoview needs to be different than what you've set up via DeskI.  The main difference is that when using a client/server program like DeskI, the LOV is cached to the client, thus producing a list more quickly, however, over the web, the web client does not cache LOV as readily.  To "solve" this "problem" you need to go back to your universe and trace what is happening.  If the LOV is getting generated through an essential "select distinct" on the fact/dimension table, and that table has over a million rows, then it will take some time to generate the list (and thus will timeout).  A different strategy to take is to maintain a "backend lookup" table that the LOV will point to instead.  The backend lookup table will contain the unique instances of the column getting scanned and thus when the LOV points to the new lookup table the response will be quicker versus the old method.  Care must be taken each time new data is loaded to WH to ensure that any new unique values from the "home" table/column are also placed in the backend lookup table.
    thanks,
    John

Maybe you are looking for