Passing Values to Object Type Attributes

Hi Experts,
I need to pass values to object type attributes amount,channel and company code from zprogram.
I have got FM 'SWO_INVOKE'.But in this FM how will I pass values to 3 attributes.
I have created object type through SWO1 .Is it necessary to call FM SWO_CREATE before FM 'SWO_INVOKE'.
Please suggest.
Regards,
Kaustubh.

Hi,
I guess you will have to Initialize business object first by using the function module "SWO_CREATE' and then call the other function module to pass the attributes. I am not sure, but please check by passing the attribute name and value to the tables parameter 'CONTAINER'.
CONTAINER-ELEMENT = <Attribute name>.
CONTAINER-VALUE = <value from the Zprogram>.
Hope this will help.
Thanks,
Samson

Similar Messages

  • What are the different values available for type attribute

    Hi,
        I am working with IDOC to Stored Procedure. For each field we need to give the values for 'isInput' and 'type' attributes. I need to pass values for 'datetime' and 'numeric' fields. What are the list of values availabIe for 'type' attribute. I know only about 'CHAR' attribute.
         Can anybody please tell me what all the values availabe for attribute 'type'. I am facing this problem while giving the value for type attribute.
    Thanks in Advance,
    Murthy.

    Does this help
    tring
        Data that contains a combination of letters, numbers, and special characters. String data types are listed below:
    CHARACTER: Fixed-length character strings. The common short name for this data type is CHAR.
    VARCHAR: Varying-length character strings.
    CLOB: Varying-length character large object strings, typically used when a character string might exceed the limits of the VARCHAR data type.
    GRAPHIC: Fixed-length graphic strings that contain double-byte characters.
    VARGRAPHIC: Varying-length graphic strings that contain double-byte characters.
    DBCLOB: Varying-length strings of double-byte characters in a large object.
    |BINARY: A sequence of bytes that is not associated with a |code page.
    |VARBINARY: Varying-length binary strings.
    BLOB: Varying-length binary strings in a large object.
    |XML: Varying-length string that is an internal representation |of XML.
    Numeric
        Data that contains digits. Numeric data types are listed below:
    SMALLINT: for small integers.
    |INTEGER: for large integers.
    |BIGINT: for bigger values.
    DECIMAL(p,s) or NUMERIC(p,s), where p is precision and s is scale: for packed decimal numbers with precision p and scale s. Precision is the total number of digits, and scale is the number of digits to the right of the decimal point.
    |DECFLOAT: for decimal floating-point numbers.
    REAL: for single-precision floating-point numbers.
    DOUBLE: for double-precision floating-point numbers.
    Datetime
        Data values that represent dates, times, or timestamps. Datetime data types are listed below:
    DATE: Dates with a three-part value that represents a year, month, and day.
    TIME: Times with a three-part value that represents a time of day in hours, minutes, and seconds.
    TIMESTAMP: Timestamps with a seven-part value that represents a date and time by year, month, day, hour, minute, second, and microsecond.
    Regards
    Ravi

  • How to set default value to date type attribute.

    Hi,
    How to set default value to date type attribute.
    E.g I want to set u201C01/01/1999u201D to date attributes.
    First i want to set value and then i want to fetch the same & want to check equals.
    please suggest solution.
    Regards,
    Smita

    Hi,
    In wdinit() method u can set the date
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    Date today = Calendar.getInstance().getTime();
    String reportDate = df.format(today);
    wdContext.currentContextElement().setFromDate(reportDate);
    Another way you have set the this formate like that
    1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
    2. Select the type as "date"
    3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
    4.Bind the context attribute to the type created now.
    Hope this helps u.
    Best Regards
    Vijay K

  • How to pass conventional table values in object types Dynamically

    Hi All,
    Need urgent help...
    TYPE add_ty is object
    (add1     varchar2(50),
    add2     varchar2(50),
    add2     varchar2(50))
    type add_ty_obj is table of add_ty;
    create table company_dtl
    (cmpid          number(10),
    cmpname          varchar2(100),
    address          add_ty_obj);
    table company_dtl contains demo data as below:-
    cmpid cmpname address
    C101     abc     UK,
              USA,
              AUS
    c102     xyz     UK,
              CN,
              GER
    If I want to read data from table and pass data to object add_ty_obj,
    So How can I do it dynamically. I am willing to create procedure
    which can read data from above table and pass that to mentioned object in
    OUT parameter.
    Out parameter contains same object type somewhere in middleware.
    Please help or advice.
    Thanks in Advance..

    Hi
    i have tried to make procedure that take company id as input and give their address as output.I think it might be useful for you. Or if you want something different
    please write us with more detail.
    CREATE OR REPLACE PROCEDURE READ_DATA_PROC( VAR_CMPID IN NUMBER , VAR_TYP OUT ADD_TY_OBJ)
    AS
    BEGIN
    SELECT ADDRESS INTO VAR_TYP FROM COMPANY_DTL WHERE CMPID = V_CMPID ;
    END READ_DATA_PROC;
    here i'm also adding your table and type definition i've used
    CREATE TYPE ADD_TY IS OBJECT
    (ADD1 VARCHAR2(50),
    ADD2 VARCHAR2(50),
    ADD3 VARCHAR2(50));
    CREATE TYPE ADD_TY_OBJ AS TABLE OF ADD_TY;
    CREATE TABLE COMPANY_DTL
    (CMPID NUMBER(10),
    CMPNAME VARCHAR2(100),
    ADDRESS ADD_TY_OBJ)
    NESTED TABLE ADDRESS STORE AS ADDRESS_TAB;thanks,
    Neeraj
    Edited by: Neeraj.Ora on Feb 26, 2011 1:03 PM

  • Get object type attribute value

    1 am trying binding Oracle Object types to java object types using the ORAData interface.
    I created a simple object type called att_mesg_type with the syntax
    create type att_mesg_type as object (subject varchar2(200),Text varchar2(1000));
    I then created a class called attMesgType using Jpublisher which implements the interface.
    The getSubject() and getText() method return '???'.
    Anybody has any insights? Any inputs are appreciated.

    declare
    attr_name varchar2(10) := 'ATTR1';
    attr_value varchar2(50);
    type_instance MyType := MyType('VALUE 1', 'VALUE 2');
    begin
        execute immediate 'declare type_instance MyType := :1; begin :2 := type_instance.' || attr_name || '; end;'
          using type_instance,out attr_value;
        dbms_output.put_line(attr_value);
    end;
    VALUE 1
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Displaying value of Object type

    Hi All,
    I have created one type as Object and I am trying to display the values available in object type for debugging purpose. Please assist me to display the contents of object type.
    Thanks in Advance.
    Regards,
    Venkatesh S

    vivekan wrote:
    I have created one type as Object and I am trying to display the values available in object type for debugging purpose. Please assist me to display the contents of object type.You can do this statically or dynamically.
    The static approach would be to add a DebugDump() method to the object type class - and code this method to display a "debug dump" (via DBMS_OUTPUT for example) of the current instantiated object. Of course, should the class change (new attributes added for example), this DebugDump() method has to be updated.
    The dynamic method is more flexible - but requires a copy of the object to be created for the dynamic code to use and "dump".
    As the static method is pretty straightforward, I'm only providing a basic example of the dynamic method.
    // create a function that generates a PL/SQL anonymous code block that accepts the
    // object to dump as bind variable and the display the object's attributes
    SQL> create or replace function GenerateDumpCode( typeName varchar2 ) return varchar2 is
      2          LF_INDENT       constant varchar2(10) default chr(10)||chr(9);
      3          LF              constant varchar2(10) default chr(10);
      4          type TAttrList is table of user_type_attrs.attr_name%Type;
      5          type TAttrTypeList is table of user_type_attrs.attr_type_name%Type;
      6          attrName        TAttrList;
      7          attrType        TAttrTypeList;
      8          plCode          varchar2(32767);
      9  begin
    10          select
    11                  a.attr_name, a.attr_type_name
    12                          bulk collect into
    13                  attrName, attrType
    14          from    user_type_attrs a
    15          where   a.type_name = typeName
    16          order by
    17                  a.attr_no;
    18 
    19          plCode :=
    20  'declare
    21          obj '||typeName||';
    22 
    23          procedure W( line varchar2 ) is
    24          begin
    25                  DBMS_OUTPUT.put_line( line );
    26          end;
    27  begin
    28          obj := :var1;
    29  ';
    30 
    31          for i in 1..attrName.Count loop
    32                  plCode := plCode ||LF_INDENT|| 'W( ''Attribute '||attrName(i)||'=''||';
    33                  case attrType(i)
    34                          when 'NUMBER' then plCode := plCode || 'to_char(obj.'||attrName(i)||') );';
    35                          when 'INTEGER' then plCode := plCode || 'to_char(obj.'||attrName(i)||') );';
    36                          when 'VARCHAR2' then plCode := plCode || 'obj.'||attrName(i)||' );';
    37                          when 'DATE' then plCode := plCode || 'to_date(obj.'||attrName(i)||',''yyyy/mm/dd hh24:mi:ss'') );';
    38                  else
    39                          plCode := plCode || '''data type '||attrType(i)||': value not displayed.'');';
    40 
    41                  end case;
    42          end loop;
    43 
    44          plCode := plCode ||LF|| 'end;';
    45 
    46          return( plCode );
    47  end;
    48  /
    Function created.
    // we need a sample object type/class for, so here's a basic one
    SQL> create or replace type TFunkyFoo is object(
      2          day             date,
      3          empID           integer,
      4          empName         varchar2(20),
      5          contract        clob
      6  );
      7  /
    Type created.
    // the dynamic code block that the function will generate looks as follows:
    SQL> select GenerateDumpCode( 'TFUNKYFOO' ) as PLSQL_CODE from dual;
    PLSQL_CODE
    declare
            obj TFUNKYFOO;
            procedure W( line varchar2 ) is
            begin
                    DBMS_OUTPUT.put_line( line );
            end;
    begin
            obj := :var1;
            W( 'Attribute DAY='||to_date(obj.DAY,'yyyy/mm/dd hh24:mi:ss') );
            W( 'Attribute EMPID='||to_char(obj.EMPID) );
            W( 'Attribute EMPNAME='||obj.EMPNAME );
            W( 'Attribute CONTRACT='||'data type CLOB: value not displayed.');
    end;
    // using the function to dynamically display an object's attributes
    SQL> declare
      2          foo TFunkyFoo;
      3  begin
      4          foo := new TFunkyFoo( sysdate, 100, 'John Smith', null );
      5          execute immediate
      6                  GenerateDumpCode( 'TFUNKYFOO' )
      7          using   foo;
      8  end;
      9  /
    Attribute DAY=2012-08-30 14:48:35
    Attribute EMPID=100
    Attribute EMPNAME=John Smith
    Attribute CONTRACT=data type CLOB: value not displayed.
    PL/SQL procedure successfully completed.
    SQL>

  • Assign value to Object type variable

    CREATE OR REPLACE TYPE emp AS OBJECT (
    empid NUMBER,
    age NUMBER,
    dob date);
    CREATE OR REPLACE TYPE emp _tab AS TABLE OF emp;
    Pls hlep me assign value to the object type variable in loop..(assume there is 5 10 records in emp table)
    declare
    v_emp_tt emp _tab ;
    begin
    for i in (select empid ,age ,dob from emp ) Loop
    v_emp_tt := i.empid; --this is wrong pls help me correct it.
    end loop;
    end;
    thanks,

    I would keep the type/object naming convention distinct from the table name.
    In terms of assignment:
    CREATE OR REPLACE TYPE to_emp AS OBJECT
    (empid NUMBER,
    age NUMBER,
    dob date);
    CREATE OR REPLACE TYPE tt_emp AS TABLE OF emp;
    declare
    v_emp tt_emp;
    begin
    select to_emp_obj(emp_id, age, dob)
    bulk collect into v_emp
    from emp;
    end;

  • Object Types Attributes (Data Modeler 3.0 EA1.)

    Hi,
    Will the attribute object type support in data modeler be upgraded to the same functionality as column relational table support in 3.0? For relational columns I can attach a domain to a column, I can't attach a domain to an attribute in an object type. Also for a column I can define a 'Units', that is VARCHAR2 (30 BYTE) orVARCHAR2 (30 CHAR). If can't do this with the (Data Modeler 3.0 EA1.) for an object type's attribute. Will this be included?
    Thanks,
    Scott

    Sue,
    Thanks to you and your team for extending this to the object type (structured type) portion of SDDM 3.3 EA1 and 3.3 EA2. The object type portion of SDDM is pretty robust now for modeling and actually generating useable structures in the database (Oracle) now. With 3.3 EA2 at this point it will be much easier to take advantage of the object type features in the database and our applications. I have been waiting since Oracle version 8 for the tools team to provide a modeling tool that mirrors the functionality the server team has provided when it comes object types.
    Thanks for this in SDDM 3.3 EA1 and SDDM 3.3 EA2!
    ScottK

  • How to access Business object type attribute from a method/function modul ?

    Hello,
    i have created a business object type object along with attributes and methods. Now inside the method i want to access the attributes. inside the method i am writing:
    data a type XXX.
    a = me->attribute
    this is creating a compilation error.
    Now the method is defined as a function module in some package, so can anyone inform me how to access object attributes from the function module ?
    pointes are awarded
    Regards

    Hello,
    thanks for your answer, but this too did not work, "=>" is for static attributes and the attributes i have are not static. Moreover, i tried it but it gave the same error :
    the abap error was when i was checking the code is :
    the type me=>documenttype is unknown
    as you know in SWO1 i created an object and when i create a method you link it to a function module and this is where you have the implementation of the method, so from this method how can i access the attributes on the main object that i created in SWO1
    regards

  • Trying to pass Oracle array/object type to Java

    I have a Java class with two inner classes that are loaded into Oracle:
    public class PDFJ
        public static class TextObject
            public String font_name;
            public int font_size;
            public String font_style;
            public String text_string;
        public static class ColumnObject
            public int left_pos;
            public int right_pos;
            public int top_pos;
            public int bottom_pos;
            public int leading;
            public TextObject[] column_texts;
    }I have object types in Oracle as such that bind to the Java classes:
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT" AS OBJECT
    EXTERNAL NAME 'PDFJ$TextObject'
    LANGUAGE JAVA
    USING SQLData(
      "FONT_NAME" VARCHAR2(25) EXTERNAL NAME 'font_name',
      "FONT_SIZE" NUMBER EXTERNAL NAME 'font_size',
      "FONT_STYLE" VARCHAR2(1) EXTERNAL NAME 'font_style',
      "TEXT_STRING" VARCHAR2(4000) EXTERNAL NAME 'text_string'
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT_ARRAY" AS
      TABLE OF "PROGRAMMER"."PDFJ_TEXT";
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN" AS OBJECT
    EXTERNAL NAME 'PDFJ$ColumnObject'
    LANGUAGE JAVA
    USING SQLData(
      "LEFT_POS" NUMBER EXTERNAL NAME 'left_pos',
      "RIGHT_POS" NUMBER EXTERNAL NAME 'right_pos',
      "TOP_POS" NUMBER EXTERNAL NAME 'top_pos',
      "BOTTOM_POS" NUMBER EXTERNAL NAME 'bottom_pos',
      "LEADING" NUMBER EXTERNAL NAME 'leading',
      "COLUMN_TEXTS" "PROGRAMMER"."PDFJ_TEXT_ARRAY" EXTERNAL NAME 'column_texts'
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN_ARRAY" AS
        TABLE OF "PROGRAMMER"."PDFJ_COLUMN";
    /I successfully (as far as I know) build a PDFJ_COLUMN_ARRAY object in a PL/SQL procedure. The PDFJ_COLUMN_ARRAY contains PDFJ_COLUMN objects; each of those objects contains a PDFJ_TEXT_ARRAY of PDFJ_TEXT objects (Example: pdf_column_array(i).pdf_text_array(i).text_string := 'something';). In this procedure, I pass this PDFJ_COLUMN_ARRAY as a parameter to a Java function. I assume the Java function parameter is supposed to be a oracle.sql.ARRAY object.
    I cannot figure out how to decompose this generic ARRAY object into a ColumnObject[] array. I also tried Googling and searching the forums, but I can't figure out matching search criteria. I was wondering if anyone here knows anything about passing user-defined Oracle type objects to a Java function and retrieving the user-defined Java class equivalents that they are supposedly mapped to--especially a user-defined array type of user-defined object types containing another user-defined array type of user-defined object types.

    Ok. I will try asking on the JDBC forum. So, don't
    flame me for cross-posting. :PWe won't, if over there you just post basically a
    link to this one.
    sigh Guess what, he did it the flame-deserving way. It's crossposted at:
    http://forum.java.sun.com/thread.jspa?threadID=602805
    <flame level="mild">Never ceases to amaze me how people don't think that posting a duplicate rather than a simple link isn't wasteful, as people could end up answering in both of them, not seeing each other's answers</flame>

  • SELECT VALUES FROM OBJECT TYPES

    Hi
    I want to select values in a object types in a table over the database link.
    like
    select name from [email protected]
    where name is of type varray of varchar2(100)
    and db.com is database link.
    It is giving me error ORA-22804.
    Oracle supports this or not?

    SQL> var a refcursor
    SQL> declare
      2   bb emp%ROWTYPE;
      3  begin
      4   select * into bb from emp where rownum = 1;
      5   open :a for select bb.ename ename, bb.empno empno from dual;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> print a
    ENAME                                 EMPNO
    SMITH                                  7369Rgds.

  • Passing parameter of object type between Oracle & VB

    Hello,
    I want to pass parameters of ref cursor type variable between oracle 8i routines and Vb routines. It will be very helpfull for me if you can help in telling me about how to do it.
    Regards
    Rakesh Banerjee

    1. On the Oracle side, you may need to do the following:-
    (a) define a ref cursor of the desired type in a package specification
    (b) define a procedure that returns the ref cursor type as an out parameter, or alternately a function that returns the ref cursor type as a return value.
    (c) associate a select statement in the definition of the procedure or function using the synrtax OPEN ref_cursor_name FOR "select XYZ from abc"
    (d) compile and debug the package
    2. On the VB side one can:-
    (a) call the stored procedure or function using the ODBC call syntax for calling stored procedures
    (b) bind the output parameter or return value to a resultset variable in VB.
    3. The critical step would be using an ODBC driver that supports this syntax and functionality. If the driver available at your site does not work you may need to buy a third party driver that does.
    Hope that helps ...
    Regards,
    Narayan.

  • Pass Value/Transfer Object to ejbCreate?

    I'm currently doing some entity bean programming and I'm thinking if it's possible to pass a Value Object to the ejbCreate method rather than a long list of parameters for all fields in an EJB.
    You see most EJB tutorials that I've come across write ejbCreate as a method that takes in parameters for all fields/properties.
    So we call it using say:
    customerHome.create(customerId, customerName, ...blah, blah, blah,...); Since we have a Value Object, why don't we just have something like this:
    CustomerVO c = new CustomerVO(customerId, customerName, ...blah...);
    customerHome.create(c);Doesn't this look better and cleaner?
    Anyway, how does the EJB methods mapping works? Why do I call the method .create(...) in Home interface and in the Bean implementation I've .ejbCreate(...) method instead?
    What about the rest, say ejbLoad(), ejbStore, ejbRemove()? Just strip all the "ejb" infront and call them .store(), .load(), .remove() in Home interface?
    Also, why do only .create(..) appear in Home interface itself? Are the rest (.store(), .load(), .remove())inherited and therefore not have to be specified?

    Sorry for the formatting mistake above. Below is the corrected version.
    I'm currently doing some entity bean programming and I'm thinking if it's possible to pass a Value Object to the ejbCreate method rather than a long list of parameters for all fields in an EJB.
    You see most EJB tutorials that I've come across write ejbCreate as a method that takes in parameters for all fields/properties.
    So we call it using say:
    customerHome.create(customerId, customerName, ...blah, blah, blah,...); Since we have a Value Object, why don't we just have something like this:
    CustomerVO c = new CustomerVO(customerId, customerName, ...blah...);
    customerHome.create(c);Doesn't this look better and cleaner?
    Anyway, how does the EJB methods mapping works? Why do I call the method .create(...) in Home interface and in the Bean implementation I've .ejbCreate(...) method instead?
    What about the rest, say ejbLoad(), ejbStore, ejbRemove()? Just strip all the "ejb" infront and call them .store(), .load(), .remove() in Home interface?
    Also, why do only .create(..) appear in Home interface itself? Are the rest (.store(), .load(), .remove())inherited and therefore not have to be specified?

  • Error Thrown while assinging the value into OBJECT TYPE

    Hi Oracle Experts:
    i was create one Oracle OBJECT, that object contain only one variable, and i created one function which is return the object(system date), but while i complied that procedure i was thrown the error message like ORA-06530: Reference to uninitilized composite .
    can any one tell me how can i use the object variable in the select statement into clause .
    Below i pasted my code.
    CREATE OR REPLACE TYPE str_batch IS OBJECT
    sys_date DATE
    CREATE OR REPLACE FUNCTION F_Ln_Getodperd
    p_s_actype VARCHAR2,
    p_s_acno VARCHAR2,
    p_n_bal NUMBER,
    p_d_prodt DATE
    )RETURN str_batch
    IS
    lstr_od str_batch ;
    BEGIN
    SELECT SYSDATE  INTO lstr_od.sys_date FROM dual; -- Error(Error message shown in below)
    dbms_output.put_line('');
    RETURN lstr_od;
    END;
    Error:
    ORA-06530: Reference to uninitilized composite
    Thanks in advance
    Arun M M

    Hi Mr. Saubhik
    Below i Paste my original source code. Still am facing the same problem while i execute the function. can you please tell me the solution for this.
    OBJECT :
    CREATE OR REPLACE TYPE str_batch IS OBJECT
    batchno NUMBER,
    batchslno NUMBER,
    act_type VARCHAR2(20),
    act_no VARCHAR2(20),
    curr_code VARCHAR2(10),
    amount NUMBER(23,5),
    MOD VARCHAR2(10),
    drcr VARCHAR2(2),
    cheqno VARCHAR2(20),
    cheqdt DATE,
    sts VARCHAR2(4),
    operid NUMBER,
    narr VARCHAR2(300),
    srno VARCHAR2(10),
    rem_type VARCHAR2(10)
    Function :
    CREATE OR REPLACE FUNCTION F_Ln_Getodperd
    p_s_actype IN VARCHAR2,
    p_s_acno IN VARCHAR2,
    p_n_bal IN NUMBER,
    p_d_prodt IN DATE
    )RETURN str_batch
    IS
    lstr_od str_batch ;
    -- Variable Declaration
         v_n_perd     NUMBER;     
         v_n_lnperd     NUMBER;     
         v_n_mon NUMBER;
         v_n_effmon NUMBER;
         v_n_instno NUMBER;
         v_n_odno NUMBER;
         v_n_actual NUMBER(23,5);
         v_n_diff     NUMBER(23,5);
         v_n_inst     NUMBER(23,5);
         v_d_first     DATE;
         v_d_exp DATE;
         v_d_oddt     DATE;
         v_d_lastprod DATE;
         v_s_instmode VARCHAR2(10);
         v_s_inst     VARCHAR2(10);
         v_s_branch VARCHAR2(10);
         v_s_errm VARCHAR2(20000);
    BEGIN
    SELECT F_Get_Brcode INTO v_s_branch FROM dual;
         SELECT pay_c_final,lon_d_expiry, lon_d_lastprod
         INTO     v_s_inst,v_d_exp, v_d_lastprod
         FROM      LOAN_MAST
         WHERE branch_c_code = v_s_branch AND
              act_c_type      = p_s_actype AND
              act_c_no      = p_s_acno;
         IF (p_d_prodt > v_d_exp) THEN
              SELECT CEIL(MONTHS_BETWEEN(p_d_prodt,v_d_exp)) INTO lstr_od.batchslno FROM dual;
              lstr_od.cheqdt := v_d_exp;
              SELECT v_d_lastprod - p_d_prodt INTO lstr_od.batchslno FROM dual;
              --lstr_od.batchslno = DaysAfter(DATE(ldt_lastprod), DATE(adt_prodt))
         ELSE
              IF (v_s_inst = 'N') THEN
                   IF p_d_prodt > v_d_exp THEN
                        SELECT CEIL(MONTHS_BETWEEN(p_d_prodt,v_d_exp)) INTO lstr_od.batchslno FROM dual;
                        lstr_od.cheqdt := v_d_exp;
                   ELSE
                        lstr_od.batchslno := 1;
                   END IF;     
              ELSIF (v_s_inst = 'Y') THEN
                   SELECT first_d_due,lon_c_instperd,lon_n_perd
                   INTO v_d_first,v_s_instmode,v_n_lnperd
                   FROM LOAN_MAST
                   WHERE branch_c_code = v_s_branch AND
                        act_c_type      = p_s_actype AND
                        act_c_no          = p_s_acno;     
              SELECT CEIL(MONTHS_BETWEEN(p_d_prodt,v_d_first)) INTO v_n_mon FROM dual;          
                   IF v_n_mon > 0 THEN
                        SELECT NVL(ln_n_balance,0),NVL(ln_n_instlamt,0),NVL(ln_n_instlno,0)
                        INTO v_n_actual,v_n_inst,v_n_instno
                        FROM LOAN_INST_SCH
                        WHERE act_c_type = p_s_actype AND
                             act_c_no     = p_s_acno AND
                             ln_d_effdate = (SELECT MAX(ln_d_effdate)
                                                           FROM     LOAN_INST_SCH
                                                           WHERE act_c_type = p_s_actype AND
                                                                     act_c_no = p_s_acno AND
                                                                     ln_d_effdate < p_d_prodt);
                        IF (p_n_bal > v_n_actual) THEN
                             IF v_n_inst > 0 THEN
                             lstr_od.batchslno := (p_n_bal - v_n_actual) / v_n_inst;
                             END IF;
                        ELSE
                             lstr_od.batchslno := 1;
                        END IF;
                        IF lstr_od.batchslno = 0 THEN
                        lstr_od.batchslno := 1;
                        END IF;
                        --FOR FULL OD
                        IF (v_n_mon > v_n_lnperd) THEN
                        lstr_od.batchslno := (v_n_mon - v_n_lnperd) + lstr_od.batchslno;
                        END IF;
                        IF v_s_instmode = 'Q' THEN
                        lstr_od.batchslno := lstr_od.batchslno * 3;
                        ELSIF v_s_instmode = 'H' THEN
                        lstr_od.batchslno := lstr_od.batchslno * 6;
                        ELSIF v_s_instmode = 'Y' THEN
                        lstr_od.batchslno := lstr_od.batchslno * 12;
                        END IF;
                        SELECT p_d_prodt - lstr_od.batchslno INTO lstr_od.cheqdt FROM dual;
                        IF v_s_instmode = 'M' THEN
                        v_n_odno := v_n_instno - lstr_od.batchslno; -- TO get OD DATE
                             SELECT ln_d_effdate
                             INTO lstr_od.cheqdt
                             FROM LOAN_INST_SCH
                             WHERE act_c_type = p_s_actype AND
                                  act_c_no     = p_s_acno AND
                                  ln_n_instlno = v_n_odno;
                             IF SQLCODE = -1 THEN
                             lstr_od.batchslno := -1;
                             RETURN lstr_od;
                             END IF;
                        END IF;
                        ELSE
                        lstr_od.batchslno := 1;
                        END IF;                                             
              END IF;                                             
              END IF;     
    RETURN lstr_od;
    EXCEPTION
    WHEN OTHERS THEN
    v_s_errm := SQLERRM;
    dbms_output.put_line(SQLERRM);
    lstr_od.batchslno := -1;
    RETURN lstr_od;
    END;
    /

  • SSIS 2012 - Parent/Child Package "Object" Type Variables

    How do I pass Variables of Object type from Parent to Child packages?
    I am using the SSIS 2012 project deployment model.
    Thanks

    You can do it as outlined in
    http://sqlblog.com/blogs/andy_leonard/archive/2010/01/25/ssis-snack-passing-parent-starttime-to-the-child-package.aspx
    But
    When you need an object it is typically a recordset, then just pass the results, or execute the query in a package.
    Arthur My Blog

Maybe you are looking for

  • How to build a website with working pulldown menus on iPad and iPhone?

    Hi everyone! I have designed a website,  http://fccr.ucsd.edu/ , base on "Template #1" by Chris Converse, available at http://www.adobe.com/devnet/dreamweaver/articles/dreamweaver_custom_templates.html The pull-down menus have a curious glitch on the

  • Creating source system in BW3.5

    Hi all,          I create a source system connection using automatic method and fill up all entry in create source system window in next screen  i give user name and password then these errors are shows <b>Changes to Repository or cross-client Custom

  • Do anyone know we're to buy a 3 meter long cable for power to my iPad

    Do anyone know we're to buy a 3 meter long cable for power to my iPad?

  • How to use aggregate function with Date

    Hi All, I have a group of date from that is it possible to Max and Min of date. I have tried like this but its errored out <?MIN (current-group()/CREATION_DATE)?>. I have also tried like this but it doesnt works <?xdoxslt:minimum(CREATION_DATE)?> Is

  • Reporting WBS with orders assigned

    We have a WBS elements structure just for planning and budgeting purposes. Each WBS has several type of orders assigned (investments order, and overhead orders) in order to receive all the actual postings. Does someone know if it is possible to see t