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

Similar Messages

  • What is the correct syntax for using a variable in an ad hoc query?

    Hi all
    I am an occasional DB user and at the moment need to update about 1000+ records so that a certain column gets a unique value.
    So I thought that I would use a variable for this.
    I then built this kind of SQL statement for just a small subset of the records:
    variable recNumber number;
    exec :recNumber := 1;
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD + recNumber
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');
    I get the invalid SQL statement error when attempting to execute above (besides the prompt that asks for a value which I would like to omit).
    Anyway I also tried this one:
    CREATE SEQUENCE seqCounter;
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD + seqCounter.NEXTVAL
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');
    From this one I got the error ORA-01722: invalid number...I am guessing this comes because seqCounter is of type number and the COL_TO_BE_UPD is of type character...(?)
    So what I would like to ask is what is the correct way to define and use a counter type of variable to append a number at the end of a character string?
    Also another question that I would like to ask is that are variables that are used in ad hoc queries also called 'bind variables'?
    Thanks muchly

    If you want to append a unique number to a column then this would do it:
    UPDATE TABLE_TO_BE_UPD
    SET COL_TO_BE_UPD = COL_TO_BE_UPD ||to_char(rownum)
    WHERE COL_TO_BE_UPD IN ('VAL_A','VAL_B');

  • What is the correct Syntax to export to SWF using VBScript

    I am trying to export to swf using Indesign Server but i'm struggling to find the correct syntax using VBScript
    can someone point me in the correct direction or maybe give me this info?
    Thanks in advance
    Tom

    Malcolm,
    Just string the keywords in a row, and let 'er rip.
    The Store used to have a more sophisticated search capability known as Power Search, which allowed fielded entry.  But it seems to have disappeared a few releases ago.

  • What's the correct syntax for this?

    Hey guys
    If...
    trace(rowsHolder.getChildByName("mc"+newStr).y);  
    ...correctly outputs the y coordinate of (in this case) mc001, how do I output the y coordinate of a movieClip called item_base_mc that's within the timeline of mc001?
    trace(rowsHolder.getChildByName("mc"+newStr).item_base_mc.y);
    ...gives me a display object error.
    I've tried permutations of the above with [] brackets in various places, but haven't cracked the code.
    What would be the correct way to write it?
    Thanks for taking a look.
    Shaun

    I don't know how to really explain this, but from documentation you will notice  -   getChildByName()  -  is actually a function from  -  DisplayObject  - not MovieClip.
    Link here provides a better explanation!
    http://curtismorley.com/2007/06/13/flash-cs3-flex-2-as3-error-1119
    GOOD LUCK

  • 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's the correct syntax for animate scale

    I have tried to animate the scale transformation of an object from code.
    I had a little success with the code from here:
    http://stackoverflow.com/questions/5029035/how-do-we-add-css-animation-in-jquery
    But animating the scale looks jerky on the iPad with this hack.
    There must be an option of doing it from within Edge since a timeline animation which does the same (just transform scale of an object over time) runs smooth.
    I know there are jQuery extensions for things like that but I don't want to interfere with anything Edge does itself.
    Can someone give me a hint what syntax I need for animating the scale of an object within Edge?

    Hi Bittamer,
    There is no built-in code to animate objects. If you don't want to use the CSS scale code, you can use jQuery animate to animate the width and height props of your object, like so:
    sym.yourHeight = 500;
    sym.yourWidth = 500;
    sym.$("your_symbol").animate({height:sym.yourHeight, width:sym.yourWidth}, 500, 'swing');

  • What is the correct syntax to have the report log into different databases?

    Hi,
    My current Oracle Reports are called against several databases, depending on region. I pass 'userid=reports/new1@tsoc' as one of teh parameters to access the 'tsoc' db. I just as well call 'userid=reports/new1@penang'.
    This syntax does not appear to work when placed in the BI Publisher URL as follows:
    http://seerus04.soco.agilent.com:9704/xmlpserver/emerald/tutorial/tutorial.xdo?_xpf=&_xpt=0&_xdo=%2Femerald%2Ftutorial%2Ftutorial.xdo&_xt=tutorial&_xf=html&_xmode=0&userid=reports/[email protected]
    Thn in advance,
    Gary

    Jorge,
    I have 11 databases in different regions. Oracle Reports allows me to pass in the database I wish to connect to.
    This is extremely pertinent to my evaluation as I cannot justify having 11 seperate instances for each of my reports.
    If what you say is true, I would consider BIP a poor subsitute for Oracle Reports.
    Thx,
    Gary

  • What is the correct syntax for Sumif when condition is for a text string?

    B2 and b3 both contain the text "Grc".
    C2 contains 1 and C3 contains 2.
    F2 contains a Sumif that reads as: =SUMIF(B2:B10, "=Grc", C2:C10)
    The result is "0" when it should yield 3
    I can't figure out what happened.

    Hi ishii,
    Your screen shots make no sense to me. I am using Numbers'09 on a MacBook Pro running OS X. Please tell us what device, operating system and app you are using. You still have not told us.
    This forum is for Numbers on a Mac running OS X. Is your screen shot from an iOS device?
    I don't know anything about Numbers for iOS.
    Or are you using Excel?
    I can not help you. If you are using an iPad, you will get a better answer in this forum:
    https://discussions.apple.com/community/app_store/iwork_for_ios?view=discussions
    Regards,
    Ian.

  • What Is the Correct Syntax?

    I am searching a database, order the search result by some criterion supplied by users and ASC/DESC is also supplied by user's selection. How do I write the query statement?
       public Collection getBeans( String memberName, String sortCriterion, String order )
                                                           throws IllegalArgumentException, DatabaseException, BadInputException
          String query = "SELECT thread_id, message_receiver, message_sender, article_title FROM message_thread WHERE message_receiver = '" + memberName + "' ORDER BY + '" sortCriterion + '" +  " " + '"order + "'";

    My question is about the syntax of building up the query string.
    Here is the entire code:
       public Collection getThreadBeans_forReceiver_withSortSupport_limit_mysql( String memberName, int offset, int rowsToReturn, String sort, String order )
                   throws IllegalArgumentException, DatabaseException, BadInputException
          if ( offset < 0 ) throw new IllegalArgumentException( "The offset < 0 is not allowed." );
          if ( rowsToReturn <= 0 ) throw new IllegalArgumentException( "The rowsToReturn <= 0 is not allowed." );
          if ( ( !sort.equals( "thread_last_post_date" ) ) &&
               ( !sort.equals( "thread_creation_date" ) ) &&
               ( !sort.equals( "message_sender" ) ) &&
               ( !sort.equals( "thread_reply_count" ) ) &&
               ( !sort.equals( "thread_view_count" ) ) )
             throw new BadInputException( "Cannot sort, reason: dont understand the criteria '" + sort + "'." );
          if ( ( !order.equals( "ASC" ) ) &&
               ( !order.equals( "DESC" ) ) )
             throw new BadInputException( "Cannot sort, reason: dont understand the order '" + order + "'." );
          Connection conn = null;
          PreparedStatement stmt = null;
          ResultSet rs = null;
          Collection retValue = new ArrayList();
          String query = "SELECT thread_id, message_receiver, message_sender, article_title, last_post_member_name, thread_topic, thread_body, thread_creation_date, thread_last_post_date, thread_type, thread_option, thread_status, thread_view_count, thread_reply_count, thread_duration FROM message_thread WHERE message_receiver = '" + memberName + "' ORDER BY " + sort + " " + order;
          try
             conn = DBConnection.getDBConnection();
             stmt = conn.prepareStatement( query );
             stmt.setString( 1, memberName );
             stmt.setInt( 2, offset );
             stmt.setInt( 3, rowsToReturn );
             rs = stmt.executeQuery();
             while ( rs.next() )
                ThreadBean bean = new ThreadBean();
                bean.setThreadID( rs.getInt( "thread_id" ) );
                bean.setReceiver( rs.getString( "message_receiver" ) );
                bean.setSender( rs.getString( "message_sender" );
                bean.setTitle( rs.getString( "article_title" );
                bean.setLastPostMemberName( rs.getString( "last_post_member_name" ) );
                bean.setPostTopic( rs.getString( "thread_topic" ) );
                bean.setPostBody( rs.getString( "thread_body" ) );
                bean.setThreadCreationDate( rs.getTimestamp( "thread_creation_date" ) );
                bean.setThreadLastPostDate( rs.getTimestamp( "thread_last_post_date" ) );
                bean.setThreadType( rs.getInt( "thread_type" ) );
                bean.setThreadOption( rs.getInt( "thread_option" ) );
                bean.setThreadStatus( rs.getInt( "thread_status" ) );
                bean.setThreadViewCount( rs.getInt( "thread_view_count" ) );
                bean.setThreadReplyCount( rs.getInt( "thread_reply_count" ) );
                bean.setThreadDuration( rs.getInt( "thread_duration" ) );
                retValue.add( bean );
             return retValue;
          catch( SQLException sqle )
             sqle.printStackTrace();
             throw new DatabaseException( "Error executing SQL in ListThreadHandler.getBeans_inForum_withSortSupport_limit_mysql." );
          finally
             if ( conn != null )
                try
                   stmt.close();
                   stmt = null;
                   conn.close();
                catch( SQLException sqlEx )
                   System.out.println( "Problem occurs while closing " + sqlEx );
                conn = null;
       }

  • What are the permissions needed to run explain plans via sql develeper?

    Are the permissions the same in Sql Developer to run explain plans like they are when you run them via sql*plus?

    Yes same permission because the explain plan does not tie to the tools.

  • Sapinst - what is the correct way to startup sapinst

    I am starting install of NW04 on unix. The install manual states that once env paramters are set then do the following:
    cd /SAP_MASTER_DVD/IM2/SAPINST/UNIX/SUN...
    then run ./sapinst
    however run I run it it just waits.....
    I then go back in another session and run startInstGui.sh
    and the sapinst install screen successfully appears?
    Is this the correct way to run the install?
    What is the correct way to run sapinst?
    Thank
    John Ryan

    Figured it out...
    sudo su root not - root
    and it works

  • Can't figure out the correct syntax for this select statement

    Hello,
    The following statement works great and gives the desired results:
    prompt
    prompt Using WITH t
    prompt
    with t as
       select a.proj_id,
              a.proj_start,
              a.proj_end,
              case when (
                         select min(a.proj_start)
                           from v b
                          where (a.proj_start  = b.proj_end)
                            and (a.proj_id    != b.proj_id)
                        is not null then 0 else 1
              end as flag
         from v a
        order by a.proj_start
    select proj_id,
           proj_start,
           proj_end,
           flag,
           -- the following select statement is what I am having a hard time
           -- "duplicating" without using the WITH clause
            select sum(t2.flag)
              from t t2
             where t2.proj_end <= t.proj_end
           ) s
      from t;As an academic exercise I wanted to rewrite the above statement without using the WITH clause, I tried this (among dozens of other tries - I've hit a mental block and can't figure it out):
    prompt
    prompt without with
    prompt
    select c.proj_id,
           c.proj_start,
           c.proj_end,
           c.flag,
           -- This is what I've tried as the equivalent statement but, it is
           -- syntactically incorrect.  What's the correct syntax for what this
           -- statement is intended ?
            select sum(t2.flag)
              from c t2
             where t2.proj_end <= c.proj_end
           ) as proj_grp
      from (
            select a.proj_id,
                   a.proj_start,
                   a.proj_end,
                   case when (
                              select min(a.proj_start)
                                from v b
                               where (a.proj_start  = b.proj_end)
                                 and (a.proj_id    != b.proj_id)
                             is not null then 0 else 1
                   end as flag
              from v a
             order by a.proj_start
           ) c;Thank you for helping, much appreciated.
    John.
    PS: The DDL for the table v used by the above statements is:
    drop table v;
    create table v (
    proj_id         number,
    proj_start      date,
    proj_end        date
    insert into v values
           ( 1, to_date('01-JAN-2005', 'dd-mon-yyyy'),
                to_date('02-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 2, to_date('02-JAN-2005', 'dd-mon-yyyy'),
                to_date('03-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 3, to_date('03-JAN-2005', 'dd-mon-yyyy'),
                to_date('04-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 4, to_date('04-JAN-2005', 'dd-mon-yyyy'),
                to_date('05-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 5, to_date('06-JAN-2005', 'dd-mon-yyyy'),
                to_date('07-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 6, to_date('16-JAN-2005', 'dd-mon-yyyy'),
                to_date('17-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 7, to_date('17-JAN-2005', 'dd-mon-yyyy'),
                to_date('18-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 8, to_date('18-JAN-2005', 'dd-mon-yyyy'),
                to_date('19-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 9, to_date('19-JAN-2005', 'dd-mon-yyyy'),
                to_date('20-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (10, to_date('21-JAN-2005', 'dd-mon-yyyy'),
                to_date('22-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (11, to_date('26-JAN-2005', 'dd-mon-yyyy'),
                to_date('27-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (12, to_date('27-JAN-2005', 'dd-mon-yyyy'),
                to_date('28-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (13, to_date('28-JAN-2005', 'dd-mon-yyyy'),
                to_date('29-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (14, to_date('29-JAN-2005', 'dd-mon-yyyy'),
                to_date('30-JAN-2005', 'dd-mon-yyyy'));

    Hi, John,
    Not that you asked, but as you proabably know, analytic functions are much better at doing this kind of thing.
    You may be amazed (as I continually am) by how simple and efficient these queries can be.
    For example:
    WITH     got_grp          AS
         SELECT     proj_id, proj_start, proj_end
         ,     proj_end - SUM (proj_end - proj_start) OVER (ORDER BY  proj_start)     AS grp
         FROM     v
    SELECT       ROW_NUMBER () OVER (ORDER BY grp)     AS proj_grp
    ,       MIN (proj_start)                         AS proj_start
    ,       MAX (proj_end)               AS proj_end
    FROM       got_grp
    GROUP BY  grp
    ORDER BY  proj_start
    ;Produces the results you want:
      PROJ_GRP PROJ_START  PROJ_END
             1 01-Jan-2005 05-Jan-2005
             2 06-Jan-2005 07-Jan-2005
             3 16-Jan-2005 20-Jan-2005
             4 21-Jan-2005 22-Jan-2005
             5 26-Jan-2005 30-Jan-2005This is problem is an example of Neighbor-Defined Groups . You want to GROUP BY something that has 5 distinct values, to get the 5 rows above, but there's nothing in the table itself that tells you to which group each row belongs. The groups are not defined by any column in hte table, but by relationships between rows. In this case, a row is in the same group as its neighbor (the row immediatly before or after it when sorted by proj_start or proj_end) if proj_end of the earlier row is the same as proj_start of the later row. That is, there is nothing about 03-Jan-2005 that says the row with proj_id=2 is in the first group, or even that it is in the same group with its neighbor, the row with proj_id=3. Only the relation between those rows, the fact that the earlier row has end_date=03-Jan-2005 and the later row has start_date=03-Jan-2003, that says these neighbors belong to the same group.
    You're figuring out when a new group starts, and then counting how many groups have already started to see to which group each row belongs. That's a prefectly natural procedural way of approaching the problem. But SQL is not a procedural language, and sometimes another approach is much more efficient. In this case, as in many others, a Constant Difference defines the groups. The difference between proj_end (or proj_start, it doesn't matter in this case) and the total duratiojn of the rows up to that date determines a group. The actual value of that difference means nothing to you or anybody else, so I used ROW_NUMBER in the query above to map those distinct values into consecutive integers 1, 2, 3, ... which are a much simpler way to identify the groups.
    Note that the query above only requires one pass through the table, and only requires one sub-query. It does not need a WITH clause; you could easily make got_grp an in-line view.
    If you used analytic functions (LEAD or LAG) to compute flag, and then to compute proj_grp (COUNT or SUM), you would need two sub-queries, one for each analytic function, but you would still only need one pass through the table. Also, those sub-queries could be in-line views; yiou would not need to use a WITH clause.

  • What's the recommended way to run a WebLogic Server in the background?

    I'm new to WebLogic Server and I've been looking at the documentation. There's instructions for starting and stopping servers on Linux but they all seem to rely on foreground processes. What's the correct way to run these processes in the background in a production environment? Is it just by using nohup somewhere in a script /etc/init.d/ or is there some other way I should be running it?

    Meatwad,
    Of course, running the WLS processes using nohup would place the process in the background. However, the recommended way to run the WLS servers on a production system would be to configure node manager and use this. This places the servers as a background process but also provides some additional functionality, that would be useful - for instance, allowing starting and stopping via the admin console and the ability to auto restart failed or stuck servers.
    For more information, please consult the documentation.
    http://docs.oracle.com/cd/E17904_01/web.1111/e13740/starting_nodemgr.htm

  • What is the correct dev environment?

    I'm using Sun Java 1.6 on an Ubuntu 8.04 platform using an eclipse 3.2 IDE. It's the pits! I tried to convince my boss in the beginning to use a Fedora OS with fedora Eclipse and Iced-tea java. I read somewhere that iced-tea is basically the same as Sun Java, except that the sound components aren't yet OSS (Sun is changing this). My question to you all is: Can I dev jee apps with fedora eclipse and iced-tea (latest) and have these apps be truly cross-platform? Will the java I write on the fedora platform be truly as cross-platform as Sun's Java, sound not withstanding?

    Jusclark-Oracle wrote:
    What is the correct syntax for referencing a page item (P23_ID, for example) in a PL/SQL page process, after submit?
    See "About Referencing Session State" in the documentation.
    Within an anonymous block in an APEX page process, use the standard bind variable syntax:
    :P23_ID
    In general, use bind variable syntax when referencing session state values in SQL or DML:
    select
        ename
    into
        :p23_name
    from
        emp
    where
        empno = to_number(:p23_id);
    and obviously when assigning values to the item:
    :P23_ID := foo.nextval;
    PL/SQL function references v('p23_id') and nv('p23_id') [for number values] must be used to access values in stored program units called from APEX, although it's usually better to pass the values as parameters: foo(:p23_id).

  • What is the setVariable syntax for AS3

    Hi,
    I am having issues with setting a variable in AS3 SWF playing inside a Dir12
    spriteObjRef.setVariable(variableName, newValue)
    In the context of ActionScript 3, this method is only supported on a Flash object, not on a
    spriteObjectRef.
    What would the Flash Object syntax be??
    Thanks,
    Jim

    Jusclark-Oracle wrote:
    What is the correct syntax for referencing a page item (P23_ID, for example) in a PL/SQL page process, after submit?
    See "About Referencing Session State" in the documentation.
    Within an anonymous block in an APEX page process, use the standard bind variable syntax:
    :P23_ID
    In general, use bind variable syntax when referencing session state values in SQL or DML:
    select
        ename
    into
        :p23_name
    from
        emp
    where
        empno = to_number(:p23_id);
    and obviously when assigning values to the item:
    :P23_ID := foo.nextval;
    PL/SQL function references v('p23_id') and nv('p23_id') [for number values] must be used to access values in stored program units called from APEX, although it's usually better to pass the values as parameters: foo(:p23_id).

Maybe you are looking for

  • Export Import Issue

    Hi, I'm getting the following error while exporting a table EXP-00015: error on row 24127131 of table SEQUENCING_TRACE, column READ_NAME, datatype 1......... The log file message is shown below. Could u please let me know how to proceed. bash:~/Bluef

  • Deployment Error: Deployment Timed Out after 60 seconds

    I am having problems simply deploying my webapp through creator. The application that I am working on was completely developed in the creator IDE and at some point took a really log time to deploy. Now it actually times out. This is my ide.log file.

  • How to remove "Get started with your site"

    Hello, I am in the process of automating the creation of a site collection using PowerShell. Everything works fine but I would like to remove or hide the "Get started with your site" that we see the first time we open a site. Deactivating the Getting

  • Highest values

    Can any one help me in coding ,to find the 3 highest values from an array.

  • Inbound Delivery without order reference

    Hello, Does anyone know if there is a way for creating an inbound delivery without PO as a reference? I need to create an inbound delivery with no reference, and I know that for the outbound process it is possible. Thanks in advance, Dikla