Custom sequences or functions with default parameters

Hello!
Using the Stimulus Profile Editor, I am finding that using a sequence within a sequence to be cumbersome.  This is because it requires you to declare in the main sequence, every parameter that the sub-sequence will use.
I would like to have a 'configure' sequence whose parameters are all default and do not need to be declared or passed through by every sequence that calls it. Right now, if I change one argument of the 'configure' sequence I have to go to every sequence that references it, and update the parameters and the sequence call.
Essentially, I would just like an independent  subfuction that has no inputs and returns a few outputs. If the profile editor is not capable of this, what would be my next best option?
Thanks!

Hello,
You can take advantage of the new features in NIVS 2014 to help against re-defining default values for your RT Sequences. Take a look at the documentation in 2014 which explains in more detail how you can use channel references in your sequences:
What's New in NI VeriStand 2014
http://zone.ni.com/reference/en-XX/help/372846H-01/veristand/whats_new/
Variables for Reading and Writing Channels in a Real-Time Sequence
http://zone.ni.com/reference/en-XX/help/372846H-01/veristand/spe_vars_chref_parameters/
Example 1a: Reading and Writing Channels Directly from a Real-Time Sequence
http://zone.ni.com/reference/en-XX/help/372846H-01/veristand/spe_tutorial_example1a/
By using channel references, you won't have to re-set default parameters. Let me know if you have any questions. 
Sincerely,
Aldo A
Applications Engineer
National Instruments

Similar Messages

  • Function with incomplete parameters

    I create a function with many parameters
    and I call this function through my application
    but when I call function I must declare all parameter inside this function like
    ddd("a","b",0,0,0,0,0,0,0)
    is there a method let function set a default value for parameter if code didn't declare it

    You can send just few first parameters and the rest will be passed as false. If you need to pass, say, first and 7th parameter, then you put 6 commas between values, as there is no named parameters in VFP and all parameters are passed by position.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Auto run report with default parameters in Viewer

    Hi,
    Can any one tell me if it's possible to automatically run reports in Disco Viewer with default parameter values?
    For example, I have a worksheet with a parameter like 'Term like :Term Code' which has a default value of '%'.
    When I open the sheet in Viewer I'm presented with the Confirmation screen with default parameter values displayed and then click OK to run report. Is there a way to skip the confirmation screen and just run the sheet with default values as soon as it's opened?
    I tried using the 'Run Query Automatically' option in Query Governor preference but this results in Viewer opening the Edit Parameters screen instead of the confirmation screen.
    What I'd ideally like to do is bypass both the Confirmation and Edit Parameters screen to automatically run the worksheet with default parameters as soon as it's selected.
    Any thoughts appreciated,
    Ien Hien

    Hi,
    Option 1
    If the user is clicking on a URL for the report you could code the parameters directly into the URL thus, they are passed on startup. Section 13.5.2 Example 2 of the below URL provides an example:
    http://download.oracle.com/docs/html/B13918_03/urlstart.htm#i1014363
    Option 2 (Not Exactly what your looking for)
    This would still require a user to click something but, if your passing a wildcard it should probably be considered,
    If the parameter might be a wild card your better off making it an Optional Parameter which is now possible in Discoverer Plus 10.1.2. Thus, instead of passing an expensive % sign the condition will simply be ignored.
    Hopefully this helps....
    Jeff

  • Question about function with in parameters

    Hello,
    I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
    this is what I am thinking but I dont know if it's correct or not or what should I do next!
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    begin
    SELECT min_salary INTO min_sal
    FROM jobs
    where job_id = get_minimum_salary(xy);
    RETURN i_job_id;
    end get_minimum_salary;
    thanks in advance
    EDIT
    Thanks for your help all.
    Is it possible to add that if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
    create or replace procedure insert_error (i_error_code in number,
                                                      i_error_message in varchar2)
    as
    begin
    insert into error_table (error_user, error_date, error_code, error_message)
    values (user,sysdate,i_error_code,i_error_message);
    end insert_error;
    This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
    Any ideas of how to do that?
    Thanks again
    Edited by: Latvian83 on Jun 1, 2011 5:14 AM

    HI
    I have made little bit changes in ur code. try this
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    v_Min_sal jobs.salary%type=0;---- Variable declaration
    begin
    SELECT min_salary INTO v_ min_sal
    FROM jobs
    where job_id = i_job_id;
    RETURN v_Min_sal;
    end get_minimum_salary;
    Regards
    Srikkanth.M

  • Executing Procedure with default parameters !!

    hi want a small help ...
    I have a
    procedure p1(p1 in number default 2, p2 in number default 3)
    begin
    end;
    When the procedure will be called without passing parameters it will execute with default parameters.
    That time I want to dispay message saying
    " AS paramters are not passed, procedure is being executed with foll. default parameters:
    Param 1 = 2
    Param 2 = 3 "
    Now issue is how do I capture this condition that , the parameters are being passed and it is using default parameters ?
    Thanks

    The IF NOT NULL check for the parameters cannot be inside the same procedure becuase when you reach that statement, even though the parameter are not passed to this procedure, at that stage, the parameters will acquire the dfault values already assigned to them. So you never reach the else part of it.
    That;s why i said, use third parameter and assign the value to this third parameter from the calling environment.
    here is the short test case that might help you to understand better.
    SQL> create or replace procedure myproc
      2  (p1               number default 1
      3  ,p2               number default 2
      4  ,parameter_passed char default 'Y') is
      5  begin
      6    if parameter_passed = 'Y' then
      7      dbms_output.put_line('Input values are :'||p1||'='||p2);
      8    else
      9      dbms_output.put_line('Default values are :'||p1||'='||p2);
    10    end if;
    11  end;
    12  /
    Procedure created.
    SQL> PROMPT Test for Case one with input parameter values
    Test for Case one with input parameter values
    SQL>
    SQL> declare
      2   param1 number := 5;
      3   param2 number := 6;
      4  begin
      5   if param1 is not null and param2 is not null then
      6     myproc(param1,param2);
      7   else
      8     myproc(parameter_passed=>'N');
      9   end if;
    10  end;
    11  /
    Input values are :5=6                                                          
    PL/SQL procedure successfully completed.
    SQL>
    SQL> PROMPT Test for Case two with no parameter values
    Test for Case two with no parameter values
    SQL>
    SQL> declare
      2   param1 number := null;
      3   param2 number := null;
      4  begin
      5   if param1 is not null and param2 is not null then
      6     myproc(param1,param2);
      7   else
      8     myproc(parameter_passed=>'N');
      9   end if;
    10  end;
    11  /
    Default values are :1=2                                                        
    PL/SQL procedure successfully completed.
    SQL>

  • Calling a stored procedure with default parameters

    Dear all,
    I am trying to call a stored procedure that has not all the parameters compulsory, and indeed, there are some I am not interested in. Therefore, I would like to call the stored procedure initializing only some of the parameters but if I miss some of them, I have an SQLException thrown. Is there any way to do that?
    Thanks
    Marie

    Hi
    One way to do it is ---
    By using Default Parameters you can miss few parameters while calling a procedure.
    =================================================================
    As the example below shows, you can initialize IN parameters to default values. That way, you can pass different numbers of actual parameters to a subprogram, accepting or overriding the default values as you please.
    Moreover, you can add new formal parameters without having to change every call to the subprogram.
    PROCEDURE create_dept (
    new_dname VARCHAR2 DEFAULT 'TEMP',
    new_loc VARCHAR2 DEFAULT 'TEMP') IS
    BEGIN
    INSERT INTO dept
    VALUES (deptno_seq.NEXTVAL, new_dname, new_loc);
    END;
    If an actual parameter is not passed, the default value of its corresponding formal parameter is used.
    Consider the following calls to create_dept:
    create_dept;
    create_dept('MARKETING');
    create_dept('MARKETING', 'NEW YORK');
    The first call passes no actual parameters, so both default values are used.
    The second call passes one actual parameter, so the default value for new_loc is used.
    The third call passes two actual parameters, so neither default value is used.
    Usually, you can use positional notation to override the default values of formal parameters.
    However, you cannot skip a formal parameter by leaving out its actual parameter.
    For example, the following call incorrectly associates the actual parameter 'NEW YORK' with the formal parameter new_dname:
    create_dept('NEW YORK'); -- incorrect
    You cannot solve the problem by leaving a placeholder for the actual parameter.
    For example, the following call is illegal:
    create_dept(, 'NEW YORK'); -- illegal
    In such cases, you must use named notation, as follows:
    create_dept(new_loc => 'NEW YORK');
    ===============================================================
    For more details refer URL http://technet.oracle.com/doc/server.804/a58236/07_subs.htm#3651
    Hope this helps
    Regards
    Ashwini

  • Curve fitting problem: simultaneously fitting two datasets to two different model functions with shared parameters

    Hello! As stated above, I have the following problem: I have 2 sets (different systems) of measurement data (Voltages measured as functions of applied frequency). I would like to make curve fits with Levenber-Marquardt-method to both datasets (the datasets have the same x-values = frequencies), fitting the 2 datasets to their own separate model functions. However, the different model functions should have same values for the shared parameters (this prevents me from doing 2 totally separate curve fittings).
    I have LabVIEW version 7.1, if anybody could help me with the problem, I would appreciate it very much. Thank you!

    Would you like to try this:
    http://forums.ni.com/t5/LabVIEW/levenberg-Marquardt/td-p/668782
    http://zone.ni.com/reference/en-XX/help/371361G-01/gmath/nonlinear_curve_fit/
    http://digital.ni.com/public.nsf/allkb/BACF6FDF1B40993686256CC300657BA4
    With LV 7.1, I don't know if we have a such feature with that version. Please check out for the latest LV versions.
    BR,
    Make Nguyen
    NI Finland Technical Support

  • Oracle Function with out parameters

    Hi, I'm trying to access a stored function on an oracle server with 2 out parameters, 2 in parameters and an out ref cursor.
    PL/SQL looks like this
    nStatusCode OUT INTEGER,
    sStatusMsg OUT VARCHAR2,
    sUsrNr           IN VARCHAR2,
    sPassword           IN VARCHAR2,
    crsReturn OUT pck_cursor.retRecordSet
    I drag the function onto dataset designer and it successfully maps the results to the datatable, it maps datatypes for first out parameters to decimal and string.
    the method genearated for fill by looks like (out decimal?,out string,string, string, out object)
    problem is, everytime i try to call this function it gives me casting exceptions for the first 2 out parameters, for the decimal it's not specified in more detail. for the other one it says there was an exception casting from OracleString to string. If I change the PL/SQL function to leave the first 2 out parameters away it works fine. Do I manually need to change the TableAdapter definitions??

    Hi,
    I think I found the problem but not a good solution. It seems to be a problem with auto code generation for TableAdapters in the Dataset wizard. In the Parameter Definition for the Command I set DbType.Decimal and DbType.Sting for the SqlDbtype Property of the out params. The GetData and Fill Method is generated with Fill(out decimal? out1, out string out2). When I look in the generated code ith first sets the SqlDbtype as written but after this also the OracleDbtype to OracleDbType.Decimal and OracleDbType.Varchar2. The casting these types before returning the throws the exception. Any idea how to change this behavior?

  • Select from function with named parameters doesn't work

    Hello,
    I'm trying to execute the next sql statement:
    SELECT mypack.getvalue(user_id => 231, status => 'closed') AS someAlias FROM DUAL;
    I'm getting the next Error:
    Error: ORA-00907: missing right parenthesis
    But the next works fine:
    SELECT mypack.getvalue(231,'closed') AS someAlias FROM DUAL;
    What I'm doing wrong?
    Is there a way to call a Function and return it's result as a single-row query?
    Thanks for any suggestions.

    Thanks for your answers.
    Just want to explain what I want to accomplish:
    I want to create PL/SQL statement which:
    1) Calls Function in named notation way;
    2) Returns a query which contains a single row - a Function result.
    I know in Transact-SQL I can accomplish this the next way:
    DECLARE @return_value INT
    EXEC[myproc]
    @id=2,
    @status='ok',
    @ret_param=@return_value OUTPUT
    SELECT @return_value AS my_return_value
    The last SELECT call returns a query with one row in it.
    How can I do the same in Oracle?
    Thanks a lot!

  • Launch Concurrent through Personalization with default parameters

    Hi,
    I have one requirement as follows:
    Through personalization -> Buil-in -> Launch SRS from, I want to call one concurrent program with parameters. This concurrent should run as backround process. I like to use "Launch SRS form" or "execute a Procedure", but I dont have any examples or syntaxes to use that feature. If any one provide the guidelines it will be helpful.
    regards
    Ravi

    Ravi,
    We are still not clear of your exact requirement, r u trying to this on oa page or form. If on page, how are u calling the concurrent request api?Please reply, accordingly, then we can guide u correctlly!
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Java function with oracle parameters

    Hi all,
    Does someone knows why i have an error using the java function setDouble with the NLS_TERRITORY = FRANCE and not with NLS_TERRITORY = AMERICA ?
    what have i do to correct it ?
    Thanks in advance

    What is the output of the following, both when
    NLS_TERRITORY = FRANCE and with NLS_TERRITORY = AMERICA ?
    SQL> select to_number('123.45') from dual ;
    TO_NUMBER('123.45')
                 123.45
    1 row selected.
    SQL> select to_number('123,45') from dual ;
    select to_number('123,45') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    SQL>

  • PLS-00306 calling a procedure with default parameters

    Hi,
    I have the following procedure :
    PROCEDURE P_SUPPRESSION_ENRG (
    DIR in VARCHAR2,
    Tab_Diff_traitee in VARCHAR2,
    TabSup in VARCHAR2,
    ColCode in VARCHAR2,
    Code in VARCHAR2,
    Trig in VARCHAR2 default '',
    Etat in VARCHAR2 default '',
    TypMod in VARCHAR2 default '',
    IndRev in VARCHAR2 default '',
    Crd out NUMBER
    ) is
    END P_SUPPRESSION_ENRG;
    When I run this procedure without the parameters Trig,Etat,TypMod and IndRev, I receive the error PLS-00306 :
    INFOLIG.pck_diff.P_SUPPRESSION_ENRG(Directory,'DIFF_PYLONE_TYPE','DIFF_PYLONE_TYPE','DFP_PYL_CODE_PYLONE',rec.OIP_PYL_CODE_PYLONE,Icrd);
    PLS-00306
    wrong number or types of arguments in call to P_SUPPRESSION_ENRG.
    What have I to do to run this procedure without the parameters Trig,Etat,TypMod and IndRev ?
    Regards,
    Rachel

    hi, i think you are only passing 6 parameters when you called out the procedure p_supperion_enrg. your procedure requires a 10 parameters.
    if you do not want to include Trig,Etat,TypMod and IndRev you can simply put a null value.
      INFOLIG.pck_diff.P_SUPPRESSION_ENRG(Directory,
                                          'DIFF_PYLONE_TYPE',
                                          'DIFF_PYLONE_TYPE',
                                          'DFP_PYL_CODE_PYLONE',
                                          rec.OIP_PYL_CODE_PYLONE,
                                          Null,
                                          Null,
                                          Null,
                                          Null,
                                          Icrd); also you don't need to expplicitly defualt a parameter to null value. it is understood that parameters are initially default to null values.
      PROCEDURE P_SUPPRESSION_ENRG ( DIR              in VARCHAR2,
                                     Tab_Diff_traitee in VARCHAR2,
                                     TabSup           in VARCHAR2,
                                     ColCode          in VARCHAR2,
                                     Code             in VARCHAR2,
                                     Trig             in VARCHAR2,
                                     Etat             in VARCHAR2,
                                     TypMod           in VARCHAR2,
                                     IndRev           in VARCHAR2,
                                     Crd             out NUMBER ) IS
      END P_SUPPRESSION_ENRG;

  • Invoking of functions with number parameters

    Oracle 9i PL/SQL dictates that
    if the constraints of the formal parameter do not suffice actual parameter constraints,runtime error is raised.
    I tried the following code snippet to check this out.
    test_returntype7 returns a floationg point literal
    test_returntype8 returns a floationg point number
    SQL> create or replace function test_returntype7
    2 return number
    3 as
    4 begin
    5 null;
    6 return 21.345;
    7 end test_returntype7;
    8
    9 /
    Function created.
    SQL> declare
    2 v_output number(1);
    3 begin
    4 v_output := test_returntype7;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 4
    --This is fine
    SQL> declare
    2 v_output number(2);
    3 begin
    4 v_output := test_returntype7;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    --This is fine
    21
    PL/SQL procedure successfully completed.
    --This is fine
    SQL> declare
    2 v_output number(3);
    3 begin
    4 v_output := test_returntype7;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    21
    --This is fine
    PL/SQL procedure successfully completed.
    SQL> declare
    2 v_output number(2,3);
    3 begin
    4 v_output := test_returntype7;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 4
    --Why is this not working
    SQL> declare
    2 v_output number(2,10);
    3 begin
    4 v_output := test_returntype7;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 4
    --Why is this not working
    SQL> create or replace function test_returntype8
    2 return number
    3 as
    4 v_num number(2,3);
    5 begin
    6 v_num := 21.345;
    7 return v_num;
    8 end test_returntype8;
    9 /
    Function created.
    SQL> declare
    2 v_output number(2);
    3 begin
    4 v_output := test_returntype8;
    5 dbms_output.put_line(v_output);
    6 end;
    7
    8 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
    ORA-06512: at line 4
    --Why is this not working
    SQL>
    SQL> declare
    2 v_output number(2,3);
    3 begin
    4 v_output := test_returntype8;
    5 dbms_output.put_line(v_output);
    6 end;
    7
    8 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
    ORA-06512: at line 4
    --Why is this not working
    SQL> declare
    2 v_output number(3);
    3 begin
    4 v_output := test_returntype8;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
    ORA-06512: at line 4
    --Why is this not working
    Could any body clarify the behaviour of code snippets
    Thanks in advance
    Ann.

    KK,
    I tried the following
    SQL> declare
    2 v_output number(4,2);
    3 begin
    4 v_output := test_returntype7;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    PL/SQL procedure successfully completed.
    This is fine.
    SQL> declare
    2 v_output number(4,2);
    3 begin
    4 v_output := test_returntype8;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
    ORA-06512: at line 4
    Why is this not working
    What do you mean by precision should be a part of scale?
    I tried this also
    SQL> declare
    2 v_output number(5,3);
    3 begin
    4 v_output := test_returntype8;
    5 dbms_output.put_line(v_output);
    6 end;
    7 /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at "CERT.TEST_RETURNTYPE8", line 6
    Thanks,
    Ann.

  • Problems with procedures with DEFAULT parameters on 9i

    The Forms builder shuts down when compiling a block that contains the reference to a stored procedure (packaged or not) that contains a defaulted parameter.
    Sometimes it just terminates the connection (ORA-3113)
    Is there a patch or a parameter setting that circumvents this failure?

    Hi Hema,
    There could be various things that explain this, but from your symptoms it looks like the engine is hung processing this report. This could be as simple as a PL/SQL trigger that is in an infinite loop. Anyway, a simple thing to do is to add TRACEFILE=filename&TRACEMODE=append&TRACEOPTS=TRACE_ALL onto your URL. This will create the specified file and dump information into it about what Reports is doing as it is processing your report. If it is hung in an infinite loop, you should be able to see how far it got when you kill it.
    Also, you can see the status of the reports job queue by using the http://.../rwcgi60?showjobs command. If the report is executing forever, you'll see it sitting there in the job queue.
    regards,
    Stewart

  • Complicated PL/SQL questions that involves function with in type parameter

    Hello,
    I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
    this is what I am thinking but I dont know if it's correct or not or what should I do next!
    create or replace function get_min_salary (i_job_id in varchar2)
    return number
    as
    min_sal jobs.min_salary%type;
    begin
    SELECT min_salary INTO min_sal
    FROM jobs
    where job_id = i_job_id;
    RETURN min_sal;
    end get_min_salary;if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
    create or replace procedure insert_error (i_error_code in number,
    i_error_message in varchar2)
    as
    begin
    insert into error_table (error_user, error_date, error_code, error_message)
    values (user,sysdate,i_error_code,i_error_message);
    end insert_error;This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
    Any ideas of how to do that?
    Thanks in advance

    >
    minimum salary of the job_id
    >
    may be
    SELECT min(min_salary) INTO min_sal
    FROM jobs
    where job_id = i_job_id;
    if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:why error?
    This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
    create or replace procedure insert_error (i_error_code in number,
    i_error_message in varchar2)
    as
    begin
    insert into error_table (error_user, error_date, error_code, error_message)
    values (user,sysdate,i_error_code,i_error_message);
    -- this
    dbms_out.put_line('this');
    end insert_error;

Maybe you are looking for

  • Error "Encountered an error while exporting the data. View the lof file (DPR-10126)

    Hello, I would like to have sugestions and help to solve a problem in IS 4.2. I've created a view from two tables, joined together with the key from each one. Then i've binded the rule with the view (mentioned above) created and calculated score for

  • Data retrieval question

    I have a servlet called ListMyReservations. It is supposed to put information into a database called travel. This information came from 3 different threads in another servlet called reserveServlet except for the customerID which came from the login.

  • Converting STO s to deliveries  by date wise not location wise

    At the time of converting STOs to deliveries, and especially so for CWH, the system logic takes it location wise and not date wise. We need to have prioritisation when doing en mass conversion the STOs should be picked up on FIFO basis. This is hurti

  • Location of the 'save file' for games on memory ca...

    Hey, im playing the game 'air hockey' on my nokia 5800, but its stuffing up a bit so i want to re-install it just in case it got damaged a bit from a previous update... But iv got so far into the game that i dont want to lose my progress, so does any

  • Conditional Formating - Place Image above or below text

    Hi In OBIEE 10G I can display any images in conditional formating. But the image placement is reduced to "left", "right", "image only". Does's anybody has any idea how to place the images below or above the text? Any help is appreciated. Thank you