Com.oracle.httpclient.HttpRequestBuilder and http header defined by the user

Hello

In Java ME embedded 8, I would like to send an HTTP request containing an identifier defined by the user in the (X-header type) http header, using the com.oracle.httpclient package.

HttpClient client = clientBuilder.build ();

RequestBuilder (http://my_uri) client.build = HttpRequestBuilder;
requestBuilder.setHeader (HttpHeader.ACCEPT, "text/plain");

Here, I would like to add a header as user-defined value:
requestBuilder.setHeader ("MyHeader", "myHeaderValue");

It seems there only predefined values for the headers in the com.oracle.httpclient.HttpHeader class.

Is it possible to add a header defined by the user in the application?

Thanks in advance.

Bruno

Hi Bruno.

have you tried myHeader = new HttpHeader ("MyHeader") Httpentete;?

/ Sergey

Tags: Java

Similar Questions

  • Variables, FPGA, defined by the user and SoftMotion 2012 + NOR 9505

    Hello

    To http://forums.ni.com/t5/Motion-Control-and-Motor-Drives/Softmotion-and-NI-950X-Module-Compatibility/... Nathan says:

    NathanK wrote:

    The glue code that connects Softmotion on FPGA LV code RT is called 'the axis interface. The version of the interface of the 2011 Softmotion axis necessary creation screw RT that exposes certain capabilities to Softmotion.

    ....

    Improvements have been made in 2012 Softmotion who has removed the requirement to write RT live. Disclosure for the FPGA happens rather on the Variables (UDVs) user-defined. It is also possible to create a kind of axis 9501 for configuration of the module as well as an axis UDV generic for other completely custom 950 x modules or axes. It is not a specific example for the 9505 yet.

    This caught my attention, as I'm trying to develop a system using LabVIEW SoftMotion 2012 and the NI 9505. I'm curious to see if there are alternative methods to write my application.

    Where can I find more information on this 'generic UDV axis' and how to implement a? Nathan says "is not a specific example for the 9505 yet", but there are examples for the other modules - how similar/different are these modules from the 9505, and it involves a lot of effort to bring examples of the 9505?

    Thank you!

    Hi JKSH,

    I have some relevant information that it is request that may be useful:

    Working with Axes Variable defined by the user (NI SoftMotion Module)

    Resource binding dialog box (NI SoftMotion)

    Configuration OR SoftMotion Axes (OR SoftMotion Module)

    Example that mentions of Nathan is the drive Stepper (9501) .lvproj (material Input and Output"Motion Control" NI SoftMotion"Device Specific" NI 950 x"OR 9501), I would take a peek at this on use of the UDVs.

  • PLS-00323: subprogram or cursor is declared in a package specification and must be defined in the package body

    Hi all

    Please help me understand why I receive PLS-00323 error when my function exists in the header and body of the package.

    Please find below the source code.

    Maybe I should post more details here, please tell me what else should I show to get help.

    I tried to compile my drawing

    EXEC DBMS_UTILITY.compile_schema (pattern = > 'ZVIT');

    but still

    Select * from user_errors

    Returns

    NAME TYPE SEQUENCE LINE (LINE)

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

    TEXT

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

    ATTRIBUTE MESSAGE_NUMBER

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

    PACKAGE 2 8 12 PKG_PK8842_ACCNOTMOVE BODY

    PLS-00323: subprogram or cursor "ACCNOTMOVEFIZ" is declared in a specific package

    cation and must be defined in the package body

    ERROR 323

    PACKAGE 1 3 12 PKG_PK8842_ACCNOTMOVE BODY

    PLS-00323: subprogram or cursor "ACCNOTMOVEJUR" is declared in a specific package

    cation and must be defined in the package body

    ERROR 323

    2 selected lines.

    source code:

    CREATE OR REPLACE PACKAGE ZVIT. PKG_PK8842_AccNotMove

    AS

    FUNCTION AccNotMoveJUR)

    p_contragentId dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number;

    FUNCTION AccNotMoveFIZ)

    p_contragentId dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number;

    FUNCTION DtLastMove)

    p_Id B2_OLAP. DIMAACCOUNT_ALL.ID%TYPE)

    Date of RETURN;

    END;

    /

    CREATE OR REPLACE PACKAGE BODY ZVIT. PKG_PK8842_AccNotMove

    AS

    FUNCTION AccNotMoveJUR)

    p_contragentId zvit.dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number

    IS

    l_Result Number (1);

    l_contragentId zvit.dwh_CR_contragent.ID%TYPE;

    l_dateopen Date;

    Date of l_dtMove1;

    Date of l_dtMove2;

    BEGIN

    l_Result: = 0;

    BEGIN

    Select Distinct a.contragentid

    In l_contragentId

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and a.ACCOUNTSTATEID not in (1,2);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_contragentId: = NULL;

    END;

    IF l_contragentId IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    Select MAX (a.dateopen)

    In l_DateOpen

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and a.ACCOUNTSTATEID <>2

    and a.DateOpen > p_date;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DateOpen: = NULL;

    END;

    IF l_DateOpen IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and not in Substr (d.accountano, 1, 4) ('2608 ', ' 2658');

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and not in Substr (d.accountano, 1, 4) ('2608 ', ' 2658');

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.ACCOUNTAID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2600,2650)

    and d.arcdate > = p_date

    and d.ACCOUNTAID = a.Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    l_Result: = 1;

    On the other

    l_Result: = 0;

    End If;

    END IF;

    END IF;

    RETURN l_Result;

    END AccNotMoveJUR;

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

    FUNCTION AccNotMoveFIZ)

    p_contragentId zvit.dwh_CR_contragent.ID%TYPE,

    p_date Date)

    RETURN number

    IS

    l_Result Number (1);

    l_contragentId zvit.dwh_CR_contragent.ID%TYPE;

    l_dateopen Date;

    Date of l_dtMove1;

    BEGIN

    l_Result: = 0;

    BEGIN

    Select Distinct a.contragentid

    In l_contragentId

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and a.ACCOUNTSTATEID not in (1,2);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_contragentId: = NULL;

    END;

    IF l_contragentId IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    Select MAX (a.dateopen)

    In l_DateOpen

    OF B2_OLAP. DIMAACCOUNT_ALL one

    where a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and a.ACCOUNTSTATEID <>2

    and a.DateOpen > p_date;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DateOpen: = NULL;

    END;

    IF l_DateOpen IS NOT NULL THEN

    l_Result: = 0;

    ON THE OTHER

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.ACCOUNTBID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr(d.accountano,1,4) <>'2628';

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.arcdate > = p_date

    and d.ACCOUNTBID = a.Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr(d.accountano,1,4) <>'2628';

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.ACCOUNTAID = a.Id

    and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    BEGIN

    SELECT MAX (d.arcdate)

    In l_dtMove1

    OF B2_OLAP. DIMAACCOUNT_ALL has,

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE a.contragentid = p_contragentId

    and a.BACCOUNTID in (2620,2625)

    and d.arcdate > = p_date

    and d.ACCOUNTAID = a.Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_dtMove1: = NULL;

    END;

    END IF;

    IF l_dtMove1 IS NULL THEN

    l_Result: = 1;

    On the other

    l_Result: = 0;

    End If;

    END IF;

    END IF;

    RETURN l_Result;

    END AccNotMoveFIZ;

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

    FUNCTION DtLastMove)

    p_Id B2_OLAP. DIMAACCOUNT_ALL.ID%TYPE)

    Date of RETURN

    IS

    l_Result Date;

    Date of l_DtLast1;

    Date of l_DtLast2;

    Date of l_DtLast3;

    Date of l_DtLast4;

    BEGIN

    l_Result: = NULL;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast1

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTBID = p_Id

    - and d.arcdate > = p_date

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr (d.accountano, 1, 4) not in ('2608', ' 2658 ', ' 2628');

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast1: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast2

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTBID = p_Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3)

    and Substr (d.accountano, 1, 4) not in ('2608', ' 2658 ', ' 2628');

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast2: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast3

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTAID = p_Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast3: = NULL;

    END;

    BEGIN

    SELECT MAX (d.arcdate)

    In l_DtLast4

    B2_OLAP.AR_DOCUMENT d,

    B2_OLAP. DIMDOCUMENTTYPE dt

    WHERE d.ACCOUNTAID = p_Id

    and d.DOCUMENTTYPEID = dt.id

    and dt. OPERATIONTYPEBYSUMMAID not to (2,3);

    - and d.DOCUMENTSTATEID = 2

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    l_DtLast4: = NULL;

    END;

    l_DtLast1:=NVL(l_DtLast1,to_date('01.01.1900','dd.mm.yyyy'));

    l_DtLast2:=NVL(l_DtLast2,to_date('01.01.1900','dd.mm.yyyy'));

    l_DtLast3:=NVL(l_DtLast3,to_date('01.01.1900','dd.mm.yyyy'));

    l_DtLast4:=NVL(l_DtLast4,to_date('01.01.1900','dd.mm.yyyy'));

    l_Result: = Greatest (l_DtLast1, l_DtLast2, l_DtLast3, l_DtLast4);

    IF l_Result = TO_DATE('01.01.1900','dd.mm.yyyy') THEN

    l_Result: = NULL;

    END IF;

    RETURN l_Result;

    END DtLastMove;

    ---////////////////////////////////////////////////////

    END;

    /

    You declare your parameter with a different type between the specification and body, your statements must match.

  • PCM - data import and fields defined by the user - model import or the XML API?

    Hello

    I am currently partially by an implementation of the PCM with my business and have created a few user-defined fields in the application companies. I have data from a form on the internet into a CSV file that I want then to eye-ball before loading of PCM.

    I created a copy of the "export contracts report template ' to include these fields defined by the user, but when I try to re - import the data, the user-defined fields are not populated.

    No one knows if the user-defined fields can be updated in PCM, and if so does to do through the functionality of the XML API?

    Kind regards.

    Published by: 914327 on February 14, 2012 03:39

    The simple answer is that the built-in import utility is designed to import a preset list of fields only and will not import your custom fields even if they are added in the import file, and you will need to use the API to import these fields.

    However, there are unsupported methods to import this data directly to the database, or to add custom fields as options available for import. I can tell you more about these methods on the forum offline if you are interested.

  • Defined by the user function in query...

    I have included a function defined by the user in the SQL query that gave rise to the query takes a long time.

    Select col1, col2 (col1, col2) fn_userfunction from table where col1 in (values);

    The function calculate some values based on col1 and col2.

    How this improved query performance?

    Concerning
    Jean-Louis

    Hello

    If it was before including quickly, then you must look at the function for the performance. Maybe you can include the function in the SQL code, which makes it faster. Something else may be to put the function in a subquery:

      select col1, col2, (select fn_userfunction(col1, col2) from dual) xxx from table where col1 in (values);
    

    But you should always try to put at least as possible function in SQL. He created above.

    If the query is too slow without the function, then an index on col1 can help, but depends on the data and distribution.

    If you need help with the feature, you must provide the code for the forum. Then, perhaps we can help.

    Herald tiomela
    http://htendam.WordPress.com

  • Question about the use of subtypes (define a subtype of w / constraint defined by the user)

    Hi guys,.

    I am a newbie to PL/SQL.
    I really appreciate it if save you a little of your time to respond to this message.

    According to paragraph reference 10 g Release 2 (10.2) and Guide the user to the PL/SQL in Oracle® database labeled using subtypes, I found that the constraint of the subtype defined by the user can be overridden when you declare variables.

    Questions:

    1. Why does PL/SQL compel user-defined subtype substitution? Or is this an unexpected bug that exist in PL/SQL?

    2. is it arrive at Oracle subtypes as INTEGER, CHARACTER, etc.. ?

    I have reproduced this problem using the PL/SQL code following against Oracle9i 9.2.0.1, which produced any error or exception whatsoever.

    TO ELIMINATE ANY CONFUSION, THE ISSUE IS HIGHLIGHTED IN BOLD

    -THE SAMPLE CODE TO REPRODUCE THE PROBLEM
    DECLARE
    -a user-defined (Xtype) subtype is defined with a precision and scale force;
    Subtype Xtype IS NUMBER (1.0);
    -However, Xtype is overridden when you declare the variable "var_num".
    Xtype var_num (2,0);
    BEGIN
    var_num: = 10;
    DBMS_OUTPUT. Put_line ('var_num =' |) To_char (var_num));
    EXCEPTION
    WHILE OTHERS THEN
    DBMS_OUTPUT. PUT_LINE ("ERR: ' |") SQLERRM);
    END;
    /

    -HERE IS THE RESULT
    SQL > @D:\LocalWork\dummy.sql
    var_num = 10

    Edited by: HappyJay 05/09/2010 01:48

    Send me on email offline (remove the spaces) damorgan11g @ gmail.com and I will convey that to the person who is just that kind of decision regarding Oracle 12 currently.

  • Function defined by the user in order by?

    Hey guys.  We try our postgres database to Oracle to port, and I fall on this issue.  We have columns called "sortSequences", which are arrays of arbitrarily long integers.  To some fine POC, I use varray(), but that probably won't work as a production application, due to its strongly defined by size.  In any case, the crux of the problem is that I need to be able to select * from foo by sortSequence, where the evaluation order is custom code.  The array of integers represent essentially mathematics of infinite precision and we have a deterministic algorithm to compare, but we can't just produce a value between them (what I think keeps me to use a card member function in a user-defined object type.)  In other words, we don't really care what are the values, we are just using their collectively as an index of sort.  An aggregate function like the right answer, and a simple scalar function is out of the question.  We watched the field index, but it is not clear to me that even if we created an operator related to our type defined by the user that the db would use this function for order by rating...

    Everyone can think of a solution to this problem?  If we must live without this feature, we can reproduce in the application code, but we want to avoid that at all costs...

    Thank you

    Brian

    The array of integers represent essentially mathematics of infinite precision and we have a deterministic algorithm to compare, but we can not simply to produce a value between them (I think preventing me to use a card member function in a user-defined object type.)

    OK, but what about a method of ORDER?

    Since you seem to have the algorithm already, is not just a matter of implementation of the COMMAND method?

    Performance, it is not ideal but it's a start.

    Something along these lines:

    create or replace type array_t is varray (32767) integer;

    /

    create or replace type sort_sequence_t as object)

    v array_t

    member function serialize return varchar2

    , for the integer return order member function match (o sort_sequence_t)

    );

    /

    create or replace type body sort_sequence_t is

    member function serialize return varchar2 is

    RES varchar2 (4000);

    Start

    because me in 1... self.v.Count loop

    If I have 1 > then

    RES: res = | ',';

    end if;

    RES: res = | TO_CHAR (self.v (i));

    end loop;

    return res;

    end;

    order whole return leg (o sort_sequence_t) member function is

    whole v1;

    whole v2;

    Start

    because me in 1... Greatest (self.v.Count, o.v.Count) loop

    If self.v.exists (i) then

    v1: = self.v (i);

    on the other

    v1: = 0;

    end if;

    If o.v.exists (i) then

    V2: = o.v (i);

    on the other

    V2: = 0;

    end if;

    If v1< v2="">

    Returns - 1;

    elsif v1 > v2 then

    Return 1;

    end if;

    end loop;

    return 0;

    end;

    end;

    /

    Tests...

    SQL > with sample_data (id, sort_seq) as)

    2 Select 1, sort_sequence_t (array_t (10,1,1)) of all the double union

    3 select 2, sort_sequence_t (array_t (1,1, -1)) of all the double union

    4 Select 3, sort_sequence_t (array_t (1,1,1)) of all the double union

    5. Select option 4, sort_sequence_t (array_t (1,1,2)) of all the double union

    6 select 5, sort_sequence_t (array_t (1,20,1)) of all the double union

    7. Select 6, sort_sequence_t (array_t (1,7,1)) of double

    8)

    9. Select t.id

    10, t.sort_seq.serialize (as seq_str)

    sample_data 11 t

    12 order by t.sort_seq;

    ID SEQ_STR

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

    2-1,-1, -1

    3 1,1,1

    4 1,1,2

    6 1,7,1

    5 1,20,1

    1 10,1,1

    6 selected lines

    Post edited by: odie_63 - added example

  • Defined by the user exception handling

    Hello

    version Oracle 11.1.0.7

    Question 1:
    I just want to know what is the difference between the methods for using user-defined exceptions.

    Method 1: don't need initialization exception
    create or replace procedure p1
    as
    exc_p1 exception;
    begin
     do something .... 
     -- fails
     Raise exc_p1;
     exception when exc_p1 then
     raise;
     end;
     
    Method 2: use initialization exception
     create or replace procedure p2
     as
    exc_p2 exception;
    prgma exception_init(exc_p2,-20999);
    begin 
    p1;
    exception
    when exc_p2 then 
    raise;
    end;
    Question2

    Please let me know when and where to use these user-defined functions and I read the comments of Tom kyte on the use then than others, then raise or raise_application_error
    exception management. Rather than use the raise or raise_application_error can I use "dbms_output.put_line (dbms_utility.format_error_backtrace); dbms_output.put_line (dbms_utility.format_error_stack)) 'or can I do the exceptions as handler below.
    " when others then 
    raise_application_error(-20001,'error in p1  '||dbms_utility.format_error_backtrace ||dbms_utility.format_error_stack); " 
    Thank you
    Mike

    Mike wrote:
    Hello

    version Oracle 11.1.0.7

    Question 1:
    I just want to know what is the difference between the methods for using user-defined exceptions.

    Method 1: don't need initialization exception

    create or replace procedure p1
    as
    exc_p1 exception;
    begin
    do something ....
    -- fails
    Raise exc_p1;
    exception when exc_p1 then
    raise;
    end;
    

    Method 2: use initialization exception

    create or replace procedure p2
    as
    exc_p2 exception;
    prgma exception_init(exc_p2,-20999);
    begin
    p1;
    exception
    when exc_p2 then
    raise;
    end;
    

    The first method is used when you plan to raise user-defined errors by using the name, and user-defined errors are raised in the procedure you capture them.

    The second method is used when you want to capture a specific error number, it's an error specific oracle (one that has not already been appointed) or a user defined error. In your example procedures, if we show what exceptions occur by putting in the debugging...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure p1 as
      2    exc_p1 exception;
      3  begin
      4    Raise exc_p1;
      5  exception when exc_p1 then
      6    dbms_output.put_line('P1:exc_p1');
      7    raise;
      8* end;
    SQL> /
    
    Procedure created.
    
    SQL>
    SQL> create or replace procedure p2 as
      2    exc_p2 exception;
      3    pragma exception_init(exc_p2,-20999);
      4  begin
      5    p1;
      6  exception
      7    when exc_p2 then
      8      dbms_output.put_line('P2:exc_p2');
      9      raise;
     10    when others then
     11      dbms_output.put_line('Other exception');
     12      raise;
     13  end;
     14  /
    
    Procedure created.
    
    SQL> set serverout on
    SQL> exec p2;
    P1:exc_p1
    Other exception
    BEGIN p2; END;
    
    *
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SCOTT.P2", line 12
    ORA-06512: at line 1
    

    ... we can see that the captured P1 procedure an exception defined by the user by his name, but procedure P2 could only recognize as being a mistake 'OTHERS '.

    But if P1 were to raise a specific error number...

    SQL> create or replace procedure p1 as
      2    exc_p1 exception;
      3  begin
      4    Raise exc_p1;
      5  exception when exc_p1 then
      6    dbms_output.put_line('P1:exc_p1');
      7    raise_application_error(-20999,'Procudure 1 error raised',true);
      8  end;
      9  /
    
    Procedure created.
    
    SQL> exec p2;
    P1:exc_p1
    P2:exc_p2
    BEGIN p2; END;
    
    *
    ERROR at line 1:
    ORA-20999: Procudure 1 error raised
    ORA-06512: at "SCOTT.P1", line 7
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SCOTT.P2", line 9
    ORA-06512: at line 1
    
    SQL>
    

    ... then because P2 is looking for this under his own name of exp_p2 error number, he seized the exception thrown by P1 as is exp_p2 exception.

    Now, just to complete the example...

    SQL> create or replace procedure p1 as
      2    exc_p1 exception;
      3    pragma exception_init(exc_p1,-20999);
      4  begin
      5    Raise exc_p1;
      6  exception when exc_p1 then
      7    dbms_output.put_line('P1:exc_p1');
      8    raise;
      9  end;
     10  /
    
    Procedure created.
    
    SQL> exec p2;
    P1:exc_p1
    P2:exc_p2
    BEGIN p2; END;
    
    *
    ERROR at line 1:
    ORA-20999:
    ORA-06512: at "SCOTT.P2", line 9
    ORA-06512: at line 1
    

    ... P1 has now associated with error number 20999 is exc_p1 exception, when he simply raises this exception is triggered 20999 error number. P2 is unable to capture under the name of exc_p1 because this exception name does exist in the process of P1, but because P2 seeks 20999 under his own name of exc_p2 exception, it manages to capture him.

    So, to summarize, the name of the exception without the pragma is allowed to handle exceptions as part of the same name, but if you need capture outside the scope, you use the pragma to assign a number to it-specific exception.

    Question2

    Please let me know when and where to use these user-defined functions and I read the comments of Tom kyte on the use then than others, then raise or raise_application_error

    User-defined exceptions are used mainly to treat logic errors. The key is the word "handful." If you can handle an exception (i.e. to do something) you should capture it and do what needs doing. If you can't handle it then, you have to trigger it.
    Using a then "than others' exception should be a last resort. In general, you only manage exceptions that you plan to arrive. One then "than others' captures all exceptions that have not already been dealt with. If you have an exception "while others" and you do not throw the exception upward once again, then effectively hide you any errors to get noticed (errors are still happening, but you are not aware of them except for the fact that your "code does not work" or "data is not correct"). The only time you would really use one then "than others' exception would be if you need to connect all the errors in a table, but then after the cut, which should continue to be the exception to the calling code.

    exception management. Rather than use the raise or raise_application_error can I use "dbms_output.put_line (dbms_utility.format_error_backtrace); dbms_output.put_line (dbms_utility.format_error_stack)) 'or can I do the exceptions as handler below.

    " when others then
    raise_application_error(-20001,'error in p1  '||dbms_utility.format_error_backtrace ||dbms_utility.format_error_stack); " 
    

    You should not use dbms_output.put_line, except for the purpose of debugging. To use that assumes that the output of the server is catches or displayed, which, if it is a backend process, it won't. The correct way to error log is a table, or at worst a file on the server.

    If you need generate an application error and you want to keep the stack error, you just need the third parameter set to TRUE.

    raise_application_error({errornumber},{message},true);
    
  • Change the frequency of Notification metric defined by the user

    Hello
    I'm trying to define a metric defined by the user in the enterprise grid control manager to warn me of the failure in the execution of scheduled tasks.
    My script to check the execution of scheduled tasks returns something like this and it runs every two hours:

    em_result = 2
    em_message = 2 tasks by mistake ("Task1" "Task3")

    So the first time the triggered alert, he sent me an email in critical condition with my em_message.

    But two hours later the next audit is not sending me any warning because the result is always critical, as this is my first problem!
    And if the message has been changed for example:

    em_result = 2
    em_message = 1 task (s) on error ("Task1")

    I don't see anywhere the new updated message, the alert history is not updated, it's my second problem.

    Kind regards
    PierreL

    The settings do not work properly. If the metric terms, the alert is triggered. When the condition is no longer fulfilled, the metric fades.

    You are the first problem can be solved by repeating notifications, available from 10.2.0.4 but attention is a global setting so it will affect all of the metric.

    The second issue is probably related to the first, the error is not compensation.

    If it is a measure for the work failed for the oracle Scheduler, you can adjust your request to check only the work done in the last 15 minutes and run the metric every 15 minutes... that means if you get a job at 09:00 but failure is working okay at 10:00, your metrics will draw 9ish, but be deleted by 9.15ish.

    If the task failed then at 11:00, you will get a new alert.

  • Functions defined by the user with several parameters

    I set features three following user using "Define."

    UF1 takes a single patameter;

    UF2 takes two parameters;

    and UFX takes two parameters - with the second is 'X' in the definition.

    Œuvres F1.  F2 is the EVAL of F1 version and it works too.  User functions only seem to work fine.

    F3, a function of two user settings, produces a graph of NaN.

    F4 is the EVAL of F3 version.  Note that 'B 'is not replaced by 1'.  Also produces a NaN chart.

    F5 produces a graph of NaN.

    F6 is EVAL of F5.  The 'X' is not replaced (even with the ' B' above), and even if it looks like 'X * X', it also produces a graph of NaN.

    Is it possible to get defined by the user, with several parameters, features work by tracing the curve?

    Hi!, Fortin:

    If you download and install the ultimate Firmware with the version of the software: 2015 6 17 (8151), with the number of Version: 1.1.2 - 11, you can trace your examples of definition of the function, with curves and values, without NaN.

  • Alarming - alarms defined by the user not appearing is not in history

    Hello

    I use the DSC module to create alarms.  I can successfully configure an alarm for a shared variable.  I use the alarms.vi of reading to read the current alarms.   I am able to recognize and to disappear which removes them from the list.  I also see a history of them when using the "alarm and event Query.vi.  Now, I do the same with user-defined alarms.  I have created alarm using the "user defined Alarm.vi value.  The alarm are displayed in the list (read alarms.vi).  I can acknowledge the alarm and it disappears from the list.  Now when I use the 'alarm & Query.vi' the user defined alarm does not appear in the list.  Only shared variable alarms are displayed.  Is this correct?  Is there a good example of what I'm doing?  The example of "User defined DSC alarms Demo.vi" does not give an example of reading historical alarms defined by the user of the database.

    Thank you

    Matt

    I removed the DSC module and re-installed which includes SQL Server.  That did the trick.

    Thanks for your help Caleb

  • How can I score points defined by the user in amplitude / frequency diagram?

    I have a table of frequencies and amplitudes. I need these values to display frequency values on the x axis and axis is amplitude. a default fixed parcel must be constantly visible in the graph, and then I want to score a few points defined by the user in the same graph, save these two plots in the same graph and then make a mark on the chart.

    Help kindly it's about my master of engineering project where I am trying to biuld an audiometer (to test hearing sensitivity) and I'll interface with microcontroller ardiuno labview and my hardware devices.

    so kindly help.

    Thank you.

    rich

    The points defined by the user might just be another plot.  You can add annotations to a conspiracy, but it's a lot of work.

  • Display multiple lines of data collection defined by the user in an e-mail message

    I created a collection defined by the user that displays several lines of data. I created a custom rule and have linked this collection set by the user to this rule and configure an e-mail action. Variable Seveity, I have defined it in the rule to contain the column values. But it will only contain the first line of data. How can I display multiple lines of data in the alarm itself as well as the e-mail? Any help is appreciated.

    The example query in the collection defined by the user is less;

    Select the type, status, queuename, count (*) from PSAPMSGPUBHDR

    Union

    Select the type, status, queuename, count (*) from PSAPMSGPUBCON

    Union

    Select the type, status, queuename, count (*) from PSAPMSGSUBCON

    Result:

    Number of status type Queuename

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

    HDR profil_utilisateur error 1

    PUB                  PERSON_BASIC                    New                                 4

    PUB WORKFORCE_SYNC error 1

    -3 rows

    I have defined the variables of gravity and the alarm message is something like this; (It is fetching only the first row of data) how do I loop through to get all the rows of data and display it in the message of alarm/email (alert) action must be written of the groovy script code to achieve this goal? If Yes can you please provide me examples?

    Alarm message:

    "Request message queue is:

    Type: @UDC_type

    QueueName: @UDC_queuename

    Status: @UDC_status

    County: @UDC_count

    Thanks in advance

    JAI

    Hi Jay,.

    fine I could help you. Please mark the thread as "Answered" when the issue has been resolved and do not hesitate to open a new thread for questions.

    Concerning

    Jochen

  • I can save is no longer shades defined by the user.

    It's something I've done many times:

    -create objects with the fill color > select > add the color group to illustration selected in the swatches Panel > click the menu library swatch in the swatches Panel and select "Save the nuances" in the drop-

    This would normally take me to the exact location where I need to record a sample, defined by the user - something like: (user defined) / Library/Application Support/Adobe/Adobe Illustrator (version) /(defined language)/samples. I can see this site for a fraction of a second, before the file browser window switches back me on the directory of the user. The library is open is no longer in this dialog box.

    I run two versions of Illustrator - CC and CS5 and oddly, it is the case in both, so I think the problem is Adobe - of - rights of library. I use a Mac, running OS X Yosemite 10.10.5.

    To be clear, I did several times in the past and it worked. And I tried to restart the computer.

    Any help/advice are welcome

    OK, I solved the problem by chance, and I'll leave the solution here if someone has the same problem.

    Namely, my Finder browser "save the file" has been on "Sort by date", and this mode will not access library. I went to "sort by name", and the library with user-defined shades reappeared. (Do not know what is the logic of this, but there you go).

    -Ana

  • Sharing Variables defined by the user through projects

    Hello

    I wonder if it is possible to share Variables defined by the user between projects. What I have in mind, is that I would like to have my user defined Variables configured in a central location and then insert them into my projects as variables bound so that they update automatically when I change their values. For example, I define a variable named ProductVersion , that has the value 9. Then I insert this variable in all my projects as a bound variable. After 2 months the product version changes was 10, so I change the value of the variable at 10 to the place where it is stored and it is automatically updated in all projects. Is it possible somehow? I'm new to RoboHelp and I find no answer. I tried the solution for a while using the product on the Internet without success. I even contacted Adobe Support and they redirect me to this forum I used help and manual before and how they deal with user variables was quite simple.

    Hello

    Unfortunately RoboHelp does not offer a way to let this, at least, is not directly.

    However, I think I found a way to get there, the variables are stored in a file named rhvariable.apj. So what you could do is to add this file as a file of luggage to each of your projects that will share variables.

    Now, you would create a shared location, but also a new category in your resource manager. This will create a common location to store the file apj.

    Add the file of baggage to the location. Repeat for all the projects that share variables.

    Now, when the variable is changed in any of the project participants, it should be to update the shared location and you can achieve the goal.

    Note, however, that although you'll get what you want, it will be always open each of the participating projects, synchronize the APJ file and generate the output in order to to refresh all. No way, I am aware of escape that.

    Cheers, Rick

Maybe you are looking for

  • Changing the configuration of network domestic

    I use an Apple Time Capsule as a router with no problems until now. The current configuration is essentially: Cable modem | Time Capsule |         \ |         Wireless | Hard line CAT 5 of various devices We'll be moving soon however, and I want over

  • How to connect a TM backup after clean install, different user name

    I did a clean install of Mac OS X of El Capitan. The username for the admin account is different than the original. Therefore, Time Machine does not recognize my old backup and threatens to erase it and start again on this disc. So I disabled the TM

  • Lost my connection between all my apples

    The other day (Monday I think) my MacBook Pro said there a someone tried to get into my account from another computer and if I saw it I should ignore it, but if I don't I should change my password. I know that I do not share my password with someone

  • No audio Realtek for my Entertainment Center

    Hello and thanks for reading, I recently bought a hp pavilion elite m9515f desktop PC (less then a week ago) with vista operating system.  the sound for my computer speakers works fine, but when I try to play sounds on my Entertainment Center I get n

  • Favorite Windows XP adds each site visited to the Favorites list

    An old friend recently swithced to an old computer running XP on a new computer running Windows 7.  I did a wireless transfer from his old computer to their new computer for him and everything went well.  However, he was unable to understand the nove