Dynamic execution of sequenc

Hi,
I have the below function which takes the sequence name as variable and
returns me the next val.
Function fngetnextseq(object_id varchar2) return number IS
l_next_no number(38);
l_sql varchar2(100);
BEGIN
     l_sql := 'select '||object_id ||'.nextval into l_next_no from dual';
      execute immediate l_sql;
      return l_next_no;  
END;END TEST;
But while executing its throws an error.
Any idea how this can be solved so that i can take sequence name dynamically at runtime and then execute it.
Thanks

execute_immediate_statement ::=
EXECUTE_IMMEDIATE dynamic_string
    INTO { define_variable [, define_variable ...] | record_name }
  | BULK COLLECT INTO { collection_name [, collection_name ...] | :host_array_name }
   [ USING [ IN | OUT | IN OUT ] bind_argument
   [, [ IN | OUT | IN OUT ] bind_argument] ... ] [ returning_clause ] ;Try like this:
Function fngetnextseq(object_id varchar2) return number IS
l_next_no number(38);
l_sql varchar2(100);
BEGIN
     l_sql := 'select '||object_id ||'.nextval from dual';
      execute immediate l_sql into l_next_no;
      return l_next_no;  
END;

Similar Messages

  • Add or edit step(s) dynamically in a sequence

    I am trying to add or edit step(s) dynamically in a sequence, based on the response from the user to a ui.  If I can not do this in the Test Stand language, how would I do it using a LabVIEW vi and  programmatically put that into a Test Stand sequence and run that sequence?
    cinsight

    The easiest way to edit the currently loaded SequenceFile is to use the existing Operator Interfaces that are shipped with TestStand.  The OI performs operations using Command objects.  It is also possible to implement your own Custom Commands.  Custom Commands make it possible to perform operations such as dynamic sequence editing.  The tutorial Adding Custom Commands to the LabVIEW Operator Interface covers Custom Commands in detail.  Note:  This requires that you have a TestStand development license in order to modify or save Sequence Files.
    Let me know if you have any specific questions.
    Regards,
    Tyler Tigue
    Applications Engineer
    National Instruments

  • What is order of execution in Sequence container

    hi all,
     I want to know the order of execution in sequence container. we have sequence container and loading 20 dimension table but no precedence constraints between the task, each tasks are separate.
     What is the flow of execution, is sequence container allow parallel execution of task ?
    Please guide me.
    Thanks in advance.

    Hello,
    All tasks which exist inside your Sequence container will execute in parallel. 
    If you want to control the order in which they execute then you need to use precedence constraints.
    -Vaibhav Chaudhari

  • Why it is creating the null sequence in sequence file while dynamically creating a sequence file using c#

    I am creating sequences in sequence file dynamically using c#.it is creating a null sequence in the sequence file everytime of execution.I have red marked in the attachments showing the difference between the original sequence and the null sequence.How can I prevent thos.Can you please help me solve this? 

    duplicate
    Regards
    Ray Farmer

  • Dynamically set the sequence of an Item

    Hi,
    I have three record types and am trying to dynamically set where it appears on the form.
    The 3 record types are MEETING REGISTER, MARKET PROBLEM AND BROADCAST CHANGE.
    If the user creates a record with a type of MEETING REGISTER then I want a field called 'duration' to have a sequence of 57, if it is either of the other 2 types then I want it to appear further down the form with a sequence of 241.
    I have tried creating a dummy text item called 'P2_DURATION_SEQ' at the top of the form with a default function of:
    declare
    v_dur_seq NUMBER;
    BEGIN
    IF :P2_RECORD_TYPE IN ('MEETING REGISTER')
    THEN v_dur_seq := 57;
    ELSE v_dur_seq := 241;
    END IF;
    RETURN v_dur_seq;
    END;
    and tried putting &P2_DURATION_SEQ. in the sequence field of the duration field properties with no success.
    Any advice would be great.
    Thanks
    Chris

    Hello Chris,
    If you have just the one field, or just a couple, that needs to dynamically change sequence (I wouldn't suggest the following if you have many because it could become quite a maintenance headache), you can try this:
    1) Define three "duration" fields, say P1_DURATION_MR, P1_DURATION_MP and P1_DURATION_BC. Define their sequence to display wherever each needs to be, respectively.
    2) Map all three to the same database column.
    3) Make each conditional on the record type being "MEETING REGISTER", "MARKET PROBLEM" or "BROADCAST CHANGE" respectively.
    Then, if the record type is "MEETING REGISTER", P1_DURATION will render where it needs to and the other two will not render, etc.
    Hope this helps,
    John

  • Dynamic actions in sequence

    Hi all,
            I have 5 dynamic actions in a page.
                I want to know whether there is any way to execute these dynamic actions in order ( i.e when the 1'st action is completed then only the 2'nd and 3'rd should be processed)..
    waiting for ur replies
    with regards
    BalaG

    If the dynamic actions need to work in sequence, then you can put them as "TRUE" actions in one and the same dynamic action.
    Regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • Error in execution of sequence

    hi there ,
    a sequence was launched yestreday (from the planning front end) but after the start entry of that sequnce no other entry of that sequnce has been encountered in the log file , later on another user started another sequnce today(from the planning front end) , all the rules were executed fine but the start entry of the last rule was there in the log file but the end entry isnt here , its been 3 and half hours since that last rule has been started. i have checked the essbase sessions and no calculation session is in progress. also i want to ask that if we start a sequence from the planning front end does it appears in the essbase sessions that we view in the essbase console.

    There was this one rule that was not running and also it takes a while to run , so what i did was that i executed that one rule in particular , and it got executed , but the fact there is no entry of the that same rule being ended when the other user executed it is making it diffcult to understand that what could have been the problem.
    you said something about timing out from the planning application . but if a sequnce is getting executed it will show the progress bar in the planning window and it will never time out the user , dont you think , but even if the user was timed out is there a possible way to find out for sure that the user was timed out(some kind of log or something) and how can we change the default idle time for a particular user or maybe all users to avoid such problem.
    thanks

  • Dynamic execution of boolean expression

    Hi folks,
    I want to execute a boolean expression dynamically, can you pls help me how to do it.
    For example,
    String str = " ( X & ( Y | Z ) ) " ;
    They value of X , Y or Z will be either true or false.
    After replacing their value, I will get string as follow
    String result = "( true & (false | true ) ".
    Now I want to execute the String as boolean expression in order to get
    a result as a true or false.
    So, i need a solution to implement this. The expression may be simple or compound . It is so urgent waiting for your reply.
    Appreciated if you provide sample code.
    Thx !
    With regards,
    Rahul

    Java is a compiled language (well, strictly, a semi-compiled language.) This means that stuff like parsing expressions only happens at compile time. Variable names don't exist at run time, neither does the code which analyses expressions.
    If you really need to do this kind of thing, therefore, all the code for parsing these expressions has to be a part of your program, and stuff like values for variable names will have to be set explicitly by your program, not in regular variables but in variable list for the "scripting engine" you invoke.
    You can either write your own expression analyser (not a trivial task if you haven't done it before) or you can search arround the web for one someone else has written and find out if it covers your requirements. BeenShell has been suggested. Find it on the web and study it's documentation.
    Incidentally when the new release of Java comes out it will include serveral such "Scripting engines" for languages like JavaScript or Jython, and such things will be less hastle.

  • Execution by sequence

    Hi all,
    The example Simple on TestStand GUI examples shows me that user can choose from combobox the desired sequence and executed it(one file sequence contains two sequences).
    How can I execute the desired sequence without using the combobox ????
    Can someone show me on the NI GUI simple example
    Tnx

    See my most recent post here:
    http://forums.ni.com/t5/NI-TestStand/Execute-desired-sequence/m-p/2770626#M44790

  • Add or edit Sequence Call step(s) dynamically in a sequence

    Hello I have looked at the TestStand Example: SequenceBuilderTool
    In the <TestStand>\Examples\SequenceBuilderTool Folder
    It works great, but I cannot seem to be able to use this for a Sequence Call Step.
    Any Solutions?
    Thanks
    BRI NI

    Hi Brian,
    I found some of my old code for my example, but unfortunately I haven't found the custom step types.
    Anyway, had a look at your example posted.
    I am I right in thinking you want the built sequence file to contain SequenceCall step which is linked to an internal sequence?
    Assuming this is your requirement. I took the supplied SequenceBuilderTool example and modified it as such:
    1. Added a SequenceCall step in MainSequence of the Template sequence file with its sub-sequence.
    2. Added the sequence call step in the ini file.
    3. Modified the "Build New Sequence" to insert the sub-sequence into the New Sequence File before inserting the steps into MainSequence.
    Because I was only inserting one sequence, I kept it very simple.
    First thing to do is get a reference to the Sequence from the Template Sequence File. Because I only had one sequence I used SequenceFile.GetSequenceByName. but if you have more than one you can get the number of sequences and use this as the max count and then use the GetSequenceByIndex, not using 0 as this will be MainSequence which will already be in your New Sequence File.
    Next get a Clone of that Sequence using your new reference using PropertyObject.Clone.
    Then finally, Insert the sequence into the new sequence file using Parameters.NewSequenceFileRef as the ActiveX Reference and call SequenceFile.InsertSequence (or SequenceFile.InsertSequenceByIndex).
    Then I released the reference to the sub-sequence by setting the local variable used to Nothing.
    The actual inserting of the SequenceCall step into MainSequence is handle by the existing code.
    This produced a sequence file which contained the sub-sequence and the Step in MainSequence which called the sub-sequence.
    I hope this helps.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Dynamically change region sequence/column

    I have a page that has many regions on it (ie. dashboard). The regions are all set to customize so the user can hide/show any of them. I have them all set with Display Point Page Template Body (3) and in columns 1-3 (see below):
    Region 1 Region 2 Region 3
    Region 4 Region 5 Region 6
    My problem is that the users want to be able to decide what sequence/column to display each region. .ie move Region5 under the 1st column or move it above Region 2. Is there any way to do that? Should I be using a different approach for dashboarding?
    Thanks

    Hi Bob,
    it should be possible with Javascript. Each region is contained in a HTML-table cell. With the region static-id you can identify each region with something like :
    theRegion = document.getElementById('region static-id')
    the HTML-content of the region would be.
    theRegion.innerHTML
    You should be able to exchange the content of the regions like this.
    DickDral

  • Streaming a dynamic image/image sequence

    Anyone have any advice on using quicktime or streaming server to stream an image that is regularly updated (i.e. image.jpg that is re-written by a camera every second) or even an image sequence that is appended regularly? Ideally I would be able to stream it as well as save a backup copy in mp4 format.

    Streaming static images through QTSS is a little overkill. For one, you will be using much more bandwidth then is needed, and two, it is bad practice to require a video plug-in (that a end-user may or may not have installed) for something as simple as an image.
    I recommend using a simple Javascript to update the image:
    <html>
    <head>
    <script language="JavaScript"><!--
    function refreshIt() {
    if (!document.images) return;
    document.images['myCam'].src = 'myCam.gif?' + Math.random();
    setTimeout('refreshIt()',5000); // refresh every 5 secs
    //--></script>
    </head>
    <body onLoad=" setTimeout('refreshIt()',5000)">
    </body>
    </html>

  • Dynamically retrieving a sequence value for your stylesheet.

    Is it possible to do the following withing a stylesheet: dynamiccally retrieve the next value of a sequence and use it within a style sheet as it is processing a XML document?
    Thanks for the help.

    I do not have an XSQL page.
    I am using the XMLLoader utility from Steve Muench's book. All I have is my XML input document, and my XSL stylesheet document.
    If you are familiar with the XMLLoader utility, where would the XSQL page you referred to fit in?
    <xsql:set-stylesheet-param name="parametername">
    SELECT sequence_name.NEXTVAL
    FROM YOURTABLE
    </xsql:set-stylesheet-param>That will be set in your XSQL page. Then you'll read that in on your XSL page with the following:
    <xsl:param name="parametername"/>You'll reference that variable in your XSL and increment accordingly adding whatever value to $parametername in the <xsl:value-of select="$parametername + 1"> or whatever you want your increment value to be. Hell, it could be <xsl:value-of select="$parametername + position()"> if you're looping through repeated XML elements.
    Hope that helps.
    Malik Graves-Pryor<HR></BLOCKQUOTE>
    null

  • TestStand - dynamic execution flow with symbolic stepnames?

    I want to jump to different parts of a sequence, depending on the user privileges as have been read out of a mySQL database. What I would like to do is to use a post-expression statement to set Runstate.NextStepIndex (as described when searching for "Next STep to Execute").
    This is quite easy when using direct numbers, but what if I have to add other steps inbetween, so changing these numbers? So I'd prefer to use the step's names instead. How can this be done?
    I have found out by myself that conditionals can be nested so that I can adress more than two target steps.
    Any hint is apreciated!

    Carlos Leon answered this Q on Info-TestStand as follows:
    > These are 2 approaches you can take:
    > 1) Using a single Goto step configured to go to multiple locations depending on a condition. When you edit the destination of the "Goto" step, instead of selecting a particular step name, you can type in an
    expression looks like the following:
    > Locals.MyValue == 1?"Action"Locals.MyValue == 2?"Pass/Fail Test":"Numeric Limit Test")
    > Meaning: If Locals.MyValue == 1, it will jump to the step named "Action". Otherwise, if Locals.MyValue == 2, it jumps to the step named "Pass/Fail Test", and so on.
    > 2) Using the PostActions of a step (instead of the PostExpressions). To accomplish the same thing as before, you can set the following "Custom Condition" i
    n a step's post actions: Locals.MyValue == 1 Then, "On condition True", select the name of the step to jump. E.g. "Action. "On condition False", type in an expression like the following:
    > Locals.MyValue == 1?"Pass/Fail Test":"Numeric Limit Test"
    > The second approach would be easier to implement than using "Post Expressions" if you want to specify a destination by step name rather than by step index. If you still want to use a Post Expression to specify a
    step name, it is still possible but the expression would be rather difficult to read.
    Unfortunately the PostAction Aproach did not work. A simple Target like OnFail goto might work, but a conditional like above was ignored. I could, however,
    achieve my aproach be inserting a "Goto" step with that kind of conditional target. Even the very same expression operates in the "Goto" and is ignored as a PostAction in a message popup step.
    Anyway, Problem solved! Thanx to all who helped!
    Greetings from Germany!
    Uwe F
    renz

  • Dynamic Execution of Stored Procedure

    Hi Everybody!
    I have two questions for you. All my questions are pertaining PL/SQL programming with Oracle 8i. But before that, I would like to introduce a bit about the background.
    We have .NET based application, which calls some 80 odd Oracle stored procedures one after one. The input parameters for all these stored procedure are same i.e. two IN parameters of Integer type and a OUT parameter of cursor type. The name of these stored procedures are listed in table (let say tblSPTable). We use to get the list of stored procedures from this table and execute them one after one.
    Sooner or later we realized that, this way of calling the stored procedures is causing a performance issue. So, we thought of moving the call to all these stored procedures to a new stored procedure. We thought of giving a call to this new stored procedure, which will in turn execute all these stored procedures one after one (by using the tblSPTable), and return us the all the cursors at one shot. But here is where we got stuck:
    How can I declare a OUT parameter for a list of cursors? Because I need to store the output of all the 80 odd calls in different cursors and have to get it back. I have tried to declare VARRAY of cursors or TABLE of cursors but it is not supported. One way of doing this is to declare all the 80 cursors as OUT parameters in the new stored procedure, but that is absolutely a bad programming practice. Apart from that, in future if we want to modify the order of the stored procedure, OR if we want to add or remove few stored procedures listed in tblSPTable, we have to modify this new procedure every time. My question is how can I declare or use a variable which can hold the list of cursors, which I can use from a .NET base application.
    Secondly, I will get the name of all the stored procedure by querying the tblSPTable, and will execute them dynamically. I have tried out something like this but not succeeded
    declare
    cur_result some_package.some_cursor;
    var_spname varchar;
    begin
    var_spname:=’pr_some_procedure’;
    execute immediate 'begin ‘ || var_spname || ‘(:2); end;' using out cur_result;
    end;
    Bur, I am getting an error saying “Error while trying to retrieve text for error ORA-03113”. I have scanned through few docs available over net, but none of them are really helpful. My question is how can I dynamically execute a stored procedure which has a cursor as a OUT parameter.
    Please help me out if you people have any idea regarding this. Please let me know whether my approach is correct or not. I am waiting for your valuable suggestions.
    Thanking you
    Ayan Mitra
    Message was edited by:
    user588628

    your solution will work out only in case all the functions returning you a cursor which holds same number of columnNot so. It is unfortunate that my example does not make that clear.
    The UNION ALL is of a single column which is of type weak refcursor.
    By way of example the below changes the p_dept procedure so it returns two columns rather than three.
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> CRE ATE OR REPLACE PROCEDURE p_dept (
      2     p_deptno IN dept.deptno%type,
      3     p_resultset OUT SYS_REFCURSOR)
      4  IS
      5  BEGIN
      6     OPEN p_resultset FOR
      7        SELECT d.deptno, d.dname
      8        FROM   dept d
      9        WHERE  d.deptno = p_deptno;
    10  END p_dept;
    11  /
    Procedure created.
    SQL> VARIABLE p_resultset REFCURSOR;
    SQL> BEGIN
      2     :p_resultset := f_all (
      3        p_deptno => 30,
      4        p_functions => varchar2_table ('F_DEPT', 'F_EMP'));
      5  END;
      6  /
    PL/SQL procedure successfully completed.
    SQL> PRINT p_resultset;
            RN FN     RS
             1 F_DEPT CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
        DEPTNO DNAME
            30 SALES
             2 F_EMP  CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
         EMPNO ENAME      JOB
          7499 ALLEN      SALESMAN
          7521 WARD       SALESMAN
          7654 MARTIN     SALESMAN
          7698 BLAKE      MANAGER
          7844 TURNER     SALESMAN
          7900 JAMES      CLERK
    6 rows selected.
    SQL>[pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • New Value Field in COPA

    Hi I have created new conditions in SD. These have been assigned to a value field which was never assigned to any conditions. Now this KE4I config is moved to test system and I found that values of these conditions are not appearing under new value f

  • How to I get a mirror image of a 3D extrude and Bevel image?

    I created a ribbon using the extrude and bevel effect and then mapping it with a custom symbol. I copied the image and then tried to get a matching image on the flipside to mirror it but cannot seem to figure it out. Is there a way to somehow flip th

  • How do I update OfficeJet Pro 8500A eAiO

    How do I update OfficeJet Pro 8500A eAiO to AirPrint from the iPhone4S?

  • How to update small letters into a database table

    Hi Guys,                 Iam updating a database table. I want to update lower case letters into the table. But by default all the lower case gets converted to Uppercase. How to acheive this requriement.? Regards. Harish.

  • Command bar in CS4

    Hi all! In CS3 InDesign have command bar. But in Cs4 don't have. Why?