How to declare a formal parameter of a record type and access function?

declare

CURSOR c_cur_minc IS SELECT FAMID, MEMBNO, AMTFED, GOVRETX, PRIVPENX, RRRDEDX, GROSPAYX, SLTAXX, SALARYX, SALARYBX OF MINC WHERE FAMID IN (SELECT FAMID FROM MEMBERS WHERE AGE > = 14 AND MINC.) FAMID = MEMBERS. FAMID AND MINC. MEMBNO = MEMBERS. MEMBNO);

number of v_limit: = 50;

TYPE minc_rec is RECORD (FAMID MINC. FAMID % TYPE,
MEMBNO MINC. MEMBNO % TYPE,
AMTFED MINC. AMTFED % TYPE,
GOVRETX MINC. GOVRETX % TYPE,
PRIVPENX MINC. PRIVPENX % TYPE,
RRRDEDX MINC. RRRDEDX % TYPE,
GROSPAYX MINC. GROSPAYX % TYPE,
SLTAXX MINC. SLTAXX % TYPE,
SALARYX MINC. SALARYX % TYPE,
SALARYBX MINC. SALARYBX % TYPE);

TYPE minc_rec_type is TABLE OF THE minc_rec;
minc_rec_type_tbl minc_rec_type;

Start

OPEN c_cur_minc.
LOOP
Get the c_cur_minc COLLECT LOOSE minc_rec_type_tbl LIMIT v_limit;
WHEN minc_rec_type_tbl EXIT. COUNT = 0;
BECAUSE me in minc_rec_type_tbl. FIRST... minc_rec_type_tbl. LAST
LOOP
IF (chk_notnull_blank (minc_rec_type_tbl (i). AMTFED)) THEN
Setting a DAY MINC SET ANFEDTX = - 2E14 WHERE FAMID = minc_rec_type_tbl (i) .famid AND MEMBNO = minc_rec_type_tbl (i) .membno;
end if;

IF (chk_notnull_blank (minc_rec_type_tbl (i). GOVRETX)) THEN
Setting a DAY MINC SET GOVRETX = - 2E14 WHERE FAMID = minc_rec_type_tbl (i) .famid AND MEMBNO = minc_rec_type_tbl (i) .membno;
end if;

END LOOP;
END LOOP;
CLOSE C_cur_minc;
END;


FUNCTION chk_notnull_blank (?) return a Boolean value is
Start
If (? is NOT NULL and? as (-8E14,-7E14,-6E14,-5E14,-4E14,-3E14,-2E14,-1E14,-1E9)) then
RETURN TRUE;
on the other
RETURN FALSE;
end if;
END chk_notnull_blank;


end;

My question is how to declare a formal FastInventory in a fuction where, in the past the current parameter is a variable of type record type number value?

Published by: kumar73 on September 21, 2010 11:22

Published by: kumar73 on September 21, 2010 11:23

This is a simple function

CREATE OR REPLACE FUNCTION chk_notnull_blank(inparm IN NUMBER) RETURN NUMBER IS
BEGIN
if ( inparm  is NOT NULL and inparm  in ( -8E14, -7E14, -6E14, -5E14, -4E14, -3E14, -2E14, -1E14, -1E9 )) then
RETURN TRUE ;
else
RETURN FALSE ;
end if;
END chk_notnull_blank;

Thank you
AJ

Tags: Database

Similar Questions

  • How set permissions to a user "limited" for reading hotmail and access to the printer?

    I created a user 'limited' for me. But now, I have two problems:

    1. in the limited user account, I can't open my hotmail email.

    2. in the limited user account, I don't have access to print on my printer.

    How to set permissions for various situations for my user account limit?

    See these

    http://www.ehow.com/how_6906849_block-account-only-Windows-XP.html

    http://www.ehow.com/how_7320098_change-setting-limited-XP-account.html

    useful?

  • How to pass the value of the variable record type in the procedure

    Hai All

    My Question is

    I have a table named Emp and the structure

    ID Varchar2 (25)

    Name varchar2 (25)

    Number of salary


    And now, I created a folder named Rec_Emp

    Like this

    Type Rec_emp is made
    (Rec_Id varchar2 (25),)
    rec_name varchar2 (25).
    Number of Rec_salary);
    rec_emp emp_record;


    I created a SQL type

    Now how to pass the value type in the procedure


    Thanks and greetings
    SrikkanthM

    You are looking for something like this

    create table my_emp (id integer, name varchar2(100), sal number)
    /
    create type my_emp_obj as object(id integer, name varchar2(100), sal number)
    /
    create or replace procedure insert_into_my_emp(pEmp_Obj in my_emp_obj)
    as
    begin
      insert into my_emp (id, name, sal) values(pEmp_obj.id, pEmp_Obj.name, pEmp_obj.sal);
    end;
    /
    begin
      insert_into_my_emp(my_emp_obj(1,'karthick',1000));
    end;
    /
    select * from my_emp
    /
    
  • How to move the Cursor parameter for loop with the type of table?

    Hi friends,
    I wonder how to pass a parameter into the second loop in the code example below. Please see the "BOLD" statements and to answer my questions.
    Thank you very much. Here's the code.

    declare
    l_bom_header_tbl BOM_BO_PUB. BOM_HEADER_TBL_TYPE; -TABLE TYPE
    V_bom_header_tbl Bom_Bo_Pub.Bom_Head_Rec_Type: = Bom_Bo_Pub.G_MISS_BOM_HEADER_REC; -Record type
    v_bom_components_tbl Bom_Bo_Pub.Bom_Comps_Tbl_Type: = Bom_Bo_Pub.G_MISS_BOM_COMPONENT_TBL; - nested table type
    c: number = 0;
    k: = 1 number;
    Start
    BOMPXINQ. () Export_BOM
    P_org_hierarchy_name = > l_org_hierarchy_name,
    P_assembly_item_name = > l_assembly_item_name,
    P_organization_code = > l_organization_code,
    P_alternate_bm_designator = > '1Test. "
    P_Costs = > l_costs,
    P_Cost_type_id = > l_cost_type_id,
    X_bom_header_tbl = > l_bom_header_tbl,
    X_bom_revisions_tbl = > l_bom_revisions_tbl,
    X_bom_components_tbl = > l_bom_components_tbl,
    X_bom_ref_designators_tbl = > l_bom_ref_designators_tbl,
    X_bom_sub_components_tbl = > l_bom_sub_components_tbl,
    X_bom_comp_ops_tbl = > l_bom_comp_ops_tbl,
    X_Err_Msg = > l_Err_Msg,
    X_Error_Code = > l_Error_Code);
    If l_Error_Code = 0 then


    because me in 1... l_bom_header_tbl. COUNTING LOOP
    V_bom_header_tbl.organization_code: = "DSC";

    Can assign us a table type of guy like below the registration statement?
    V_bom_header_tbl.assembly_item_name: is l_bom_header_tbl (i) .assembly_item_name;.

    k: = 1;

    I want to pass the l_bom_header_tbl (i) .assembly_item_name parameter in the declaration below: How do I do this?
    for j from 1... l_bom_components_tbl. COUNTING LOOP

    Can assign us a table type of type array as below the statement?
    v_bom_components_tbl (k). Assembly_Item_name: is l_bom_header_tbl (i) .assembly_item_name;.
    k: = k + 1;
    end LOOP;
    end loop;
    end;

    Published by: ILovePlSql on March 22, 2010 07:51

    Published by: ILovePlSql on March 22, 2010 08:16

    ILovePlSql wrote:
    V_bom_header_tbl emp % rowtype;

    If v_bom_header_tbl has just two fields as ename, sal then also the assignment of type table, record type work or if the record type and the array type have the same structure?

    Yes:

    SQL> declare
      2      type Bom_Head_Rec_Type is record(ename emp.ename%type,sal emp.sal%type);
      3      type BOM_HEADER_TBL_TYPE is table of Bom_Head_Rec_Type index by binary_integer;
      4      l_bom_header_tbl BOM_HEADER_TBL_TYPE;
      5      V_bom_header_tbl emp%rowtype;
      6  begin
      7      select ename,sal bulk collect into l_bom_header_tbl from emp;
      8      for i in 1 .. l_bom_header_tbl.count loop
      9        V_bom_header_tbl.ename := l_bom_header_tbl(i).ename;
     10        V_bom_header_tbl.sal := l_bom_header_tbl(i).sal;
     11      end loop;
     12  end;
     13  /
    
    PL/SQL procedure successfully completed.
    
    SQL>  
    

    SY.

  • How to create a type of record and a pl/sql table of this record type in the database

    Hello
    I want to create a record type, and then I want to create a PL/SQL table in the oracle 9i database.
    I did block PL/SQL.
    But when I'm doing it in the database it throws me a few errors.
    Could you please tell me how can I do?

    Concerning

    user576726 wrote:
    Hello
    I want to create a record type, and then I want to create a PL/SQL table in the oracle 9i database.
    I did block PL/SQL.
    But when I'm doing it in the database it throws me a few errors.
    Could you please tell me how can I do?

    Concerning

    RECORD type is only supported in PL/SQL for SQL, you must use the OBJECT type.

  • The formal parameter, quot;@CCNumber & quot; was not declared as OUTPUT parameter

    This stored procedure was working till last week and I do not remember change all the input variables / outputs, so I don't know why I get the error message I get. I counted and tells all the parameters in the CF to ensure that none are missing, but SQL still think I'm missing something. Can someone take a look at the code and see why SQL account 53 settings when there is really some 54?

    The beginning of MS:

    ALTER PROCEDURE [dbo]. [pr_EnterWebOrder]
    @User_Fk int,
    @Coupon_Fk int,
    @GiftCertificate varchar (200),
    Silver @GCAmount,
    @OrderNotes varchar (200),
    @PaymentMethod varchar (10),
    @CreditCard_Fk int,
    @BillTitle varchar (10),
    @BillFirstName varchar (50),
    @BillLastName varchar (50),
    @BillMiddleName varchar (50),
    @BillCompanyName varchar (50),
    @BillAddress varchar (2000).
    @BillCity varchar (50),
    @BillState_Fk int,
    @BillZip varchar (20),
    @BillProvince varchar (50),
    @BillCountry_Fk int,
    @BillPhone varchar (50),
    @BillExt varchar (8),
    @BillEmail varchar (100),
    @ShipTitle varchar (10),
    @ShipFirstName varchar (50),
    @ShipLastName varchar (50),
    @ShipMiddleName varchar (50),
    @ShipCompanyName varchar (50),
    @ShipAddress varchar (2000).
    @ShipCity varchar (50),
    @ShipState_Fk int,
    @ShipZip varchar (20),
    @ShipProvince varchar (50),
    @ShipCountry_Fk int,
    @ShipPhone varchar (50),
    @ShipExt varchar (8),
    @ShipEmail varchar (100),
    @OrderEditor_Fk int,
    @AdminUUID char (35),
    @CreditAccount int,
    @TransactionNumber varchar (20),
    @AffiliateCode varchar (50),
    @Register int,
    @OrderSource_Pk int,
    @CheckoutCharity int,
    @AuthCode varchar (6).
    @AffiliateLinkType int,
    Silver @CreditReceived,
    Silver @CashReceived,
    @PONumber varchar (20),
    @PromisedDate DateTime,
    @ShipDate DateTime,
    @CheckNumber varchar (20),
    @CCNumber varchar (200),
    @CCExpDate int,
    @Order_Pk int OUTPUT,.
    @OrderNumber varchar (20) OUTPUT

    The CF code calling:


    The error message in SQL. Notice that he just thinks there are 53 settings when there are 54:

    SQLSTATE HY000
    SQL {call pr_EnterWebOrder ((param 1), (param 2), (param 3), (param 4), (param 5), (param 6), (param 7), (param 8), (param 9), (param 10), (param 11), (param 12), (param 13), (param 14), (param 15), (param 16), (param 17), (param 18), (param 19), (param 20), (param 21), (parameter 22), (param 23), (24 param), (param 25), (param 26), (param 27), (param 28), (param 29) (param 30)} (, (param 31), (param 32), (param 33), (param 34), (35 param), (param 36), (param 37), (38 param), (param 39), (param 40), (param 41), (param 42), (param 43), (param 44), (param 45), (param 46), (param 47), (param 48), (param 49), (param 50), (param 51), (param 52), (param 53))}

    [Macromedia] [SQLServer JDBC Driver] [SQL Server] The formal parameter '@CCNumber' declared as OUTPUT, but the real parameter output parameter.

    Found the answer. CF error incorrect when you send an empty value for a cfsqltype DATE in a cfprocparam tag. Rather than tell you that data types do not match, it seems that it removes this procparam from the code.

  • How to use the record type as a parameter IN PL/SQL procedure or package

    Hi people,

    I need help on the record as the OUT parameter type. I am able to get out a single line as a parameter, but not getting do not idea how to get a multi ranks as output parameter.

    I have the code that works very well for a single line. Please see CODE1.

    But when I try to get several lines, I'm failing to do. Please see the CODE2. I get the error of compilation as


    Error report:

    ORA-06550: line 11, column 35:

    PLS-00487: Invalid reference to the variable "P_NAME.

    ORA-06550: line 11, column 1:

    PL/SQL: Statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    * Cause: Usually a PL/SQL compilation error.

    Any help or a sample execution of script would be really useful.

    Thanks in advance.

    YZ

    --------------------------CODE1------------------------------------------

    -------------------------Package Spec-------------------------------

    CREATE OR REPLACE

    PACKAGE xx_sample_pkg as

    --

    Xx_sample_table_rectype RECORD TYPE IS

    (p_name varchar2 (40))

    number of p_emp_id

    );

    PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);

    END xx_sample_pkg;

    ------------------------------Package Body------------------------

    create or replace

    PACKAGE xx_sample_pkg AS BODY

    --

    PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS

    BEGIN

    SELECT ename, empno

    IN xx_sample_rec1

    FROM scott.emp

    WHERE ename = 'SMITH ';.

    END xx_sample_prc;

    END xx_sample_pkg;

    -------------------------------------------Execute----------------------

    DECLARE

    l_rec_type xx_sample_pkg.xx_sample_table_rectype;

    BEGIN

    dbms_output.put_line ('xx_sample_prc appeal');

    xx_sample_pkg.xx_sample_prc (l_rec_type);

    dbms_output.put_line ('YZ' | l_rec_type.p_name |') '|| l_rec_type.p_emp_id);

    END;

    ---------------------------------------------------------------

    -------------------------CODE2-------------------------------------------

    -------------------------Package Spec-------------------------------

    CREATE OR REPLACE

    PACKAGE xx_sample_pkg as

    --

    Xx_sample_table_rectype RECORD TYPE IS

    (p_name varchar2 (40))

    number of p_emp_id

    );

    PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);

    END xx_sample_pkg;

    ------------------------------Package Body------------------------

    create or replace

    PACKAGE xx_sample_pkg AS BODY

    --

    PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS

    BEGIN

    SELECT ename, empno

    IN xx_sample_rec1

    FROM scott.emp;

    END xx_sample_prc;

    END xx_sample_pkg;

    -------------------------------------------Execute----------------------

    DECLARE

    l_rec_type xx_sample_pkg.xx_sample_table_rectype;

    BEGIN

    dbms_output.put_line ('xx_sample_prc appeal');

    xx_sample_pkg.xx_sample_prc (l_rec_type);

    for l_rec in 1.l_rec_type.p_name.count

    loop

    dbms_output.put_line ('YZ' | l_rec_type.p_name (l_rec) |) » '|| l_rec_type.p_emp_id (l_rec));

    end loop;

    end;

    ---------------------------------------------------------------

    bb8c573a-6ca3-4d7c-90ed-e55c2df67201 wrote:

    But now, my question would be why the record type could not be used? My understanding is missing some concept between use of type type array collection record vs. Please specify.

    Do not confuse the folder with the collection.

    SY.

  • How to extract the date parameter, which must appear in the report model?

    Hi gurus and Experts.

    I need to shoot the date setting, I chose at RANDOM to appear in my report model? How this code at RANDOM?

    Identifier are: dto and cdes
    Channel marker date: MM-DD-YYYY

    Kind regards

    JP

    Published by: user10955574 on November 10, 2010 02:38

    Published by: user10955574 on November 10, 2010 02:39

    Declare the parameter in the model as

    and use it as

  • How to get the return parameter in sequence teststand ran by labview labview

    Hello

    Executes a test sequence of labview (essentially running "\Examples\TestStand API\Executing sequences using API\LabVIEW\Execute with no Model.vi process") I need to get a parameter returned in 'Settings', after the sequence has run.

    My problem is that I get the value upon registration of the sequence and not the value after execution.

    How?

    Vagn

    Vagn,

    in order to obtain the values of the execution, you need access to execution. The following screenshot shows how to access.

    Please note that this VI is lying will be called by TestStand. DO NOT USE THIS VI IN A CUSTOM USER INTERFACE!

    Thank you

    Norbert

    EDIT: This dummy code shows how to read the string parameter 'Return '. Each parameter must be read separately with appropriate playback function.

  • How to call the output parameter during the execution of a procedure

    Hello

    I wrote a small procedure using parameter, how can I call this procedure?

    exec prc_TABLE('emp',1)

    I tried prc_TABLE ('emp') that the two do not work?

    Any help would be appretiated.
    create or replace procedure  prc_TABLE (str in varchar2,
                                   CODE  OUT number
                                                   )   
    
    Begin
    
         CODE := 1;     
    
         DBMS_OUTPUT.PUT_LINE(code);
         
    end;
    
    /
    Zaid

    >
    I wrote a small procedure using parameter, how can I call this procedure?
    >
    You can not call SQL - if that's what you are wanting to do. You can only call functions of SQL, and these functions cannot have OUT parameters.

  • How to change the PCTFREE parameter for an existing table

    How to change the PCTFREE parameter for an existing table?

    Guys can you help me please

    Hello

    Of course it is possible.
    In this case you would export the table from the database (using old style exp)
    Start the import with the index_file option to generate the table/index instructions
    Modify the file created and updated the PCTFREE and remove any that need to be performed (default, if I remember correctly, he comments on the statements of the Index)
    Run the file for the table and the index created
    After that start the import with the option "ignore = yes".

    Make sure that you export only this particular table using "tables =
    Also in importing the "ignore = yes" will also be important data that still exists.

    In my view, however, this is not what you want to do. It's more complex, sensitive failure and the table should be deleted, so users are affected unnecessarily long.

    Success!
    FJFranken

  • How to declare a global xml element in as2?

    How to declare a global xml element in as2?

    _Global.XML = new XML();

  • How to place a return parameter of bounded workflow?

    jDeveloper: 11.1.1.0.2

    I'm having a problem trying to figure how to pass parameters between 2 completely bounded task different flows implemented with fragments that are found in the regions on the pages of the shell. Here is the configuration:

    The flow of tasks without the application terminals there are simply two shell .jspx pages (Shell1.jspx and Shell2.jspx). There are cases of navigation simple control flow between them (toShell1, toShell2).
    Shell2.JSPX a page defined input parameters.
    I have also two workflow stubborn implemented with fragments (fragmentFlow1 and fragmentFlow2).
    Shell1 a fragmentFlow1 included as a region on the page and Shell2 fragmentFlow2 included as a region.
    fragmentFlow2 has an input for its stubborn flow parameter, and the fragment reads and displays this value pageFlowScope.

    When a link is clicked in fragment1 (the fragment fragmentFlow1, understood as a region Shell1) this bounded workflow uses a call to the activity parent to call case navigation "toShell2" of control flow. Shell2 page is then surfed in and its region is then displayed.
    I want to enter a parameter all the way from fragment1 fragment2 when the user clicks on this link in fragment1.

    What I have to work is I can put the value of the input on Shell2 variable of any where in the page Shell1.jspx or he is backing bean. The value appears correctly in fragment2, so there is no problems with reading the entry on the side fragmentFlow2.

    How can I get a parameter of fragment1 in Shell1? Can I do this without going through a workflow task explicit call anywhere? Is there a better way to address the issue? Thanks in advance!

    You can use contextual actions.
    There are so many links/messages for them... Here are some examples:
    http://soadev.blogspot.com/2010/08/ADF-UI-shell-taking-advantage-of.html
    http://soadev.blogspot.com/2010/08/loosely-coupled-bounded-task-flows.html

    Amit

  • How to set the NLS_COMP parameter to the instance level?

    In Oracle 11 g, we can change the NLS_COMP and NLS_SORT setting at the session level. But how to put at the instance level. It has been said (see http://www.orafaq.com/node/91) which can be donw with the operating system environment variables. I did on Linux
    export NLS_COMP=linguistic
    export NLS_SORT=BINARY_CI
    Then check with
    select * from NLS_INSTANCE_PARAMETERS where parameter in ('NLS_SORT','NLS_COMP');
    PARAMETER                      VALUE
    ------------------------------ ----------------------------------------
    NLS_SORT
    NLS_COMP                       BINARY
    The parameter are undefined.

    ALTER instance does not work:
    ALTER SYSTEM SET NLS_COMP=ANSI; 
    ORA-02096: specified initialization parameter is not modifiable with this option
    How to configure the instance parameter?

    Try: -.

    ALTER SYSTEM SET NLS_COMP = ANSI scope = spfile;

    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28320/initparams135.htm

  • How to change the USE_INDIRECT_BUFFERS parameter

    Hello
    in 10g R2:
    How to change the USE_INDIRECT_BUFFERS parameter:
    SQL> alter system set USE_INDIRECT_BUFFERS=TRUE scope=spfile;
    alter system set USE_INDIRECT_BUFFERS=TRUE scope=spfile
                     *
    ERROR at line 1:
    ORA-02065: illegal option for ALTER SYSTEM
    Thank you.

    Try this:
    ALTER system set USE_INDIRECT_DATA_BUFFERS = TRUE scope = spfile;

Maybe you are looking for

  • iOS 10 keyboard in Safari

    In Safari and only Safari, iOS 10 now, when you go to the keypad to use a comma or other Liposuction you will need to manually return the keyboard letter after clicking on the sought after Liposuction. All the other programs that it goes up automatic

  • My iphone 6 goes straight to the messages when it is called

    Why my iPhone 6 9.3.1 IOS go to messages when it is called? It does not ring.

  • Satellite 5200 - Touchpad scrolling in Opera / Touchpad backlighting

    Hello. Recently downloaded the Opera browser & find scrolling Synaptics stopped working!All other functions seem good & scrolling is always fine with MS ExplorerCan someone tell me if this can be fixed?[Using a Satellite 5200-902] Also Touchpad light

  • Quick Office does not!

    I've updated ICS recently updated on my motorola razr maxx. I added a file in my Quicksheet. Lately my apps Quicksheet and Quickpoint crash as soon as I open them. I get "Unfortunatley Quickoffice has stopped working" crash message. Not there at - it

  • Change the path of the file of the scanned Document

    Hi, can someone do that to me. I have a HP Deskjet 2515 all-in-one printer, I was wondering how to change the location of the file of the scanned photos or documents. Whenever I scanned a document, it was recorded on the forlder of my documents in th