Run procedure from SQL Workshop Command window?

hi, this one is simple.
how to run a created procedure from APEX SQL Workshop SQL Command window?
simon

Simon,
begin [proc_name]; end;
-Carsten

Similar Messages

  • Run function from SQL Workshop Command window

    hi, cant get it work, maybe someone will help. i need to test the function running, how to launch it in workshop window?
    currently im thinking of something alike:
    declare a varchar2(62);
    begin
      a:=VAL_MERGE_SQL();
    end;Simon

    hi Geert,
    thanks for the tip, but my function uses DDL statements, so it cant be executed in DML statement like select.
    problem solved: DDL statement inside function must use global keyword (create global...) then it can be executed like this:
    declare
      a varchar2(62);
    begin
      a:=VAL_MERGE_SQL;
    end;greets,
    Simon

  • How to run procedure from SQL Commands

    I have tried several ways, for example:
    EXECUTE POPULATE_HIERARCHY(121121);
    but I get the error: ORA-00900: invalid SQL statement.

    BEGIN
      POPULATE_HIERARCHY(121121);
    END;

  • How run Procedure in SQL Developer?

    I need run procedure in SQL Developer with parameter : 2009
    create or replace PROCEDURE "update_table" (ff_year in varchar2) AS
    CURSOR c_update IS
    select DISTINCT P.mafew name, u.frew nameone, t.greddf, .........
    I click green button RUN and have new window Run PL/SQL. Where in this script I need to print 2009?
    DECLARE
    FF_YEAR VARCHAR2(200);
    BEGIN
    FF_YEAR := NULL;
    update_table(
    FF_YEAR => FF_YEAR
    END;

    Hi,
    user10886774 wrote:
    Thanks all!
    I can run the procedure like 1 or 2 example? Is it right?
    1 like Run Script
    EXEC "UPDATE_TABLE" ('2009');
    2 click RUN on UPDATE_TABLE procedure
    DECLARE
    FF_YEAR VARCHAR2(200);
    BEGIN
    FF_YEAR := '2009';
    UPDATE_TABLE(
    FF_YEAR => FF_YEAR
    END;
    What is the name of the procedure?
    Is it update_tabe (all small letters)? If so, you must reference it as "update_table" (all small letters, inside double-quotes).
    Is it UPDATE_TABLE (all capital letters)? If so, you have the choice of referencing it as "UPDATE_TABLE" (all capital letters, inside double-quotes) or as update_table, or Update_Table, or UPDATE_TABLE, or uPdAtE_taBle, or ... (any kind of letters, without quotes).
    How about commit after?How about it?
    What is the question?
    If you want to commit, say COMMIT or click on the COMMIT icon.

  • How to view  a stored procedure from sql plus

    Can anyone please tell what is the command for viewing the content of the stored procedure from sql plus ?
    Thanks

    Hi,
    I use this simple script to retrieve.......
    EDTRAD@T_E_S_9-->l
    1 select text from all_source where name = 'GET_MAN' -- proc name here
    2* order by line asc
    EDTRAD@T_E_S_9-->/
    TEXT
    FUNCTION get_man (in_man SSBOSS.CLNTWORK.manager%type)
    RETURN varchar2 IS
    CURSOR get_man(in_man SSBOSS.CLNTWORK.manager%type) IS
    SELECT name
    FROM ssboss.clntwork
    WHERE agency = 'TM'
    AND manager = in_man
    AND manager is not null
    AND manager != '**OB**';
    v_man SSBOSS.CLNTWORK.name%type := null;
    BEGIN
    OPEN get_man(in_man);
    FETCH get_man INTO v_man;
    IF get_man%notfound THEN
    v_man := 'Manager Not Found !';
    RETURN (v_man);
    CLOSE get_man;
    END IF;
    RETURN (v_man);
    CLOSE get_man;
    END;
    21 rows selected.
    EDTRAD@T_E_S_9-->

  • Java Stored Procedure via Function Give 0RA 600 from SQL Workshop and App

    Hi,
    Anyone experienced stored procedures or functions failing when called from APEX app or SQL Workshop ( ora 600 ) yet they work fine when called from SQLPlus?
    Sqlplus connected as my apex workspace schema owner:
    select net_services.test_db_connection_via_ldap(
    'APEXPRD1', 'test1', 'test1', null ) as result from dual;
    RESULT
    The database connection attempt was SUCCESSFUL
    From Apex Sql Worshop:
    select net_services.test_db_connection_via_ldap(
    'APEXPRD1', 'test1', 'test1', null ) as result from dual;
    ORA-00600: internal error code, arguments: [16371], [0x434B08150], [0], [], [], [], [], [], [], [], [], []
    NOTE: Same result when run in response to button push on page in application.
    Apex Version: 3.2.1.00.10
    Oracle Version: 11.1.0.7.0
    NOTE: I am using the embedded plsql gateway; was going to try NOT using it to see if it was shared server related (seemed to be from trc files)
    Any ideas?
    Since the code works from sqlplus, I know that it's good: Here some snippets
    -- ========================================================================================
    public class NetServices extends Object {
    public static String doTestDbConnectionViaLdap
    String piDbConnUrl,
    String piUserName,
    String piUserPassword
         String vResult = null;
    try
         Connection conn = null;
         OracleDataSource ods = new OracleDataSource();
         ods.setUser( piUserName );
         ods.setPassword( piUserPassword );
         ods.setURL( piDbConnUrl );
         conn = ods.getConnection();
         conn.close();
         vResult = "The database connection attempt was SUCCESSFUL";
    } catch ( SQLException e )
         int vErrCode = e.getErrorCode();
         String vErrMsg = e.toString();
              if ( vErrCode == 1017 ) {
              vResult = "The database connection attempt FAILED! Incorrect Username or Password";
         } else if ( vErrCode == 17433 ) { // Null Username or Password
              vResult = "The database connection attempt FAILED! You must provide both a Username and a Password";
         } else if ( vErrCode == 17002 ) {
              vResult = "The database connection attempt FAILED! Net Service Name was Not Found";
         } else if ( vErrCode == 17067 ) { // NULL Net Service Name
              vResult = "The database connection attempt FAILED! You must provide a Net Service Name";
         } else {
              vResult = "The database connection attempt FAILED! Error " + vErrCode;
    return vResult;
    } // method: doTestDbConnectionViaLdap
    -- ========================================================================================
    function do_test_db_connection_via_ldap
    pi_db_conn_url IN VARCHAR2,
    pi_user_name IN VARCHAR2,
    pi_user_password IN VARCHAR2
    return VARCHAR2
    is -- PRIVATE to the net_services package
    language java -- NOTE: See cr_java_class_NetServices.sql for actual java implementation
    name 'NetServices.doTestDbConnectionViaLdap
    ( java.lang.String, java.lang.String, java.lang.String ) return java.lang.String ';
    -- ========================================================================================
    function test_db_connection_via_ldap
    pi_net_service_name IN VARCHAR2,
    pi_user_name IN VARCHAR2,
    pi_user_password IN VARCHAR2,
    pi_search_base IN VARCHAR2
    return VARCHAR2
    is -- PUBLIC procedure
    v_url      VARCHAR2(256);
    begin
    g_err_source := 'NET_SERVICES.test_db_connection_via_ldap';
    g_err_action := 'build_jdbc_conn_url_using_oid';
    /*     NOTE: We don't want to assert the parameters because we don't want to raise
    an exception;
    -- Get the jdbc connection url that uses oid info
    v_url := build_jdbc_conn_url_using_oid( pi_net_service_name, pi_search_base );
    return( do_test_db_connection_via_ldap( v_url, pi_user_name, pi_user_password ) );
    end test_db_connection_via_ldap;
    -- ========================================================================================
    Thanks in advance for your consideration.
    Troy

    Troy:
    You could be right in your guess that the error is related to MTS. Search Metalink for '16371'. Why not switch your APEX app to use OHS and test whether the error persists. ?
    varad

  • Trying to run simple procedure in SQL Workshop

    Hello,
    I'd like to test how procedures work and APEX so I setup a simple one that I'd like to run in SQL Workshop (below). I try the follow to execute the procedure:
    begin
    MY_TEST_PROC;
    end;
    But it results in the following error:
    ORA-06550: line 2, column 1:
    PLS-00306: wrong number or types of arguments in call to 'MY_TEST_PROC'
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    I've spelled the procedure name correctly, and there are no input parameters required. Why is it erring?
    Steve
    Procedure:
    create or replace procedure "MY_TEST_PROC"
    *(p_contract_number OUT VARCHAR2)*
    is
    begin
    select
    contract_number
    into
    p_contract_number
    from contracts
    where id='5';
    end;

    dbms_output will display a variable's contents. I don't recall if you need set serveroutput on for APEX SQL Workshop or not (I don't have it up right now)
    set serveroutput on size 1000000
    declare
      result varchar2(4000);
    begin
       MY_TEST_PROC(result);
       dbms_output.put_line('My proc result = '||result);
    end;The documentation for all the variations of development (11gR2) is here: http://www.oracle.com/pls/db112/portal.portal_db?selected=5&frame= It can be overwhelming starting out. Since you are jumping into stored procedures with APEX, I suggest starting with the 2-day developers guide, then the PL/SQL Language Reference.

  • What is the correct syntax to run a procedure in SQL Workshop

    I have a procedure I want to test in SQL Workshop in APEX. It has one argument but I don't know the syntax to include the argument. I have put
    begin download_attached_files;
    end;
    how do I manually assign a number to this procedure?
    ( i.e this doesn't work:
    begin download_attached_files=43; end;)

    Hi,
    Try:
    BEGIN
    EXECUTE download_attached_files(43);
    END;Andy

  • Calling Procedure from SQL Developer

    Could anyone tell me how to call a Procedure from a SQL Worksheet using SQL Developer?
    I can run by right clicking the Procedure in the Connections window, but want to call it using SQL commands.
    I can run it using EXECUTE procedurename in SQL Plus but I get an ORA-00900 - invalid SQL statement if I try this in a SQL Worksheet. If I try CALL procedurename, I get an ORA-06576 - not a valid procedure or function name.
    Am I doing something daft (I've been using Oracle for 3 days)?

    begin
    procedure(params);
    end;

  • Executing pl/sql procedure in SQL Workshop

    Hello.
    My understanding is that the only way to execute a pl/sql procedure in the SQL Workshop is via SQL Scripts, because running it under SQL Commands causes
    "ORA-00900: invalid SQL statement".
    Here is the statement I would like to run:
    execute efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    and here is the message I get when I run it under SQL Scripts:
    You have requested to run a script that does not contain any runnable statements.
    Script Name TEST
    Created on 02/14/2008 10:47:15 AM by ADMIN
    Updated on 02/14/2008 10:56:45 AM by ADMIN
    Number of Statements 0
    Script Size in Bytes 86
    thanks
    Boris

    Boris,
    Execute is a SQL*Plus command.
    It should work if you call your procedure in a begin-end block. e.g:
    begin
      efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    end;

  • Run Procedure From a Report

    Hi All,
    I have what seems like a simple question. How do you run a procedure from reports? I have a procedure that I would like to pass some user defined parameters to from the parameter form, then run the procedure. The procedure populates a table that the report uses as a source for its data. In theory you should be able to give global values to your parameters and them use an after parameter form/before report trigger that kicks off your procedure. I have tried those "execute" commands from the reports help but no luck.
    Does anyone have the answer?
    Cheers,
    Bradley

    Hi Bradley,
    You would run the procedure like you would run a procedure in PL/SQL. Which means you should not include the word "execute".
    procedure_name(:p_param1,:p_param2);
    I hope this helps,
    Tom

  • SQL works from SQL*Plus command line but not as a DBMS_JOB submitted job

    Oracle 10g 10.2
    Got a procedure which does not run correctly as an Oracle job but runs fine as a SQL script.
    There are no Oracle errors (or any errors) of any kind when the job does not run fine – it just does not update any rows. But when run as a SQL script – the same way it is run as a job – then the rows are updated.
    Any ideas?

    Good stuff....
    See my replies to some of the questions in italics
    a) Different NLS settings => The job uses the NLS settings of the session that created it. If you create it with some tool like TOAD, you might have a different environment than with sql*plus. Runs good in TOAD and SQL*Plus using the command-line feature - just 'acts funky' when submitted.
    b) Interval issue. Are you sure the job was running? Isn't still running? The job runs successfully - even logs a successful message in our logging table.
    c) User/priviledge issue. Sometimes a job needs direct grants whereus a procedure can be called with priviledges granted through roles. Don't know - need to check this out.
    d) Transaction handling / Error Handling. The job runs into some error, but the error is supressed, because of bad exception handling. What is the value in the BROKEN column, when you do: select * from user_jobs; I would think that, since the errors are logged into a side table, an error would be found there. However, no errors are found. The BROKEN column is 'N'.

  • Calling Oracle store procedure from Crystal 11 command

    I need to call Oracle store procedure from Crystal Command. The Store proc has ref cursor. Is it possible. Can you post few examples?
    Also, is it possible to have multiple sql statements in a Crystal Command, when working with Oracle 10g?
    It is working for SQL server.

    Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly.

  • How to run procedure in sql navigator?

    Hi,
    Can anyone tell me how can i run stored procedures in a package from SQL NAVIGATOR?
    Thank you

    If there are no OUT-Parameters just
    exec <package_name>.<procedure_name>
    as it´s done in SQL*Plus.
    Regards,
    Gerd

  • Unable to run reports from the unix command line

    hi
    all of a sudden i am unable to run reports ( on App server 10g) either from the unix scripts or from the unix command line. But i can run them from the forms.
    Any one have any idead about this.
    Thank you

    thanks all for replying
    i have set the env variables for the session and it worked. Looks like i have to set the oracle_home and ld_library_path every time ( opening a new putty session) i call sqlldr.
    But in a whole i am trying to run sql loader from the forms. Right now we have Oracle app server 10g which forms 10g version. As oracle app server 10g didnt come with sqlldr, we are copied the sqlldr of database on to app server with different home. after this we can run sqlldr ( on app server ) from unix scripts but not from Forms. Then we opened a qurey with oracle about app server 10g not commig with sqlldr and its remedy . But they said that they dont have specific remedy for that and suggested the same what we did.
    So we came up with java package which does the same funtion as host command and trying to run sqlldr which is on the database( ie replacing the host command in the forms with the database funtion). By using that funtion i am able to run the sqlldr from sql plus but not from forms. I couldnt easily debug it as i wont through any error messages.
    Any one have any idea of this ...
    Thank you

Maybe you are looking for

  • TS1538 Ipod Classic will not work with Windows 8. Is there a fix?

    Itunes will not work with Windows 8. I have the latest version of itunes! When will the fix be available? When I try to Sync my ipod, nothing happens.

  • Keynote 6.0 won't show on second monitor

    I have update to Mavericks and Keynote 6.0.  I'm on a 15 inch Early 2011 MacBook Pro, and connected to a LG Display via VGA through the Apple VGA adapter.  When I try to play a slideshow, it only shows on the Mac Book Pro with the Presenter display b

  • This dock won't dock on one side

    The Grinch has taken away my tree: this morning my dock will not dock on the right where it usually resides. It's fine on the bottom and left. I've trashed the com.apple.dock.plist and it still won't show with or without hiding. Not a big deal but an

  • Updating iphone operating system

    How can I update my iphone 4 to the latest operating system without loosing all of my aps.?so

  • Hyperlinks in Navigation Menu?

    I want to have a hyperlink to another website in the navigation menu on my website. How do I do this? I can't seem to find anything.