How To Declare an Exception As a Field Inside an Object Type

Hi All;
How can i declare(define as a property) an exception in a object type?
Best Regards...
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> CREATE TYPE ex_t AS OBJECT
  2  (
  3    i NUMBER,
  4    e EXCEPTION,
  5    MEMBER FUNCTION get_i RETURN number
  6  )
  7  ;
  8  /
Warning: Type created with compilation errors
SQL> show err
Errors for TYPE HR.EX_T:
LINE/COL ERROR
PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:      
<an identifier> <a double-quoted delimited-identifier> LONG_     double ref char time timestamp interval date binary national
character nchar  The symbol "<an identifier> was inserted before "EXCEPTION" to continue. 
SQL>

> 2- You could create a different class just to handle exceptions and call it from this one (again you would build a varchar2 attribute to pass the message).
Like this one perhaps. (I've not looked at it in a couple of years though.)
EXCEPTION is not a SQL datatype. Valid datatypes are listed here.

Similar Messages

  • How to handle the Exception in GP using executable callabel object.

    Hi all,
            I handled an exception in GP using Background callable Object. That is working fine.
    (Ex: Exception_No_User_Found). The Problem is I am not able to handle the exceptions for normal callable object. I have done the same thing as i did in background callable object except implementing IGPBackgroundCallableObject Class.  I have created an WebDynpro DC Project where in getDescription method i declared an Exception and in execute method of component controller I caught the exception if no user found.
    Then i created an callable object for this simple DC project. but that is not working i could not catch the exception. when i execute the process it is asking the User ID if i give the wrong userId it is not refreshing back to the user id input form.
    But if i test that simple callable object separately it is throwing an Exception when I give the wrong input..
    but the same thing is working fine using background callable object.
    I couldn't handle the exception for the simple callable object or executable callable object.
    Please If anyone bring me the solution that would be appreciated.
    Thanks in advance.
    Regards,
    Malar.

    Hi Shikhil
    Thanks for your reply
    Please have a look below for exceptions which i am getting in GP and let me know how to handle these exceptions.
    1) "Activity could not be read"
    2) "Action has been stopped"
    3) error while processing the item can not be displayed
    if you give any idea/clue how to handle these exceptions then it would be great help to me
    Thanks
    Sunil

  • How to edit LOV of the status field in activity record type?

    Hi experts
    I just want to edit the list of values of status field in activity record type, it is a read only filed, can anyone tell me if it is possible to edit? seems like it is referenced from a field called "EVENT_STATUS";
    Thanks,
    Tiger

    Tiger, at this time it is not possible to edit the values in this field.

  • How to lock everything except certain text fields?

    I was once sent a Microsoft Word document that could not be edited other that tabbing through text fields for the purpose of filling out answers to questions. The questions were password protected and couldn't be directly edited.
    I want to know if Pages can duplicate that very thing. It would make for excellent templates. I want to be able to tab over text fields without myself or anyone else being able to directly edit most of the document.
    How can I do this?

    Hello SirMcGyver,
    welcome to the Pages Discussionns. To lock shapes, textboxes and every other object use the menu item "Arrange/Lock" after selecting the objects. But after that the object is locked for all actions, you only can select them for unlocking.
    If you want to have this feature exported into a Word document, this is not possible with Pages 1.0.2.
    Frank.

  • How to read XKOMV-EDATU, XKOMV-KBETR fields inside java

    How do get the 
    XKOMV-EDATU date and pass it to ItemUserExit.java for database read and filtering.
    a. The code in ItemUserExit has to filter ZCPI2-ZSPMON for this date XKOMV-EDATU, the delivery date.
    This does not work. prItem.getPricingTimestamp returns the current date always, NOT delivery date.
    What is the method call that will grab this date.?
    b. How do I have to pass this XKOMV-EDATU date to ItemUserExit.java for database read / filtering.
    c. The field XKOMV-KBETR has to be read based on the KSCHL = ‘ZCP1’ and / or KSCHL =’PR00’.
    These are abap structures. But I am not sure how to read this value inside java.
    How would I extract the structure XKOMV-KBETR(the rate) for KBETR(conditionType)=’PR00’ .
    Please note that I get an error mandatory condition PR00 is missing. (see attached error message ).
    d. “CPIW_A” set up in ItemUserExit.java :: itemUserExitAccess.addItemAttributeBinding("CPIW_A", ZVALUE_CPIW_A );
    is NOT available at PricingUserExits.java with the code:
    prItem.getItemAttributeBinding("CPIW_A") ,
    though they are registered in the method
    “determineRelevantAttributesForValueFormula” as per the help html pages.
    I had attached the code.
    Can you scan thru the code and give feedback.
    Can I call you in the morning.
    Thanks.
    TK
    PS:
    I get an error “PR00” mandatory condition is missing from the log file.
    ======
    OP="ChangeDocument" ID="34800003" STATUS="200" />objectIds[1]=07F9101FD1D0AD4686B2411E3EFB2DF1&messageTypes[1]=E&messages[1]=Pricing error: Mandatory condition PR00 is missing&areas[1]=SPE&numbers[1]=801&args1[1]=PR00&args2[1]=&args3[1]=&args4[1]=Nov 11, 2005 12:41:37... ...p.sxe.socket.server.rfc.RFCConnection JCO.ServerThread-3 Info: response time of command C
    However, I get the response header as:
    availableItemConditionTypeNames[1]=PR00&availableItemConditionTypeNames[2]=VA00&availableItemConditionTypeNames[3]=ZA00&availableItemConditionTypeNames[4]=ZOUT&availableItemConditionTypeNames[5]=ZCRT&availableItemConditionTypeNames[6]=K004&availableItemConditionTypeNames[7]=RA01&availableItemConditionTypeNames[8]=RB00&availableItemConditionTypeNames[9]=ZB00&availableH
    CODE:
    ItemUserExit.java snippet:
              qrypair2[0]  = new sys_query_pair("ZCPI", <b>"200501"</b>, sys_query_pair.GREATER); //
              projection = new String[] { "ZCPI" } ;
              sorting = new String[] { "ZCPI" } ;           res resultSet = database.db_read_first_row("ZCPI2", qrypair2, projection, sorting);
    I need to pass the XKOMV-EDATU date field in the above bolded date field.  I think this field is available thru the API for IPricingItemUserExit  inside the overwriteConditionValue method's parameter .
    METHOD
    overwriteConditionValue:
         public BigDecimal overwriteConditionValue(IPricingItemUserExit      prItem,
                                                             ILastPrice                lastPrice,
                                                             IPricingConditionUserExit prCondition,
                                                             int                       valueFormNo) {
              String sold2party = "", strCPIW_A = "", strCPIW_B = "";
              BigDecimal condValue = prCondition.getConditionValue().getValue();
              BigDecimal netValue  = prItem.getNetValue().getValue();
              String prod = (prItem.getProduct()!=null)? prItem.getProduct().toString(): "NULL";
              SAPTimestamp  priceTstamp = prCondition.getConditionFindingTimestamp(); //prItem.getDefaultConditionAccessTimestamp();  //getPricingTimestamp();
              String strTstamp = priceTstamp.formatYYYYMMDD();
              //KOMP-EDATU ??
              logInfo("valueFormNo: " + valueFormNo +  " Condition Table type:"  + prCondition.getConditionTypeName() +
                         ", condVal:" + condValue + ", netValue:" + netValue + ", KOMP-EDATU:" + strTstamp );
              switch (valueFormNo) {
                   case 601:
                             try{
                               sold2party = prItem.getHeaderAttributeBinding("SOLD_TO_PARTY").getValue().getValue();
                               IAttributeBinding iamCPIW_B  = prItem.getItemAttributeBinding("CPIW_B");
                               IAttributeBinding iamCPIW_A  = prItem.getItemAttributeBinding("CPIW_A");
                               if( iamCPIW_A !=null) strCPIW_A = iamCPIW_A.getValue().getValue();
                               if( iamCPIW_B !=null) strCPIW_B = iamCPIW_B.getValue().getValue();
                             }catch(Exception e) {
                                  logInfo("EXCEPTION @ GetAttributeBinding exception : " + e.getMessage());
                             logInfo("sold2party: " + sold2party + " strCPIW_A, strCPIW_B: " + strCPIW_A + ", " + strCPIW_B);
                             String CPIW_A = null, CPIW_B = null, BASE_PRICE = null;
                             logInfo("overwriteConditionValue " +
                                   "_CPIW_A: " + _CPIW_A + ", _CPIW_B: " + _CPIW_B + ", _BASE_PRICE: " + _BASE_PRICE );
                             double l_cpiw_a, l_cpiw_b, l_base;
                             if( _CPIW_A == null || _CPIW_B == null || _BASE_PRICE == null) {
                                  logInfo("overwriteConditionValue *tk* static _CPIW_A.... NULL. returning 999999L" );
                                  return BigDecimal.valueOf( 0L );
                             }else{
                                  l_cpiw_a = Double.valueOf(_CPIW_A).doubleValue();
                                  l_cpiw_b = Double.valueOf(_CPIW_B).doubleValue();
                                  l_base   = Double.valueOf(_BASE_PRICE).doubleValue();
                                  logInfo("overwriteConditionValue *tk* ???? using STATIC Class Variables" );
                             logInfo("overwriteConditionValue " +
                                   "cpiw_a: " + l_cpiw_a + ", l_cpiw_b: " + l_cpiw_b + ", l_base: " + l_base );
                             double fraction = (l_cpiw_a - l_cpiw_b)/l_cpiw_b;
                             logInfo("overwriteConditionValue " +
                                       "*tk* double fraction: " + fraction );                                               
                             double result = l_base * fraction;
                             logInfo("overwriteConditionValue " +
                                       "*tk* double calculated Result: " + result );                       
                             BigDecimal retValue = BigDecimal.valueOf (Math.round(result));
                             condValue = retValue;
                             try{
                                  prCondition.setConditionRate(retValue , "USD");     
                             }catch(Exception convEx){
                                  logInfo("overwriteConditionValue " +
                                                           "*tk* converstion Rate Exception " + retValue );
                             prItem.setObjectForUserExits("XKOMV_KBETR_C", retValue);
                             logInfo("overwriteConditionValue: 601 conditionRate Return Value: " + retValue );
                             return retValue;
                   case 602:
                             /* Forecasted CPI-W value = ( ( D * ( ( A – B ) / B ) )  – ( D + C ) ) */
                        double A = Double.valueOf( PricingUserExits.ZCPI2_ZCPI ).doubleValue();
                        double B = Double.valueOf( PricingUserExits._CPIW_B ).doubleValue();
                        double C=0, D=0;
                        BigDecimal bdC = (BigDecimal)prItem.getObjectForUserExits("XKOMV_KBETR_C");
                        C = bdC.doubleValue();
                        D = C * 0.8;  // just for calculation verification.
                        // C = Double.valueOf( PricingUserExits.XKMOV_KBETR_C ).doubleValue();
                        // D = Double.valueOf( PricingUserExits.XKMOV_KBETR_D ).doubleValue();
                        logInfo("overwriteConditionValue " +
                                                           "*tk* A, B, C, D: " + A + ", " + B + ", " + C + ", " + D);
                        double res1 =  A - B ;
                               res1 =  res1 /B ;
                               res1 =  D * res1;
                        double res2 =  D + C ;
                        double CPI_W ;
                               CPI_W = res1 - res2; //– res2;
                        BigDecimal retn =  new BigDecimal(CPI_W) ;
                       logInfo("overwriteConditionValue *tk* case 602 returning - " + retn );
                        return retn; // new BigDecimal(99999L);
                   default:
                        throw new FormulaNotImplementedException(prItem, "value formula", valueFormNo);

    Java != javascript.
    You can not call java directly from javascript.
    The lifecycle:
    Request received
    Java/JSP runs produces an HTML page
    Java stops running
    Javascript runs on page when page is loaded.
    The only way to call java code again is to submit a request and get the result back in a response. Traditionally the response is a new JSP page to replace the old one.
    Using AJAX the response can be just information that you then alter the current page with.
    The first example given by skp71 will probably NOT be what you are after. The java code is executed when you load the page, NOT when you push the button which is most probably what you are after.
    AJAX is a solution, as is loading a new page.
    Cheers,
    evnafets

  • How to update the path for a field which is of type textarea

    Hi,
    1.I have multiple record block,i need to update the textarea field in this multi entry block.I have put a for loop to achieve the same,however i'm able to update the path for text field,checkbox,selecttype,but am unable to update the path for field which is of textarea.Please suggest.
    2. Also i have another problem which occurs randomly.although i have record for a button click event in  my property file,button click is not happening during the playback.am getting error asVariable "obj.libraryname.web_button_BTN_1" not found for string:
    please not i have entry for the above button in my property file.
    Please suggest.

    Say i have 5 rows then
    for(int i=1;i<=5;i++){
    String Newpath = updatepath(eval("{{obj.libraryname.web_input_text_fieldname}}"),i)
    web.text_area(Newpath).setText("Text to be set")
    Below function is used to update my path
    public String updatepath(String path,int i) throws exception {
    String FPath = "";
    if(i<2) {
    FPath = path.substring(0, path.indexOf("'", path.lastIndexOf("@id=")+5))+path.substring(path.indexOf("'", path.lastIndexOf("@id=")+5));
    } else {
    FPath = path.substring(0, path.indexOf("'", path.lastIndexOf("@id=")+5))+(i-1)+path.substring(path.indexOf("'", path.lastIndexOf("@id=")+5));
    return Fpath
    anyother way to update path and set the fields in mutiple block is appreciable
    thanks
    Suresh

  • How to get the values of the fields inside pageFragment

    Hi All,
    I am working on Jdeveloper 11.1.1.5.
    I have a fragment "home.jsff", in that fragment i have two textboxes(txt1,txt2);
    Then i have created a bounded taskflow "myTF"and dragged the home.jsff inside it and used as a default activity.
    Now finally i have "final.jspx" , in which i have dragged and dropped the bounded taskflow "myTF" as a region.
    Scenario : - I have a button on final.jspx , and on click of that button i need to get the value of those two textboxes using bindings which is present in fragment .
    On Click of button,I am using this method of pageDef and i am able to get the values :-
    jsfUtils.resolveExpression("#{data.abc_homePageDef.txt1.inputValue}");
    but somehow it gives me null in some conditions.I don't know why it sometimes gives the value and why it doesn't.
    I have seen this video in which Frank has told about the API Mistakes : -
    http://download.oracle.com/otn_hosted_doc/classic_api_mistakes_part1/classic_api_mistakes_part1.html
    and i did the same mistake but what is the another approach .
    If i need to get the current value of txt1, then how can i get it??
    What is the best approach to get the values of the pageFragment attributes and how to use it ?
    Please suggest!!!
    Regards,
    Shah

    Hi Tulasi,
    As i have said that i am trying to get the values on the click of button(*not on page load*) situated on final.jspx page.
    On click of button i am using this code to get the values :-
    public String getValueTextBox()
    Object valueTXT= getBoundAttributeValue("txt1");
    logger.info("value is"+ valueTXT); *// It shows the value as null.*
    return null;
    public Object getBoundAttributeValue( String attributeName) {
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindingContainer = bctx.findBindingContainer("abc_homePageDef");
    if (bindingContainer != null) {
    ControlBinding ctrlBinding = bindingContainer.getControlBinding(attributeName);
    if (ctrlBinding instanceof AttributeBinding) {
    return (AttributeBinding)ctrlBinding;
    return null;
    Please suggest!!!
    Regards,
    Shah

  • How to read the data in a field that has data type as VARILRAW

    Hello friends
    I have created a table with one of the field to accept a huge variable lenght field of type 'VARILRAW'.
    I have written a short Function to accept the data from an external program.
    Is there a way to see the data that Ihave entered in this field?
    ALso another problem that I am seeing is that when I send this string back tothe application, I noticed that instead of the data that I have sent, it has stored just a huge strong of letter As (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA).
    If you can please answer these two questions, I would really appreciate it.
    Thanks
    Ram

    Hi Ram,
    Check if it help
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21f2e5446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_46c/helpdata/en/9d/ab1b0f055b11d2806500c04fadbaa1/frameset.htm
    Regards,
    Atish

  • How can I sort a collection of array with different object types in it ?

    Hi all,
    I have a collection of ArrayList; each array contains, at the first position, the same object type.
    I'd like sorting the collection by the name contained in the object at the first position of each array.
    Any suggestion ?
    Cheers.
    Stefano

    so you have a collection of a collection?
    My guess is that:
    You could subclass the arraylist and override it's compareTo method (I think that it implements comparable already but if not, go ahead and implement that interface).
    Or you could wrap your arraylist in another class that implements comparable.
    The key in my mind is correctly coding your compareTo method to look at the name in the first item of the arraylists. This should be doable and not too difficult.
    Correction: after reviewing the ArrayList api, I see that it doesn't implement the Comparable interface. You will have to make any class that either inherits arraylist or contains arraylist implement the comparable interface.
    One last thing: This question would probably have been better off in the java forum and not the Swing forum since it doesn't really involve Swing.
    Good luck!
    Edited by: petes1234 on Nov 19, 2007 6:17 AM

  • How to declare a field in a structure and table

    Hi, I have a doubt in declaring a field inside a structure.
    types: BEGIN OF mrm_rbkpv.
            INCLUDE STRUCTURE rbkp_v.
    types: h_rbws LIKE rbws OCCURS 0,
           end of mrm_rbkpv.
    data : e_rbkp_v type mrm_rbkpv.
    Now I want I to refer to field WT_WITHCD inside table H_RBWS.
    eg : if e_ebkp_v-h_rbws-wt_withcd = 'X ' is right or wrong??????
    POints will rewarded
    Thanks in advance

    hi jaysree,
    types: BEGIN OF mrm_rbkpv.
    INCLUDE STRUCTURE rbkp_v.
    types: h_rbws LIKE rbws OCCURS 0,
    end of mrm_rbkpv.
    data : e_rbkp_v type mrm_rbkpv.
    if e_ebkp_v-h_rbws-wt_withcd = 'X '  - > this will work perfectly.
    rgds
    anver
    if hlped mark points

  • [ORA-22905] How to read a field of an object inside another object?

    Greetings,
    I'm a student and in a current exercise we have to work with the Object Oriented Programming functionality of Oracle.
    In the database we defined an object type, which is then considered inside another object type. The thing is, that I cannot read an attribute of the inner object. I've read tens of websites but none of them have helped so far. I've read the PL/SQL User Guide and Reference document also.
    The inner object is defined as follows:
    create type address_t as object (
            street varchar(50),
            city varchar(50),
            pcode number(5,0)
            );The outer object has an object of type address_t inside it:
    CREATE TYPE professor_t as OBJECT(
              code number(2),
              p_name varchar(50),
              address address_t,
              );Also, there is a table named PROFESSORS that stores objects of type professor_t
    First of all, with a simple testing SQL statement I can see the data inside the object professor, even the object address_t:
    SELECT * FROM PROFESSORS WHERE CODE = 13;returns the following:
    CODE    |         NAME      |       ADDRESS
    13      |         JOHN     |       MYSCHEMA.ADDRESS_T('FIFTH AVENUE','NEW YORK',12345)The thing is, I want to read the field street of the object address (of type address_t) inside professor (of type professor_t).
    I could see everywhere that the way to go is to use point notation, and I've seen examples about the command VALUE, but none of the following SQL statements work:
    SELECT VALUE(ADDRESS.STREET) FROM(
      SELECT CODE,P_NAME,ADDRESS FROM PROFESSORS WHERE CODE = 13);
    SELECT ADDRESS.STREET FROM PROFESSORS WHERE CODE = 13;
    SELECT PROFESSOR.ADDRESS.STREET FROM PROFESSORS WHERE CODE = 13;I'd really appreciate if someone could show me how to access the values of the field of the object inside an object.
    Thanks in advance,
    - David
    Edited by: 858176 on May 11, 2011 6:53 PM Formatting

    Great, this worked so far.
    It is curious that you wrote 'profesores' but that is the actual name for the variable. I translated everything to english in order to post it here.
    So, the statement is:
    select value(t).DIRECCION.CIUDAD from profesores t;And It returned:
    VALUE(T).DIRECCION.CIUDAD                         
    Valencia                                          
    New York
    TijuanaAnd, applying the VALUE command to the statement:
    select codigo,
    nombre,
    value(t).DIRECCION.CALLE,
    value(t).DIRECCION.CIUDAD,
    value(t).DIRECCION.CP
    from profesores T WHERE T.CODIGO = 13;Resulting in:
    CODIGO                 NOMBRE                                             VALUE(T).DIRECCION.CALLE                           VALUE(T).DIRECCION.CIUDAD                          VALUE(T).DIRECCION.CP 
    13                     Pepito Pérez                                       Calle de los Rosales 0                           Valencia                                           46023                  That is EXACTLY what I needed.
    Thanks Thomas, It was really helpful !
    Edited by: 858176 on May 11, 2011 7:46 PM

  • Dynamically built query on execution How to save the data in Object Type

    Hi,
    In pl/sql I am building and executing a query dynamically. How can I stored the output of the query in object type. I have defined the following object type and need to store the
    output of the query in it. Here is the Object Type I have
    CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPE AS OBJECT(
    pkid NUMBER,
    pkname VARCHAR2(100);
    pkcity VARCHAR2(100);
    pkcounty VARCHAR2(100)
    CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPETAB AS TABLE OF FIRST_RECORDTYPE;Here is the query generated at runtime and is inside a LOOP
    --I initialize my Object Type*
    data := new FIRST_RECORDTYPETAB();
    FOR some_cursor IN c_get_ids (username)
    LOOP
    x_context_count := x_context_count + 1;
    -- here I build the query dynamically and the same query generated is
    sql_query := 'SELECT pkid as pid ,pkname as pname,pkcity as pcity, pkcounty as pcounty FROM cities WHERE passed = <this value changes on every iteration of the cursor>'
    -- and now I need to execute the above query but need to store the output
    EXECUTE IMMEDIATE sql_query
    INTO *<I need to save the out put in the Type I defined>*
    END LOOP;
    How can I save the output of the dynamically built query in the Object Type. As I am looping so the type can have several records.
    Any help is appreciated.
    Thanks

    hai ,
    solution for Dynamically built query on execution How to save the data in Object Type.
    Step 1:(Object creation)
    SQL> ED
    Wrote file afiedt.buf
    1 Create Or Replace Type contract_details As Object(
    2 contract_number Varchar2(15),
    3 contrcat_branch Varchar2(15)
    4* );
    SQL> /
    Type created.
    Step 2:(table creation with object)
    SQL> Create Table contract_dtls(Id Number,contract contract_details)
    2 /
    Table created.
    Step 3:(execution Of procedure to insert the dynamic ouput into object types):
    Declare
    LV_V_SQL_QUERY Varchar2(4000);
    LV_N_CURSOR Integer;
    LV_N_EXECUTE_CURSOR Integer;
    LV_V_CONTRACT_BR Varchar2(15) := 'TNW'; -- change the branch name by making this as input parameter for a procedure or function
    OV_V_CONTRACT_NUMBER Varchar2(15);
    LV_V_CONTRACT_BRANCH Varchar2(15);
    Begin
    LV_V_SQL_QUERY := 'SELECT CONTRACT_NUMBER,CONTRACT_BRANCH FROM CC_CONTRACT_MASTER WHERE CONTRACT_BRANCH = '''||LV_V_CONTRACT_BR||'''';
    LV_N_CURSOR := Dbms_Sql.open_Cursor;
    Dbms_Sql.parse(LV_N_CURSOR,LV_V_SQL_QUERY,2);
    Dbms_Sql.define_Column(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER,15);
    Dbms_Sql.define_Column(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH,15);
    LV_N_EXECUTE_CURSOR := Dbms_Sql.Execute(LV_N_CURSOR);
    Loop
    Exit When Dbms_Sql.fetch_Rows (LV_N_CURSOR)= 0;
    Dbms_Sql.column_Value(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER);
    Dbms_Sql.column_Value(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH);
    Dbms_Output.put_Line('CONTRACT_BRANCH--'||LV_V_CONTRACT_BRANCH);
    Dbms_Output.put_Line('CONTRACT_NUMBER--'||OV_V_CONTRACT_NUMBER);
    INSERT INTO contract_dtls VALUES(1,CONTRACT_DETAILS(OV_V_CONTRACT_NUMBER,LV_V_CONTRACT_BRANCH));
    End Loop;
    Dbms_Sql.close_Cursor (LV_N_CURSOR);
    COMMIT;
    Exception
    When Others Then
    Dbms_Output.put_Line('SQLERRM--'||Sqlerrm);
    Dbms_Output.put_Line('SQLERRM--'||Sqlcode);
    End;
    step 4:check the values are inseted in the object included table
    SELECT * FROM contract_dtls;
    Regards
    C.karukkuvel

  • Expression or Function as field in Object Type

    I am trying to use an expression or call a function as a return value for a field in an OBJECT TYPE.
    Here's the obj def:
    CREATE OR REPLACE TYPE OUTAGE_REPEAT_CALL_T2 AS OBJECT (
         INITCALL_TS      DATE,
         LASTCALL_TS      DATE,
         CALL_SRC      CHAR(8),
         ELAPSED_TIME     NUMBER,
         REP_ID           CHAR(8),
         CALL_CNT      NUMBER(3)
    The ELAPSED_TIME field should be the differnece in minutes from the LASTCALL_TS and SYSDATE...
    I'm not sure how to select into this OBJECT to get my result...
    Sample table and data:
    SQL> desc oms.outage_repeat_call
    Name Null? Type
    ACCT NOT NULL NUMBER(10)
    INITCALL_TS NOT NULL DATE
    LASTCALL_TS NOT NULL DATE
    CALL_CNT NOT NULL NUMBER(3)
    CALL_SRC NOT NULL CHAR(8)
    REP_ID NOT NULL CHAR(8)
    The ELAPSED_TIME is not part of the underlying table..
    sample data from tbl:
    ACCT INITCALL_ LASTCALL_ CALL_CNT CALL_SRC REP_ID
    123456 02-JAN-02 02-JAN-02 1 CBIS MJB2302
    I want to have this as a result:
    INITCALL_ LASTCALL_ CALL_SRC ELAPSED_TIME REP_ID CALL_CNT
    02-JAN-02 02-JAN-02 CBIS 9997 MJB2302 1
    But by doing a select from the OBJECT TYPE:
    i.e.
    SELECT OUTAGE_REPEAT_CALL_T2(     ORPC.INITCALL_TS,
                        ORPC.LASTCALL_TS,
    ORPC.CALL_SRC,
                        'expression or func' AS ELAPSED_TIME,
    ORPC.REP_ID,
    ORPC.CALL_CNT)
    FROM
    OMS.OUTAGE_REPEAT_CALL ORPC
    WHERE
    ORPC.ACCT=123456;
    I am using DBMS_XMLQUERY to eventually get this:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <INITCALL_TS>1/2/2002 12:45:0</INITCALL_TS>
    <LASTCALL_TS>1/2/2002 12:45:0</LASTCALL_TS>
    <CALL_SRC>CBIS </CALL_SRC>
    <ELAPSED_TIME>10009</ELAPSED_TIME>
    <REP_ID>MJB2302 </REP_ID>
    <CALL_CNT>1</CALL_CNT>
    </ROW>
    </ROWSET>
    Here's the real query... this OBJECT TYPE is embedded as an attribute of another OBJECT TYPE def.
              sQuery := 'SELECT '
                   || iNumAcct || ' AS NUMACCT,
                   SITE_T(S.ACCT,
                        S.SITE,
                        S.PHONE,
                        S.CUST_NM,
                        S.MED_IND,
                        S.MAC_IND,
                        S.HPP_IND,
                        S.STREET,
                        S.CITY,
                        S.STATE,
                        S.ZIP,
                        S.EUC,
                        S.STATUS,
                        S.AGR_TYP,
                        S.PRICE_SCHED,
                        S.OL_IND,
                        S.TRANS_IND,
                        S.CIRCUIT,
                        S.SUBSTATION,
                        S.OP_CENTER,
                        OUTAGE_STATUS_T(O.OUT_ID,
                             O.OUT_STATUS,
                             O.PO_DEV,
                             O.DEV_TYP,
                             O.CREW,
                             O.ETOR_TS,
                             O.TRBL_CD,
                             O.FIRST_RPT_TS,
                             O.END_TS,
                             O.CUST_CNT,
                             O.O_CALL_CNT,
                             OUTAGE_REPEAT_CALL_T(ORC.INITCALL_TS,
                                  ORC.LASTCALL_TS,
                                  ORC.CALL_SRC,
                                  ORC.REP_ID,
                                  ORC.CALL_CNT),
                             LIGHT_REPEAT_CALL_T(LRC.INITCALL_TS,
                                  LRC.LASTCALL_TS,
                                  LRC.CALL_SRC,
                                  LRC.REP_ID,
                                  LRC.CALL_CNT)
                             ) AS OUTCUST
                   FROM
                   OMS.SITE S,
                   OMS.OUTAGE O,
                   OMS.OUTAGE_REPEAT_CALL ORC,
                   OMS.LIGHT_REPEAT_CALL LRC,
                   OMS.OUTAGE_TRANSFORMER OT
                   WHERE
                   S.ACCT = ' || pi_acctNum || ' AND
                   S.TRNFRMR_ID = OT.TRNFRMR_ID(+) AND
                   OT.OUT_ID = O.OUT_ID(+) AND
                   S.ACCT = ORC.ACCT(+) AND                         
                   S.ACCT = LRC.ACCT(+)';
    I know this may sound confusing...but I apprecitate anyone's/everyone's suggestions!
    MJB
    DUKEPOWER CO.

    yes... here's the function that I also used as the expression...
    FUNCTION uf_minutesDiff(pi_beginDte IN VARCHAR2, pi_endDte IN VARCHAR2) RETURN NUMBER
    ||     FUNC name: uf_minutesDiff
    ||     purpose: this function accepts A BEGINNING DATE AND ENDING DATE AND
    ||               RETURNS THE DIFFERENCE IN MINUTES
    ||
    ||     date:     12/19/2001
    ||     author: Mark J Brooks
    ||
    ||     history:
    ||
    ||
    IS
         iMinutes     NUMBER;
    /*      LINE 280          */
    BEGIN
         select (to_date(pi_endDte,'DD-MON-YYYY:HH24:MI') -
              to_date(pi_beginDte,'DD-MON-YYYY:HH24:MI'))*24*60
              INTO iMinutes from dual;
         IF iMinutes = 0
         THEN
              iMinutes := 1;
         END IF;
         RETURN iMinutes;
    END uf_minutesDiff;
    I also just used:
    SQL> SELECT OUTAGE_REPEAT_CALL_T2( ORPC.INITCALL_TS,
    2 ORPC.LASTCALL_TS,
    3 ORPC.CALL_SRC,
    4 (ORPC.LASTCALL_TS - SYSDATE) AS ELAPSED_TIME,
    5 ORPC.REP_ID,
    6 ORPC.CALL_CNT)
    7 FROM
    8 OMS.OUTAGE_REPEAT_CALL ORPC
    9 WHERE
    10 ORPC.ACCT=123456;
    (ORPC.LASTCALL_TS - SYSDATE) AS ELAPSED_TIME,
    ERROR at line 4:
    ORA-00907: missing right parenthesis
    with and without the parens
    tx

  • How can we execute a procedure with object type as its parameter, by passing partial elements.

    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.

    user13026549 wrote:
    Can somebody help...
    I have a procedure which takes parameter as IN OUT extended object type .Below is the example.
    PROCEDURE p_save (example IN OUT xyz_obj)
    my object type "xyz_obj" have elements with other object types also, and that itself have around 100 elements.
    And when calling the above procedure for test purpose, how is it possible to pass partial elements of the object type rather than setting all unused elements to null.
    It ISN'T possible. How could it be? Each attribute has to be set to something don't you think?
    A common way to handle that is to define a public package variable that is an instance of the object type and has ALL elements set to null. As Odie suggested a custom constructor function can be used for that.
    Then you create your procedure instance by starting with an instance of the package variable (where everything is null) and setting values for the attributes you need.

  • How can i declare a single radio button field in selection-screen ?

    How can i declare a single radio button field in selection-screen ?

    >
    Rob Burbank wrote:
    > And how will you turn it off once it is turned on??
    >
    > Rob
    Thats correct ;)...See ravi if users will ask so many things its our Job to convay the correct solution ....
    Just post your org requirement..SOo some body guide you better//
    Sas

Maybe you are looking for