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.

Similar Messages

  • 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

  • Trying to run simple servlet - error

              I am the first time user of Beas Weblogic & I am trying to run simple example
              servlets from Weblogic Console. However, when I try to LoadServlets, I get an
              error 'Property Change Error for Property "Load"; Unable to load servlet'
              Is there anything I am missing? I'd appreciate any help.
              Thx.
              Ravi
              

    Hi,
    I have found out the cause. im pointing to the wrong classpath. it should be class12.zip instead of class111.zip, something i copied from my server running oracle8i.

  • 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

  • I want to run simple procedure in TOAD

    Hi guys ,I have already compiled the procedure .When i run it it gives me another window.please help me out .I will give you the procedure and what i get after i execute
    This is the procedure
    CREATE OR REPLACE PROCEDURE find_sname
    (i_student_id IN NUMBER,
    o_first_name OUT VARCHAR2,
         o_last_name OUT VARCHAR2)
    AS
    BEGIN
    SELECT first_name,last_name
    INTO o_first_name,o_last_name
         FROM student
    WHERE student_id = i_student_id ;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.PUT_LINE('Error in finding student_id:'||i_student_id);
    END find_sname;
    and this is what i get when i execute it
    399 is th evalue of student_id
    DECLARE
    I_STUDENT_ID NUMBER;
    O_FIRST_NAME VARCHAR2(200);
    O_LAST_NAME VARCHAR2(200);
    BEGIN
    I_STUDENT_ID := 399;
    O_FIRST_NAME := NULL;
    O_LAST_NAME := NULL;
    STUDENT.FIND_SNAME ( I_STUDENT_ID, O_FIRST_NAME, O_LAST_NAME );
    COMMIT;
    END;
    please show me how i can just run that simple procedure

    As your other two parameters are out parameters, at SQL* Plus prompt, declare variables. Something like this.
    SQL>create or replace procedure sample_proc(v_in number,
      2  v_out1 out number,
      3  v_out2 out number)
      4  as
      5  begin
      6     v_out1 := v_in * 10;
      7     v_out2 := v_in + 10;
      8  end;
      9  /
    Procedure created.
    SQL>var a number
    SQL>var b number
    SQL>exec sample_proc(10, :a, :b)
    PL/SQL procedure successfully completed.
    SQL>print a
            A
          100
    SQL>print b
            B
           20
    SQL>Cheers
    Sarma.

  • 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;

  • Error when trying to run a procedure from the .xsql file

    Here is the error message pasted below.
    - <test>
    - <xsql-error action="xsql:include-owa">
    <statement>declare buf htp.htbuf_arr; param_names owa.vc_arr; param_values owa.vc_arr; rows integer := 32767; outclob CLOB;begin param_names(1) := 'HTTP_COOKIE'; param_values(1) := ''; param_names(2) := 'SERVER_NAME'; param_values(2) := 'shanthi.ijs.com'; param_names(3) := 'SERVER_PORT'; param_values(3) := '8080'; param_names(4) := 'SCRIPT_NAME'; param_values(4) := '/xsql/test/myex.xsql'; param_names(5) := 'PATH_INFO'; param_values(5) := ''; param_names(6) := 'HTTP_USER_AGENT'; param_values(6) := 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)'; owa.init_cgi_env(6,param_names,param_values); scott.get_date; owa.get_page(buf,rows); dbms_lob.createtemporary(outclob,true,dbms_lob.session); for i in 1..rows loop dbms_lob.writeappend(outclob,length(buf(i)),buf(i)); end loop; ? := outclob; ? := DBMS_LOB.INSTR(outclob,CHR(10)&#0124; &#0124;CHR(10));end;</statement>
    <message>ORA-06550: line 3, column 75: PLS-00302: component 'SESSION' must be declared ORA-06550: line 3, column 28: PL/SQL: Statement ignored ORA-06550: line 3, column 120: PLS-00302: component 'WRITEAPPEND' must be declared ORA-06550: line 3, column 111: PL/SQL: Statement ignored</message>
    </xsql-error>
    <xsql-error action="xsql:include-owa" />
    </test>
    My .xsql file is:
    <test connection="system" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa>
    scott.get_date;
    </xsql:include-owa>
    </test>
    Any help in this regard is greatly appreciated.
    Shanthi
    null

    I tried this way:
    <?xml version="1.0"?>
    <datapage connection="system" xmlns:xsql="urn:oracle-xsql">
    <xsql:dml>
    begin
    get_rec;
    end;
    </xsql:dml>
    </datapage>
    Here it doesn't give any error, Why is it that it works here but not with <xsql:include-owa>, ofcourse I need to get a proper output from the procedure yet. Looks like the procedure doesn't support "out" variable, should I specifically use a function ?
    Anyhelp will be appreciated.
    Shanthi

  • Error trying to run SSIS Package via SQL Server Agent: DTExec: Could not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object

    Situation:
    SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
    Windows 7 - 64 bit.
    The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
    It uses 3 package variables:
    *) SQLCommand (String) to specify the SQL Statement to be executed by the package
    Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
    Value: f:\Output Data.xls
    *) EXCELOutputFIle (String) to specify path and filename of the Excel output file
    Property path: \Package.Variables[User::SQLCommand].Properties[Value]
    Value: select * from CartOrder
    *) VarObjectDataSet (Object) to hold the data returned by SQL Server)
    Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
    Value: System.Object
    It consists out of 2 components:
    *) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
    *) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
    Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
    However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
    This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only.  This makes me wonder if it is uberhaupt possible to set the value of a package variable
    of type Object.
    Can anybody help me on this please ?
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  6:40:20 PM  DTExec: Could
    not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object.  Started:  6:40:20 PM  Finished: 6:40:21 PM  Elapsed:  0.281 seconds.  The package execution failed.  The step failed.
    Thank you very much in advance
    Jurgen

    Hi Visakh,
    thank you for your reply.
    So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
    I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
    first question about the object type package variable.
    Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
    Thx in advance
    Jurgen
    Yes exactly
    You need to set values only forthem which needs to be controlled from outside the package
    Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
    Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • HTTP 500 - Internal server error when trying to run simple HelloWorld.jsp

    Hello,
    I've searched the forum for a related issue and have not been able to resolve this error.
    I have created a simple HelloWorld.jsp and continue to receive the Internal server error. I have tried using the host as well as the ip address to access the jsp but neither of them solve the issue.
    JDev 10.1.3.2.0
    These are the settings that I have configured for the embedded oc4j server:
    HTTP: 8988
    RMI: 23891
    RMI-SSL: 24043
    IIOP: 5655
    IIOP-SSL: 5656
    JMS: 9227
    I also modified the proxy settings to use 8988 as well as the full host name.
    If I click on the IP home page it takes me to the OAS overview page but I get the same error if I try to launch the App server control or example jsp's.
    There are no messages in the log files.
    Any ideas?

    Hi,
    does the problem show when running thr JSP in the embedded OC4J in JDeveloper, or after deploying it to a stand alone OC4J or OracleAs?
    Frank

  • I keep getting graphics errors codes when trying to run simple things

    In a nutshell, I bought a laptop, installed the game "Spore", and played it FLAWLESSLY. A couple hours later the computer started acting up, and turns out the hard drive is bad (a scanned it through a usb device on another computer and it had many
    bad sectors) So I buy a new Hard drive, install Windows 7 Ultimate on it, and updated the graphics drivers and installed the latest version of DirectX on it, but now when I try to play Spore, I keep getting the error "could not create the graphics device.
    Direct X is not available. [1002]" and when I try to use windows movie maker I get the error message: "Windows movie maker cannot start. Make sure your computer meets the minimum system requirements before trying to start Movie Maker again, and then
    try to update the drivers for your video card if Movie Maker still doesn't start."
    I used the DxDiag tool and for some reason the apporox total memory (for my graphics card) read n/a. 
    my standard VGA Graphics Adapter (AMD ATOMBIOS) has up-to-date, Digitally signed drivers
    my hardware acceleration is turned all the way up
    I have the latest version of DirectX installed
    I have an I7, 4GB of RAM, this laptop has incredible modern features.... why can't I get simple things to work when I exceed the system requirements by so far, AND I'VE USED THEM IN THE PAST ON THIS MACHINE???... the
    only reason I bought this laptop was so I can use movie maker faster and play games.... Thank you for your tech knowledge....
    -Lucas

    Windows 7 includes DirectX 11 in its baseline and it is not necessary to install another version of it.  Your problems may be caused by the installation of the version of DirectX you installed.  Uninstall the one you installed and see if you
    still have the errors.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • How to run the procedure in SQL editor

    Schema Temp, Package Name = Pk_DRmanagement
    PROCEDURE LoadCardRefundRequests(v_streamer_batch_id IN NUMBER,
    vDebugLevel IN NUMBER DEFAULT 0, RowsProcessed OUT NUMBER )
    I use the following in SQL editor to compile and encounter problem. Can you help me with the correct implementation
    begin
    declare vCnt number;
    execute vCnt := Temp.Pk_DRmanagement.LoadCardRefundRequests(10407, 0);
    end;
    Thanks
    Just Do It

    declare
    vCnt number;
    begin
    Temp.Pk_DRmanagement.LoadCardRefundRequests(10407, vCnt );
    end;

  • Trying to run simple executable from Windows 2000

    I have tried the following code, but it does not work.
    try
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = "test.exe";
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(cmd);
    However if I replace 'cmd' with ' "notepad" ' the notepad lauches properly.
    No exceptions are thrown so appears to be functioning, but the command window never opens and prompts the user for input (function particular to test.exe)
    I also get the same response when I replace 'cmd' with ' "cmd" ')
    Any Help would be greatly appreciated
    Greg

    If you are trying to exec a process that does some amount of console intput/output then you need to drain the spawned process' output pipes: you need to create and start two threads that will do
    process.getInputStream ();
    and
    process.getErrorStream ();and read from those continuously. Without that, the spawned process may block.
    This is somewhat of a Java FAQ. Read
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    for more useful details.
    Note that notepad.exe does not do any console I/O and that's why it seems to work better.
    Vlad.

  • Stored Procedure vs SQL Injection

    Hello
    I am workin in a migration project. In this project we are remaking a web application based in ASP classic to ASP.NET but there is a serious problem: the principal query is suprisingly slow in the ASP.NET application and I don't know why.
    I'm using a stored procedure which contains the same query used in ASP classic, but it is slower than the query itself. I'd been doing some test and definitely the use of stored procedure with ASP.NET is slower than de sql injection in ASP classic and this seems very improbable theoretically.
    I really need to improve the speed of that stored proceudre but I don't know how, and it is driving me crazy because the query is a simple select.
    I'll thank every help/explanation about it.
    sorry for my english.

    I think you may have posted in the wrong section of the forum since this really doesn't sound like this is necessarily an issue with ODP.NET or even anything Windows / .NET-related.
    That said, have you tried running the procedure using SQL-Plus? You should also check the explain plan to make sure that you're taking advantage of indexes, etc. although if the query by itself is fast, then there may be a problem with the way the procedure is written. Also, as far as I know it's almost impossible to figure out why a query is slow based on the info you've given thus far. You may want to post some or all of the procedure if you're able to do so without causing problems with your employer. Without any way to recreate the issue, it's hard to say what the problem might be. Again, though....try running the procedure using SQL-Plus directly and see how that works out.

  • Can't Run Stored Procedure in Package

    Hi,
    I am trying to run a stored procedure that has multiple in and out paramaters. The procedure can only be viewed in my Connections panel by navigating Oher Users | <user> | Packages | <package> | <procedure>
    If I right click <procedure>, the menu items are "Order Members By..." and "Create Unit Test" (greyed out). The ability to "Run" the procedure does not seem possible when it's accessed by user.
    I have been trying to find an example of how to create an anonymous block so that I can run the procedure as a SQL file, but haven't found anything that works.
    Does anyone know how I can execute this procedure from SQL Developer? I am using Version 2.1.1.64.
    Thanks in advance!

    Thanks for replying. I did understand the basics of an anonymous block, but what I didn't understand was how to set the out parameters. I should have been more detailed in my question. However, I did get the answer here:
    http://stackoverflow.com/questions/3991721/run-stored-procedure-in-sql-developer
    Thanks again for replying. I appreciate you taking the time.

  • Running a anonymous PL/SQL block

    Hi,
    I have created an anonymous PL/SQL block and saved it in a file. And I am now trying to run it from the sql prompt using @.
    But this doesn't seem to be working. I get a wierd number as output and then it hangs.
    This is not the case if I copy paste the anonymous block. In this case I get the correct output.
    Please assist as to whether it is possible to run it using @ as it is important for me to do so..

    Hi,
    You forgot the slash after the anonymous block:
    USER is "YJAM"
    TEST>-- Create anonymous Block
    TEST>BEGIN
      2    NULL;
      3  END;
    4 /
    PL/SQL procedure successfully completed.
    TEST>-- save as script
    TEST>save ab.sql
    Created file ab.sql
    TEST>get ab
      1  BEGIN
      2    NULL;
      3* END;
    TEST>@ab
    PL/SQL procedure successfully completed.
    TEST>ed ab Here, I delete line 4. hence the Block won't run.
    TEST>@ab
      4
      5
      6
      7
      8  . a dot to exit input mode. a slash would run the block
    TEST>Regards,
    Yoann.

Maybe you are looking for

  • Digital Signatures in BIP

    The limitations mentioned below come from the BIP Administrator and Developers Guide 10.1.3.4, I thought these were removed in 11g but I see the same limitations in the 11g doc. Can anyone confirm if these limitations still apply for 11g and when wil

  • Order by Characters not Numbers

    Hello, I need help with an order by for data like below: select distinct First_Name from Name First_Name 12345 Test 25825 Apple 14782 Bob 1452 JamesI need to be able to sort ascending by just the characters not the numbers but the numbers are include

  • Error using WS-Addressing during asynchronous callback

    I am using the BPEL PM (10.1.2) to call an asynchronous service, but I am not receiving the callback. This is the SOAP request message: <?xml version="1.0"?> <soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/

  • Gui code design question ...

    Hi I need some designtip. Im doing a gui with tabs. Due to lots of lines of code when setting up each tab, the gui class rows is now heading towards infinity. Additionally the actionperformed method from all the buttons, jtexts and textareas on the t

  • Is XML adapter should be installed in BODS server in order to access XML files?

    Hi All, I have doubts while working withe XML/XSD files. 1.Is XML adapter should be installed in BODS server in order to access XML files? 2.What is startup_script.xml that we need to set up in Admin side. Thanks, Deepthi