Atomic null violation

Hi all,
In which case the following error message can occur.
What is the problem in this Update statement.Please expertise.
SQL> UPDATE SA_CUSTOMER_ADDL_ADDRESS_DTLS A
2      SET A.CAA_ADDRESS_INFO.COLUMN6_L = 1
3 WHERE A.CAA_ADDRESS_TYPE_CODE = 2
4 /
SET A.CAA_ADDRESS_INFO.COLUMN6_L = 1
ERROR at line 2:
ORA-02309: atomic NULL violation

row is having null value. check for it.

Similar Messages

  • ORA_02309 Atomic NULL violation

    Hi all,
    When I try to update the folowing i get an error message:
    update adressen_geom T
    set T.coordgeocodepoint.sdo_srid=90112;
    Now error ORA_02309 occurs.
    So if i choose to name the objecttype like somerwhere else in this forum and write it like this:
    update adressen_geom T
    set T.coordgeocodepoint.sdo_srid=mdsys.sdo_geometry(90112);
    it says ora00932 inconsistent datatypes: expected number got mdsys.sdo_geometry
    Now i don´t understand it anymore please help

    Have never used spatial, but the error simply means that you're attempting to reference a property of an object, where the object does not yet exist (has not yet been instantiated).
    When inserting the object, you need to instantiated it - even if the properties are null. The following code demonstrates the error and the correction.
    SQL> create or replace type TTestObject is object
      2  (
      3          n       number,
      4          s       varchar2(4000)
      5  );
      6  /
    Type created.
    SQL> create table test_objects
      2  (
      3          id      number,
      4          obj     TTestObject
      5  )
      6  /
    Table created.
    SQL> insert into test_objects values (1, null );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select * from test_objects;
            ID   OBJ(N, S)
             1
    SQL> update     test_objects t
      2  set        t.obj.n = 123
      3  where      t.id = 1;
    set     t.obj.n = 123
    ERROR at line 2:
    ORA-02309: atomic NULL violation
    SQL> insert into test_objects values( 2, TTestObject(null,null) );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select * from test_objects;
            ID   OBJ(N, S)
             1
             2  TTESTOBJECT(NULL, NULL)
    SQL> update     test_objects t
      2  set        t.obj.n = 123,
      3          t.obj.s = 'Test'
      4  where      t.id = 2;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select * from test_objects;
            ID   OBJ(N, S)
             1
             2  TTESTOBJECT(123, 'Test')
    SQL>If this is unclear, please say so and I will add more detail and explanation to this example.

  • Ora 2309 - atomic NULL violation on SRID update

    Hi all,
    I'm trying to update an SRID value for a layer using:
    Update COUNTRY c set c.SHAPE.SDO_SRID = 8307;
    I get the following error :
    Error:     ORA 2309
    Text:     atomic NULL violation
    The value of SRID is NULL. Why this doesn't work for COUNTRY ? (and works for another table!)
    Thanks.
    Francois

    Hi,
    You probably have a country with a NULL geometry.
    To make the update work, use this SQL:
    Update COUNTRY c set c.SHAPE.SDO_SRID = 8307
    where c.shape is not null;
    siva

  • Geometry SRID update error

    I am getting "Ora-02309" atomic null violation on updating SRID below.
    Update my_Table C
    set C.Geometry.SDO_SRID=2958;
    It has null/no value of SRID in Geometry.
    some people say to "Initiating your object before you access it" but I am not sure how to di it.
    Thanks
    Nancy.

    Please validate you geometries using VALIDATE_GEOMETRY_WITH_CONTEXT. If you have invalid geometries fix it before update the SRID. Is there a spatial index on the geometry column? If yes here are the steps to perfom the update:
    1. Fix invalid or null geometries
    2. drop the spatial index
    3. update user_sdo_geom_metadata (SRID)
    4. update geometry srid
    5. create spatial index
    Arnd

  • Very Urgent !!!! Object problem while importing

    Dear Brainy Guys,
    I am facing a very severe problem that really hault my process of Backup and Restore. In our database there are tables which are created with the object type with default null values. for example
    CREATE TABLE XYZ
    ( COL1 NUMBER(1),
    OB_COL OB_TYPE DEFAULT OB_TYPE(NULL,NULL,NULL)
    Now the problem is when i import table data from other user, let suppose (user2 )nto the user (user1) , it give me error that user2.ob_type does not exist. as we know that whenever the object is created it store with the schema name as a reference to it. like (USER2.OB_TYPE).
    Now i am stuck up at this end, how to resolve this problem.
    Regards

    Dear Steve,
    I am rellay sorry for being late, I must thank you for your kind effort to solve my problem.
    Coming to the problem, actually we have 2 seperate databases with 2 different name USERS, let
    suppose KHI for client and HO for Head office user.
    I have table "CITY" both in both users.
    Create Table City
    ( ia varchar2(3),
    Description Varchar2(100),
    SEC_OBJ OBJ_TYPE DEFAULT OBJ_TYPE (SYSDATE,NULL,NULL,NULL)
    The table city has an object which stores security info. for each table. Now the problem is we
    have created every table with the default clause for every object Tupe definition, just to avoid
    atomic NULL violation. As u know every object stored in the schema contains the schema name as a
    refernce to it. So when i take export of KHI user , internally it defines the default clause with
    the schema name.
    following is the internal representation.
    " SEC_OBJ OBJ_TYPE DEFAULT KHI.OBJ_TYPE (SYSDATE,NULL,NULL,NULL) "
    Now when i try to import this table on HO user, it gives me error that KHI.OBJ_TYPE does not
    exists. I have user toid_novalidate clause too, but no gain.
    I think you will surely understand the problem.
    Regards

  • Are NULL Geometries allowed?

    Hi
    I know that: You should not have invalid geometries because there is no way to predict exactly what will not work when you have invalid geometries.
    What's about NULL geometries. VALIDATE_GEOMETRY just returns NULL. Is it allowed to have NULL in a spatial layer of Table?
    Philipp

    Hi,
    NULL geometries are allowed. You should set the geometry column to atomic NULL, i.e.
    create table foo (bar number, geom mdsys.sdo_geometry);
    insert into foo values (1,NULL);

  • Creating view to get first row for each table !!

    I am having tables(more than 10) which are related using foreign key and primary key relationship.
    Example:
    Table1:
    T1Prim T1Col1 T1Col2
    Table2
    T2For T2Prim T2Col1 T2Col2 T2Col3
    (here T2For will have value same as T1Prim and in my design it has same column name i.e. T1Prim)
    Table3
    T3For T3Prim T3Col1 T3Col2 T3Col3
    (here T3For will have value same as T2Prim)
    and so on.
    The data in the tables is like For table1 there will be one record, for table2 there will be one record and for table 3 there are more than one records.
    Can i view either the first record for each of them or all records from each of them by writing the following view.
    I have written a view like this:
    Create or replace view test (T1Prim,T1Col1, T1Col2,T2Prim,T2Col1 T2Col2, T2Col3, T3Prim,T3Col1, T3Col2, T3Col3)
    As
    Select
    Table1.T1Prim,
    Table1.T1Col1,
    Table1.T1Col2,
    Table2.T2Prim,
    Table2.T2Col1,
    Table2.T2Col2,
    Table2.T2Col3,
    Table3.T3Prim,
    Table3.T3Col1,
    Table3.T3Col2,
    Table3.T3Col3
    From
    Table1,
    Table2,
    Table3
    where
    Table1.Prim = Table2.For
    and Table2.Prim = Table3.For
    When i ran the select statement on the view I am not getting any data. Whereas there is data when select is ran on individual table.
    Can someone please tell me where i am goofing.
    Thanks in the anticipation that i will get some hint to solve this.
    Eagerly waiting for reply.
    Thanks !!

    I mean use a collection :
    Collection Methods
    A collection method is a built-in function or procedure that operates on collections and is called using dot notation. The methods EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, NEXT, EXTEND, TRIM, and DELETE help generalize code, make collections easier to use, and make your applications easier to maintain.
    EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, and NEXT are functions, which appear as part of an expression. EXTEND, TRIM, and DELETE are procedures, which appear as a statement. EXISTS, PRIOR, NEXT, TRIM, EXTEND, and DELETE take integer parameters. EXISTS, PRIOR, NEXT, and DELETE can also take VARCHAR2 parameters for associative arrays with string keys. EXTEND and TRIM cannot be used with index-by tables.
    For more information, see "Using Collection Methods".
    Syntax
    Text description of the illustration collection_method_call.gif
    Keyword and Parameter Description
    collection_name
    This identifies an index-by table, nested table, or varray previously declared within the current scope.
    COUNT
    COUNT returns the number of elements that a collection currently contains, which is useful because the current size of a collection is not always known. You can use COUNT wherever an integer expression is allowed.
    For varrays, COUNT always equals LAST. For nested tables, normally, COUNT equals LAST. But, if you delete elements from the middle of a nested table, COUNT is smaller than LAST.
    DELETE
    This procedure has three forms. DELETE removes all elements from a collection. DELETE(n) removes the nth element from an index-by table or nested table. If n is null, DELETE(n) does nothing. DELETE(m,n) removes all elements in the range m..n from an index-by table or nested table. If m is larger than n or if m or n is null, DELETE(m,n) does nothing.
    EXISTS
    EXISTS(n) returns TRUE if the nth element in a collection exists. Otherwise, EXISTS(n) returns FALSE. Mainly, you use EXISTS with DELETE to maintain sparse nested tables. You can also use EXISTS to avoid raising an exception when you reference a nonexistent element. When passed an out-of-range subscript, EXISTS returns FALSE instead of raising SUBSCRIPT_OUTSIDE_LIMIT.
    EXTEND
    This procedure has three forms. EXTEND appends one null element to a collection. EXTEND(n) appends n null elements to a collection. EXTEND(n,i) appends n copies of the ith element to a collection. EXTEND operates on the internal size of a collection. So, if EXTEND encounters deleted elements, it includes them in its tally. You cannot use EXTEND with index-by tables.
    FIRST, LAST
    FIRST and LAST return the first and last (smallest and largest) subscript values in a collection. The subscript values are usually integers, but can also be strings for associative arrays. If the collection is empty, FIRST and LAST return NULL. If the collection contains only one element, FIRST and LAST return the same subscript value.
    For varrays, FIRST always returns 1 and LAST always equals COUNT. For nested tables, normally, LAST equals COUNT. But, if you delete elements from the middle of a nested table, LAST is larger than COUNT.
    index
    This is an expression that must yield (or convert implicitly to) an integer in most cases, or a string for an associative array declared with string keys.
    LIMIT
    For nested tables, which have no maximum size, LIMIT returns NULL. For varrays, LIMIT returns the maximum number of elements that a varray can contain (which you must specify in its type definition).
    NEXT, PRIOR
    PRIOR(n) returns the subscript that precedes index n in a collection. NEXT(n) returns the subscript that succeeds index n. If n has no predecessor, PRIOR(n) returns NULL. Likewise, if n has no successor, NEXT(n) returns NULL.
    TRIM
    This procedure has two forms. TRIM removes one element from the end of a collection. TRIM(n) removes n elements from the end of a collection. If n is greater than COUNT, TRIM(n) raises SUBSCRIPT_BEYOND_COUNT. You cannot use TRIM with index-by tables.
    TRIM operates on the internal size of a collection. So, if TRIM encounters deleted elements, it includes them in its tally.
    Usage Notes
    You cannot use collection methods in a SQL statement. If you try, you get a compilation error.
    Only EXISTS can be applied to atomically null collections. If you apply another method to such collections, PL/SQL raises COLLECTION_IS_NULL.
    You can use PRIOR or NEXT to traverse collections indexed by any series of subscripts. For example, you can use PRIOR or NEXT to traverse a nested table from which some elements have been deleted.
    EXTEND operates on the internal size of a collection, which includes deleted elements. You cannot use EXTEND to initialize an atomically null collection. Also, if you impose the NOT NULL constraint on a TABLE or VARRAY type, you cannot apply the first two forms of EXTEND to collections of that type.
    If an element to be deleted does not exist, DELETE simply skips it; no exception is raised. Varrays are dense, so you cannot delete their individual elements.
    PL/SQL keeps placeholders for deleted elements. So, you can replace a deleted element simply by assigning it a new value. However, PL/SQL does not keep placeholders for trimmed elements.
    The amount of memory allocated to a nested table can increase or decrease dynamically. As you delete elements, memory is freed page by page. If you delete the entire table, all the memory is freed.
    In general, do not depend on the interaction between TRIM and DELETE. It is better to treat nested tables like fixed-size arrays and use only DELETE, or to treat them like stacks and use only TRIM and EXTEND.
    Within a subprogram, a collection parameter assumes the properties of the argument bound to it. So, you can apply methods FIRST, LAST, COUNT, and so on to such parameters. For varray parameters, the value of LIMIT is always derived from the parameter type definition, regardless of the parameter mode.
    Examples
    In the following example, you use NEXT to traverse a nested table from which some elements have been deleted:
    i := courses.FIRST; -- get subscript of first element
    WHILE i IS NOT NULL LOOP
    -- do something with courses(i)
    i := courses.NEXT(i); -- get subscript of next element
    END LOOP;
    In the following example, PL/SQL executes the assignment statement only if element i exists:
    IF courses.EXISTS(i) THEN
    courses(i) := new_course;
    END IF;
    The next example shows that you can use FIRST and LAST to specify the lower and upper bounds of a loop range provided each element in that range exists:
    FOR i IN courses.FIRST..courses.LAST LOOP ...
    In the following example, you delete elements 2 through 5 from a nested table:
    courses.DELETE(2, 5);
    In the final example, you use LIMIT to determine if you can add 20 more elements to varray projects:
    IF (projects.COUNT + 20) < projects.LIMIT THEN
    -- add 20 more elements
    Related Topics
    Collections, Functions, Procedures
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/13_elems7.htm#33054
    Joel P�rez

  • Lifetime of Object in the Object Cache on selects

    On inserting an object (corresponding to user-defined SQL type), I can use a stack-allocated struct for the object and its indicator structure, and pass these addresses to OCIBindObject.
    But on selecting an object (by value, not ref), the doc says one must let the OCI runtime allocate the object struct and its indicator struct in the Object Cache, and call OCIObjectFree when done with the object. But it's unclear whether one needs to free the object for each row of the result set processed, or only once all rows have been processed.
    By looking at the cache-allocated addresses of the object/indicator structs, it looks like the same "instance" in the cache is re-used for every row (addresses remain the same for every row). This tends to indicate the same object is reused, as opposed to a new one being allocated. I added a single OCIObjectFree after processing all rows, and things look OK... (read no crash, no complain/error from OCI).
    But I feel a little uneasy about this, because unlike in my case, when the object has secondary allocations associated to it (because the type contains strings, collections, or other objects members), if somehow I need to OCIObjectFree for each row, and I don't, then I'm leaking all the secondary storage from previous instances of the object.
    Can someone please shed some light on the subject? I find the OCI doc often a little sketchy on these very important lifetime issues. I'd appreciate some advice from someone with Object-Relational aspects of OCI.
    Thanks, --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    when I have to select objects by value :
    * I let oci allocate objects in the object fetch arrayI don't think we have a choice here in fact. At least the way I interpret the doc.
    * I have different addresses for every entry in the array after the fetchBut even an array fetch is done is a loop. You fetch 10 rows at a time, and you get say 25, so you have 3 iterations / fetches.
    Of course the 10 object entries of a given fetch are different, but is the address of the 6th object the same in the first, second, and third fetch?
    * I call OCIObjectFree() for every entry of the
    array.If I have retreived object based attributes
    from the object, i call OCIObjectFree() on the
    object attributes recursively.To made it easier to understand my question, please find below the pseudo-code of what I'm doing (all error checking and most boiler plate arguments OCI requires are omitted, to concentrate on the control flow and the calls made)
    create type point_typ as object (
      x binary_float, y binary_float, z binary_float
    create table point_typ_tab (
      id number, point point_typ
    struct point_typ { // C-struct matching SQL User Type
        float x, y, z;
    struct point_ind { // indicator structure for point_typ
        OCIInd self, x, y, z;
    static void select_objects() {
        Environment env(OCI_OBJECT);
        env.connect(zusername, zpassword, zdatabase);
        OCIHandleAlloc(OCI_HTYPE_STMT);
        OCIStmtPrepare("SELECT id, point FROM point_typ_tab");
        ub4 id = 0; OCIDefine* define_id = 0;
        OCIDefineByPos(&define_id, 1, &id, sizeof(id), SQLT_UIN);
        OCIDefine* define_pt = 0;
        OCIDefineByPos(&define_pt, 2, 0, sizeof(point_typ), SQLT_NTY)
        OCIType* point_typ_tdo = 0;
        OCITypeByName("POINT_TYP", OCI_DURATION_SESSION,
            OCI_TYPEGET_ALL, &point_typ_tdo);
        point_typ* p_pt = 0;     ub4 pt_size = 0;
        point_ind* p_pt_ind = 0; ub4 pt_ind_size = (ub4)sizeof(point_ind);
        OCIDefineObject(define_pt, point_typ_tdo,
            (void**)&p_pt, &pt_size, (void**)&p_pt_ind, &pt_ind_size);
        sword rc = OCIStmtExecute(0/*row*/);
        while (OCIStmtFetch2((ub4)1/*row*/, OCI_FETCH_NEXT) has data) {
            if (p_pt_ind->self == OCI_IND_NOTNULL) {
                // Use p_pt. Value of p_pt same for all iteration
        OCIObjectFree(p_pt);
        OCIHandleFree(OCI_HTYPE_STMT);
    }As you can see, I do a single OCIObjectFree after the loop, and as mentioned previously, p_pt's value (a point_typ address) remains identical during the iteration, but the values in that memory chunk do change to reflect the various point instances (so each point instance overlays the previous one).
    Are you saying I should be calling OCIObjectFree(p_pt); inside the loop itself?
    And if so, should I call OCIObjectFree(p_pt); even if the indicator tells me the point is atomically null?
    That what I do in OCILIB, and it doesn't seem to leak.Reading your post, I'm unsure you free of points in the array after the loop, or inside the loop. I hope the pseudo-code I posted above help to clarify my question.
    BTW, OCCI is just a wrapper around OCI. Because OCCI
    first releases were buggy (it's getting better) and
    just few compilers (and compilers versions) are
    supported, OCI remains a portable and workable
    solution for dealing with Oracle ObjectsAs I wrote in a separate reply in this thread, I also agree OCI is the way to go, for various reasons.
    Thanks for the post. I'd appreciate if you could confirm or not whether what I'm doing is consistent with what you are doing in OCILIB, now that I'm hopefully made my question clearer.
    Thanks, --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Passing array as input to procedure

    Hi,
           create or replace type t_employee_id is table of number;
          create or replace type t_employee_name  is table of varchar2(4000);
    I have created type for array input.
    declare
      p_id t_employee_id;
      p_name t_employee_name;
    begin
       p_id(1):=12;
      p_name(1):='no22';
    p_id(2):=300;
    p_name(2):='XXX';
    p_id(3):=4;
    p_name(3):='bn';
      sp_sample(p_id => p_id,
                p_name => p_name);
    end;
    CREATE OR REPLACE PROCEDURE sp_sample(p_id   IN t_employee_id,
                                          p_name IN t_employee_name) IS
      v_error EXCEPTION;
      PRAGMA EXCEPTION_INIT(v_error, -23456);
    BEGIN
      FORALL i IN 1 .. p_id.COUNT SAVE EXCEPTIONS
        INSERT INTO employee
          (employee_id, employee_name)
        VALUES
          (p_id(i), p_name(i));
      COMMIT;
    EXCEPTION
      WHEN v_error THEN
        FOR i IN 1 .. SQL%BULK_EXCEPTIONS.COUNT LOOP
          dbms_output.put_line('Error:' || SQL%BULK_EXCEPTIONS(i)
                               .ERROR_INDEX || 'Message' ||
                               SQLERRM(-sql%BULK_EXCEPTIONS(i).ERROR_CODE));
          dbms_output.put_line('\n');
        END LOOP;
    END sp_sample;By compling the above code I getting error like this
    ORA-06531-Reference to uninitialized collection.
    Thanks in advance.

    ... and The Holly Book of All PL/SQL Programmers (also known as: Oracle® Database PL/SQL Language Reference) says:
    Collection Initialization
    Until you initialize it, a nested table or varray is atomically null; the collection itself is null, not its elements. To initialize a nested table or varray, you use a constructor, a system-defined function with the same name as the collection type. This function constructs collections from the elements passed to it.
    You must explicitly call a constructor for each varray and nested table variable. Associative arrays, the third kind of collection, do not use constructors. Constructor calls are allowed wherever function calls are allowed.
    Example 5-10 initializes a nested table using a constructor, which looks like a function with the same name as the collection type.
    Example 5-10 Constructor for a Nested Table
    DECLARE
    TYPE dnames_tab IS TABLE OF VARCHAR2(30);
    dept_names dnames_tab;
    BEGIN
    dept_names := dnames_tab('Shipping','Sales','Finance','Payroll');
    END;
    Because a nested table does not have a declared size, you can put as many elements in the constructor as necessary.------------------------------------------------------------------------------------------------------------------------------
    It's very abstract and not intuitive but there is a difference between 'the collection is NULL (not initialized)' and 'the collection that is not NULL (initialized), but it has no elements' and 'the collection that has all elements NULL'. If you declare a variable of VARCHAR2(30) datatype then Oracle will allocate memory for this variable. However if you have a variable of a collection type then simply declaring it is not enough - you have to call a constructor so Oracle can allocate memory for this variable before it's first use.
    So you can have:
    declare
      p_id t_employee_id := t_employee_id();
      p_name t_employee_name := t_employee_name();
    begin
       p_id(1):=12;
      p_name(1):='no22';
    p_id(2):=300;
    p_name(2):='XXX';
    p_id(3):=4;
    p_name(3):='bn';
      sp_sample(p_id => p_id,
                p_name => p_name);
    end;or simply
    declare
      p_id t_employee_id := t_employee_id (12, 300, 4);
      p_name t_employee_name := t_employee_name ('no22', 'XXX', 'bn') ;
    begin
      sp_sample(p_id => p_id,
                p_name => p_name);
    end;

  • Reimporting exported XML using DOM

    Hi,
    I'm trying to set up an import/export for a data structure, 'SimpleNode' created by a JavaCC parser for classical propositional logic.
    SimpleNode implements Node, and have the following attributes
    protected SimpleNode parent;
    protected SimpleNode[] children;
    protected int id;
    protected LogicParser parser;
    protected String label;
    ...So nothing too special there.
    A simple representation of the sentence
    a OR (b AND c) IMPLIES NOT(D)
    "a | (b & c) => !d"
    Is represented as a tree with in the following manner
    Root
    Imp
      Or
       Atom a
       And
        Atom b
        Atom c
      Not
       Atom dWhich is all fine.
    I've written something to export to an XML structure which gives the following output for the above sentence
    <IMPLIES>
      <NOT>
        <TRUE/>
      </NOT>
      <IMPLIES>
        <OR>
          <ATOM>a</ATOM>
          <ATOM>b</ATOM>
        </OR>
        <NOT>
          <ATOM>c</ATOM>
        </NOT>
      </IMPLIES>
    </IMPLIES>Which again, seems fine.
    The problem is then when I'm trying to reimport the XML and create a SimpleNode from it.
    Using the following code
         public static void main(String[] args) {
              // if (args.length <= 0) {
              // System.out.println("Usage: java DOMCommentReader URL");
              // return;
              String url = "propLogic.xml";
              try {
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder parser = factory.newDocumentBuilder();
                   // Check for the traversal module
                   DOMImplementation impl = parser.getDOMImplementation();
                   if (!impl.hasFeature("traversal", "2.0")) {
                        System.out.println("A DOM implementation that supports traversal is required.");
                        return;
                   // Read the document
                   Document doc = parser.parse(url);
                   // Create the TreeWalker
                   DocumentTraversal traversable = (DocumentTraversal) doc;
                   // Taken from
                   // http://www.oreilly.com/catalog/jenut2/chapter/ch19.html
                   NodeFilter filter = new NodeFilter() {
                        public short acceptNode(Node n) {
                             if (n.getNodeType() == Node.TEXT_NODE) {
                                  // Use trim() to strip off leading and trailing space.
                                  // If nothing is left, then reject the node
                                  if (((Text) n).getData().trim().length() == 0)
                                       return NodeFilter.FILTER_REJECT;
                                  // if (n.getParentNode().getNodeName() != "ATOM")
                                  // return NodeFilter.FILTER_REJECT;
                             return NodeFilter.FILTER_ACCEPT;
                   int whatToShow = (NodeFilter.SHOW_ELEMENT + NodeFilter.SHOW_TEXT);
                   TreeWalker iterator = traversable.createTreeWalker(doc, whatToShow, filter, true);
                   printElements(iterator, 0);
              } catch (SAXException e) {
                   System.out.println(e);
                   System.out.println(url + " is not well-formed.");
              } catch (IOException e) {
                   System.out.println("Due to an IOException, the parser could not check " + url);
              } catch (FactoryConfigurationError e) {
                   System.out.println("Could not locate a factory class");
              } catch (ParserConfigurationException e) {
                   System.out.println("Could not locate a JAXP parser");
         public static void printElements(TreeWalker iterator, int depth) {
              Node n = iterator.getCurrentNode();
              n.normalize();
              String indent = new String();
              for (int i = 0; i < depth; i++) {
                   indent += "  ";
              depth++;
              System.out.print(indent + n.getNodeName() + " " + n.getNodeValue());
    //          if (n.getParentNode() != null)
    //               System.out.print(" (parent is " + n.getParentNode().getNodeName() + ")");
              System.out.println();
              for (Node child = iterator.firstChild(); child != null; child = iterator.nextSibling()) {
                   printElements(iterator, depth);
              iterator.setCurrentNode(n);
         }I can get a correct looking representation of the structure
    #document null
      IMPLIES null
        NOT null
          TRUE null
        IMPLIES null
          OR null
            ATOM null
              #text a
            ATOM null
              #text b
          NOT null
            ATOM null
              #text cBut I'm having trouble using the Iterator to create SimpleNodes from the Nodes
    All a SimpleNode needs is a type (an integer representing whether the operator is AND, OR, NOT, IMPLIES etc)
    and a label, which can be null or in the case of an ATOM will have the atom name, "a", "b", "c" etc.
    A SimpleNode is easily created with the constructor
    SimpleNode foo = new SimpleNode(type);
    foo.setLabel("a");
    and adding a child by
    foo.jjtAddChild(SimpleNode n, int i)
    where i is the number of the child.
    Hopefully I've not rambled too much and it makes sense.
    If anyone can give me any pointers or some code/pseudocode to pick through then it'd be much appreciated.
    Duncan

    No bother, tweaked the printElements to fix.

  • Keys in GeneratorText.properties not used !!!

    hi all,
    I found in GeneratorText.properties some keys ignored and are not used in the generation process like: NOT_NULL_VIOLATION, CHECK_CONSTRAINT_VIOLATION
    How can I generate these keys in the *.properties files to translate error messages?
    yours,
    Bassam

    Bassam,
    The CHECK_CONSTRAINT_VIOLATION and NOT_NULL_VIOLATION are a left over from older JHeadstart version that also supported TopLink,and are no longer used.
    To get user-friendly error message for your check constraints, just make sure they are included in the entity object XML.
    Not null violations can easily be handle inside ADF Business Components by making an attribute required.
    Steven Davelaar,
    JHeadstart Team.

  • Working with Record Types

    Hi! I need to work with a Record Type in one of my functions.
    I have two questions:
    1) In my error handler, how do I return an empty record type
    and
    2) In the calling procedure, how do I evaluate whether or not my record type contains values.
    Any help is greatly appreciated.
    Thanks!
    ~Christine

    Hi! I need to work with a Record Type in one of my
    functions.
    I have two questions:
    1) In my error handler, how do I return an empty
    record type
    and
    2) In the calling procedure, how do I evaluate
    whether or not my record type contains values.
    Any help is greatly appreciated.
    Thanks!
    ~ChristineHi,
    You can't test if a record is "atomically" NULL. You have two choices:
    1- if one of the fields has a not null constraint then you can test using this field.
    2- Otherwise, you can use an indicator out parameter that tells you if there is a value or nothing in the record.
    Michel

  • Exception Handling Error

    In the following code it produces some compiling errors. Also, the exception never reaches my own exceptions (XCoordinateViolation and YCoordinateViolation). Here is the code i have...
        weGotOKPointData = false;
        while (!weGotOKPointData)
            try
                aPoint.readPoint();
                weGotOKPointData = true;
                catch(Exception e)
                    JOptionPane.showMessageDialog(null, "Input was invalid. " +
                            "\nTry again.");
                    weGotOKPointData = false;
                catch (XCoordinateViolation violation)
                    JOptionPane.showMessageDialog(null, violation.getMessage() +
                            "\nCoordinate values reset to 0.0");
                    aPoint.setX(0.0);
                    aPoint.setY(0.0);
                    weGotOKPointData = true;               
                catch (YCoordinateViolation violation)
                    JOptionPane.showMessageDialog(null, violation.getMessage() +
                            "\nCoordinate values reset to 0.0");
                    aPoint.setX(0.0);
                    aPoint.setY(0.0);
                    weGotOKPointData = true;               
          }

    catch(Exception e)
    JOptionPane.showMessageDialog(null, "Input was invalid. " +
    "\nTry again.");
    weGotOKPointData = false;
    }Using Exception will hide the other custom exceptions you used because these exceptions extends the java.lang.Exception class.
    put this catch in the end of your exception catch blocks :
    weGotOKPointData = false;
        while (!weGotOKPointData)
            try
                aPoint.readPoint();
                weGotOKPointData = true;
                catch (XCoordinateViolation violation)
                    JOptionPane.showMessageDialog(null, violation.getMessage() +
                            "\nCoordinate values reset to 0.0");
                    aPoint.setX(0.0);
                    aPoint.setY(0.0);
                    weGotOKPointData = true;               
                catch (YCoordinateViolation violation)
                    JOptionPane.showMessageDialog(null, violation.getMessage() +
                            "\nCoordinate values reset to 0.0");
                    aPoint.setX(0.0);
                    aPoint.setY(0.0);
                    weGotOKPointData = true;               
    catch(Exception e)
                    JOptionPane.showMessageDialog(null, "Input was invalid. " +
                            "\nTry again.");
                    weGotOKPointData = false;

  • Varray Using OCI

    Hi,
    While sending Varray as an input parameter
    to an Oracle Stored Procedure, the following OCI calls
    are returning no error.
    OCITypeByName(),
    OCIObjectNew(),
    OCICollAppend(),
    OCIBindByPos(),
    OCIBindByObject()
    But OCIStmtExecute() hangs without giving any error.
    Can You PLEASE send me an example code
    for achieving the same.
    Also Could You suggest some books which deal with OCI function calls (with examples) in detail.
    CAN I EXPECT A REPLY from Mr.Ravikanth for this....Thanks for your previous reply
    Thanks & Regards,
    Alamelu
    null

    Hi Alamelu,
    I am sending some sample code snippets
    that show usage of collections.
    No, there are currently no books written on OCI. You can definitely look at some of the demo programs using OCI.
    static CONST text CONST_W_PTR selar = (text )
    "SELECT * from customer_va";
    static CONST text CONST_W_PTR insar = (text )
    "insert into customer_va (custno, names) values (:custno, :names)";
    static CONST text CONST_W_PTR modar = (text )
    "update customer_va set names=:names where custno=:custno";
    ** execute "selar" statement which select an array column from a table.
    void selectar(envhp, svchp, stmthp, stmthp1, errhp, recurse)
    OCIEnv *envhp;
    OCISvcCtx *svchp;
    OCIStmt *stmthp;
    OCIStmt *stmthp1;
    OCIError *errhp;
    boolean recurse;
    OCIType *names_ar_tdo;
    OCIDefine defn1p, defn2p;
    OCIColl names_ar = (OCIColl ) 0;
    sword custno =0;
    sword status;
    sb4 index;
    dvoid *elem;
    OCIString *names;
    OCIInd names_null = (OCIInd ) 0;
    boolean exist, eoc, boc;
    OCIIter itr = (OCIIter ) 0;
    OCIBind bnd1p, bnd2p;
    int amount;
    OCIInd ind = -1;
    OCIInd *indp = &ind;
    sb4 collsiz;
    DISCARD printf("\n******** Entering selectar *********\n");
    /* define the application request */
    checkerr(errhp, OCIStmtPrepare(stmthp, errhp, (text *) selar,
    (ub4) strlen((const char *) selar),
    (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
    /* bind the input variable */
    checkerr(errhp, OCIDefineByPos(stmthp, &defn1p, errhp, (ub4) 1, (dvoid *) &custno,
    (sb4) sizeof(sword), SQLT_INT, (dvoid *) 0, (ub2 *)0,
    (ub2 *)0, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCIDefineByPos(stmthp, &defn2p, errhp, (ub4) 2, (dvoid *) 0,
    (sb4) 0, SQLT_NTY, (dvoid *) 0, (ub2 *)0,
    (ub2 *)0, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCITypeByName(envhp, errhp, svchp, (const text *) "",
    (ub4) strlen((const char *) ""),
    (const text *) "VCHAR_TAB",
    (ub4) strlen((const char *) "VCHAR_TAB"),
    (CONST text *) 0, (ub4) 0,
    OCI_DURATION_SESSION, OCI_TYPEGET_HEADER,
    &names_ar_tdo));
    checkerr(errhp, OCIDefineObject(defn2p, errhp, names_ar_tdo, (dvoid **) &names_ar,
    (ub4 *) 0, (dvoid **) &indp, (ub4 *) 0));
    checkerr(errhp, OCIStmtExecute(svchp, stmthp, errhp, (ub4) 0, (ub4) 0, (OCISnapshot *)
    NULL, (OCISnapshot *) NULL, (ub4) OCI_DEFAULT));
    /* execute and fetch */
    DISCARD printf(" Execute and fetch.\n");
    while ((status = OCIStmtFetch(stmthp, errhp, (ub4) 1, (ub4) OCI_FETCH_NEXT,
    (ub4) OCI_DEFAULT)) == OCI_SUCCESS &#0124; &#0124;
    status == OCI_SUCCESS_WITH_INFO)
    /* print the customer number */
    DISCARD printf("\nThe customer number is : %d.\n", custno);
    if (*indp == -1)
    DISCARD printf("The varray is NULL.\n\n");
    continue;
    /* check how many elements in the typed table */
    checkerr(errhp, OCICollSize(envhp, errhp, (CONST OCIColl *) names_ar,
    &collsiz));
    DISCARD printf("---> There are %d elements in the varray.\n", collsiz);
    DISCARD printf("\n---> Dump the array from the top to the bottom.\n");
    checkerr(errhp, OCIIterCreate(envhp, errhp, names_ar, &itr));
    for(eoc = FALSE;!OCIIterNext(envhp, errhp, itr, (dvoid **) &elem,
    (dvoid **) &names_null, &eoc) && !eoc;)
    names = *(OCIString **) elem;
    DISCARD printf(" The names is %s\n", OCIStringPtr(envhp, names));
    DISCARD printf(" atomic null indicator is %d\n", *names_null);
    DISCARD printf("\n---> Dump the array from the bottom to the top.\n");
    checkerr(errhp, OCIIterGetCurrent(envhp, errhp, itr, (dvoid **) &elem,
    (dvoid **) &names_null));
    names = *(OCIString **) elem;
    DISCARD printf(" The names is %s\n", OCIStringPtr(envhp, names));
    DISCARD printf(" atomic null indicator is %d\n", *names_null);
    for(boc = FALSE;!OCIIterPrev(envhp, errhp, itr, (dvoid **) &elem,
    (dvoid **) &names_null, &boc) && !boc;)
    names = *(OCIString **) elem;
    DISCARD printf(" The names is %s\n", OCIStringPtr(envhp, names));
    DISCARD printf(" atomic null indicator is %d\n", *names_null);
    checkerr(errhp, OCI IterDelete(envhp, errhp, &itr));
    /* insert into the same table, then dump the info again */
    if (recurse)
    custno = custno * 10;
    checkerr(errhp, OCIStmtPrepare(stmthp1, errhp, (text *) insar,
    (ub4) strlen((const char *) insar),
    (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
    /* bind the input variable */
    checkerr(errhp, OCIBindByName(stmthp1, &bnd1p, errhp, (text *) ":custno",
    (sb4) -1, (dvoid *) &custno,
    (sb4) sizeof(sword), SQLT_INT,
    (dvoid *) 0, (ub2 *)0, (ub2 *)0, (ub4) 0, (ub4 *) 0,
    (ub4) OCI_DEFAULT));
    checkerr(errhp, OCIBindByName(stmthp1, &bnd2p, errhp, (text *) ":names",
    (sb4) -1, (dvoid *) 0,
    (sb4) 0, SQLT_NTY, (dvoid *) 0, (ub2 *)0, (ub2 *)0,
    (ub4) 0, (ub4 *) 0, (ub4) OCI_DEFAULT));
    /* if custno == 20, then insert null nested table */
    *indp = -1;
    checkerr(errhp, OCIBindObject(bnd2p, errhp, names_ar_tdo,
    (dvoid **) &names_ar,
    (ub4 *) 0, (custno == 20) ? (dvoid **) &indp :
    (dvoid **) 0, (ub4 *) 0));
    checkerr(errhp, OCIStmtExecute(svchp, stmthp1, errhp, (ub4) 1,
    (ub4) 0, (OCISnapshot *) NULL,
    (OCISnapshot *) NULL, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCITransCommit(svchp, errhp, (ub4) 0));
    if ( status!= OCI_NO_DATA )
    checkerr(errhp, status);
    if (recurse)
    selectar(envhp, svchp, stmthp, stmthp1, errhp, FALSE);
    DISCARD printf("\n\n");
    ** execute "selar" statement which select an array column from a table,
    ** then execute "modar" to modify the array.
    void modifyar(envhp, svchp, stmthp, stmthp1, errhp, recurse)
    OCIEnv *envhp;
    OCISvcCtx *svchp;
    OCIStmt *stmthp;
    OCIStmt *stmthp1;
    OCIError *errhp;
    boolean recurse;
    OCIType *names_ar_tdo;
    OCIDefine defn1p, defn2p;
    OCIColl names_ar = (OCIColl ) 0;
    sword custno =0;
    sword status;
    sb4 index, counter = 0;
    OCIString *names;
    dvoid *elem;
    OCIInd names_null = (OCIInd ) 0;
    boolean exist, eoc, boc;
    OCIIter itr = (OCIIter ) 0;
    OCIBind bnd1p, bnd2p;
    int amount;
    OCIInd ind = -1;
    OCIInd *indp = &ind;
    sb4 collsiz;
    DISCARD printf("\n******** Entering modifyar *********\n");
    /* define the application request */
    checkerr(errhp, OCIStmtPrepare(stmthp, errhp, (text *) selar,
    (ub4) strlen((const char *) selar),
    (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
    /* bind the input variable */
    checkerr(errhp, OCIDefineByPos(stmthp, &defn1p, errhp, (ub4) 1, (dvoid *) &custno,
    (sb4) sizeof(sword), SQLT_INT, (dvoid *) 0, (ub2 *)0,
    (ub2 *)0, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCIDefineByPos(stmthp, &defn2p, errhp, (ub4) 2, (dvoid *) 0,
    (sb4) 0, SQLT_NTY, (dvoid *) 0, (ub2 *)0,
    (ub2 *)0, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCITypeByName(envhp, errhp, svchp, (const text *) "",
    (ub4) strlen((const char *) ""),
    (const text *) "VCHAR_TAB",
    (ub4) strlen((const char *) "VCHAR_TAB"),
    (CONST text *) 0, (ub4) 0,
    OCI_DURATION_SESSION, OCI_TYPEGET_HEADER,
    &names_ar_tdo));
    checkerr(errhp, OCIDefineObject(defn2p, errhp, names_ar_tdo, (dvoid **) &names_ar,
    (ub4 *) 0, (dvoid **) &indp, (ub4 *) 0));
    checkerr(errhp, OCIStmtExecute(svchp, stmthp, errhp, (ub4) 0, (ub4) 0, (OCISnapshot *)
    NULL, (OCISnapshot *) NULL, (ub4) OCI_DEFAULT));
    /* execute and fetch */
    DISCARD printf("\n Execute and fetch.\n");
    while ((status = OCIStmtFetch(stmthp, errhp, (ub4) 1, (ub4) OCI_FETCH_NEXT,
    (ub4) OCI_DEFAULT)) == OCI_SUCCESS &#0124; &#0124;
    status == OCI_SUCCESS_WITH_INFO)
    /* print the customer number */
    DISCARD printf("\nThe customer id is : %d.\n", custno);
    if (*indp == -1)
    DISCARD printf("The varray is NULL.\n\n");
    continue;
    /* check how many elements in the varray */
    checkerr(errhp, OCICollSize(envhp, errhp, (CONST OCIColl *) names_ar,
    &collsiz));
    DISCARD printf("---> There are %d elements in the varray.\n", collsiz);
    DISCARD printf("\n---> Dump the table from the top to the bottom.\n");
    checkerr(errhp, OCIIterCreate(envhp, errhp, names_ar, &itr));
    for(eoc = FALSE;!OCIIterNext(envhp, errhp, itr, (dvoid **) &elem,
    (d void **) &names_null, &eoc) && !eoc;)
    names = *(OCIString **) elem;
    DISCARD printf(" The names is %s\n", OCIStringPtr(envhp, names));
    DISCARD printf(" atomic null indicator is %d\n", *names_null);
    /* modify records */
    if (recurse)
    if (!counter)
    /* nullify the array */
    for(;!OCICollTrim(envhp, errhp, (sb4) 1, names_ar););
    else
    if (counter %2)
    /* trim one row at the end */
    checkerr(errhp, OCICollTrim(envhp, errhp, (sb4) 1, names_ar));
    else
    /* append one row to the end */
    checkerr(errhp, OCICollAppend(envhp, errhp, (CONST dvoid *) names,
    (CONST dvoid *) names_null, names_ar));
    counter ++;
    checkerr(errhp, OCIStmtPrepare(stmthp1, errhp, (text *) modar,
    (ub4) strlen((const char *) modar),
    (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
    /* bind the input variable */
    checkerr(errhp, OCIBindByName(stmthp1, &bnd1p, errhp, (text *) ":custno",
    (sb4) -1, (dvoid *) &custno,
    (sb4) sizeof(sword), SQLT_INT,
    (dvoid *) 0, (ub2 *)0, (ub2 *)0, (ub4) 0, (ub4 *) 0,
    (ub4) OCI_DEFAULT));
    checkerr(errhp, OCIBindByName(stmthp1, &bnd2p, errhp, (text *) ":names",
    (sb4) -1, (dvoid *) 0,
    (sb4) 0, SQLT_NTY, (dvoid *) 0, (ub2 *)0, (ub2 *)0,
    (ub4) 0, (ub4 *) 0, (ub4) OCI_DEFAULT));
    /* try modify the varray into NULL if custno == 30 */
    if (custno == 30)
    *indp = -1;
    checkerr(errhp, OCIBindObject(bnd2p, errhp, names_ar_tdo,
    (dvoid **) &names_ar, (ub4 *) 0,
    (dvoid **) &indp, (ub4 *) 0));
    checkerr(errhp, OCIStmtExecute(svchp, stmthp1, errhp, (ub4) 1,
    (ub4) 0, (OCISnapshot *) NULL,
    (OCISnapshot *) NULL, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCITransCommit(svchp, errhp, (ub4) 0));
    if ( status!= OCI_NO_DATA )
    checkerr(errhp, status);
    if (recurse)
    modifyar(envhp, svchp, stmthp, stmthp1, errhp, FALSE);
    DISCARD printf("\n\n");
    null

  • Manipulating VARRAYS

    Can anyone send me an example of varray manipulation (reading and writing) using C/OCI ?
    I'm a beginner.
    Thank's in advance.

    Here is a sample routine :-
    static CONST text CONST_W_PTR selar = (text )
    "SELECT * from customer_va";
    ** execute "selar" statement which select an array column from a table.
    void selectar(envhp, svchp, stmthp, stmthp1, errhp, recurse)
    OCIEnv *envhp;
    OCISvcCtx *svchp;
    OCIStmt *stmthp;
    OCIStmt *stmthp1;
    OCIError *errhp;
    boolean recurse;
    OCIType *names_ar_tdo;
    OCIDefine defn1p, defn2p;
    OCIColl names_ar = (OCIColl ) 0;
    sword custno =0;
    sword status;
    dvoid *elem;
    sb4 index;
    OCIString OCIInd names_null = (OCIInd ) 0;
    boolean exist, eoc, boc;
    OCIIter itr = (OCIIter ) 0;
    OCIBind bnd1p, bnd2p;
    int amount;
    OCIInd ind = -1;
    OCIInd *indp = &ind;
    sb4 collsiz;
    DISCARD printf("\n******** Entering selectar *********\n");
    /* define the application request */
    checkerr(errhp, OCIStmtPrepare(stmthp, errhp, (text *) selar,
    (ub4) strlen((const char *) selar),
    (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
    *names;
    /* bind the input variable */
    checkerr(errhp, OCIDefineByPos(stmthp, &defn1p, errhp, (ub4) 1, (dvoid *) &custno,
    (sb4) sizeof(sword), SQLT_INT, (dvoid *) 0, (ub2 *)0,
    (ub2 *)0, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCIDefineByPos(stmthp, &defn2p, errhp, (ub4) 2, (dvoid *) 0,
    (sb4) 0, SQLT_NTY, (dvoid *) 0, (ub2 *)0,
    (ub2 *)0, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCITypeByName(envhp, errhp, svchp, (const text *) "",
    (ub4) strlen((const char *) ""),
    (const text *) "CHAR_TAB",
    (ub4) strlen((const char *) "CHAR_TAB"),
    (CONST text *) 0, (ub4) 0,
    OCI_DURATION_SESSION, OCI_TYPEGET_HEADER,
    &names_ar_tdo));
    checkerr(errhp, OCIDefineObject(defn2p, errhp, names_ar_tdo, (dvoid **) &names_ar,
    (ub4 *) 0, (dvoid **) &indp, (ub4 *) 0));
    checkerr(errhp, OCIStmtExecute(svchp, stmthp, errhp, (ub4) 0, (ub4) 0,
    (OCISnapshot *) NULL, (OCISnapshot *) NULL,
    (ub4) OCI_DEFAULT));
    /* execute and fetch */
    DISCARD printf(" Execute and fetch.\n");
    while ((status = OCIStmtFetch(stmthp, errhp, (ub4) 1, (ub4) OCI_FETCH_NEXT,
    (ub4) OCI_DEFAULT)) == OCI_SUCCESS &#0124; &#0124;
    status == OCI_SUCCESS_WITH_INFO)
    /* print the customer number */
    DISCARD printf("\nThe customer number is : %d.\n", custno);
    if (*indp == -1)
    DISCARD printf("The varray is NULL.\n\n");
    continue;
    /* check how many elements in the typed table */
    checkerr(errhp, OCICollSize(envhp, errhp, (CONST OCIColl *) names_ar,
    &collsiz));
    DISCARD printf("---> There are %d elements in the varray.\n", collsiz);
    DISCARD printf("\n---> Dump the array from the top to the bottom.\n");
    checkerr(errhp, OCIIterCreate(envhp, errhp, names_ar, &itr));
    for(eoc = FALSE;!OCIIterNext(envhp, errhp, itr, (dvoid **) &elem,
    (dvoid **) &names_null, &eoc) && !eoc;)
    names = *(OCIString **) elem;
    DISCARD printf(" The names is %s\n", OCIStringPtr(envhp, names));
    DISCARD printf(" atomic null indicator is %d\n", *names_null);
    DISCARD printf("\n---> Dump the array from the bottom to the top.\n");
    checkerr(errhp, OCIIterGetCurrent(envhp, errhp, itr, (dvoid **) &elem,
    (dvoid **) &names_null));
    names = *(OCIString **) elem;
    DISCARD printf(" The names is %s\n", OCIStringPtr(envhp, names));
    DISCARD printf(" atomic null indicator is %d\n", *names_null);
    for(boc = FALSE;!OCIIterPrev(envhp, errhp, itr, (dvoid **) &elem,
    (dvoid **) &names_null, &boc) && !boc;)
    names = *(OCIString **) elem;
    DISCARD printf(" The names is %s\n", OCIStringPtr(envhp, names));
    DISCARD printf(" atomic null indicator is %d\n", *names_null);
    checkerr(errhp, OCIIterDelete(envhp, errhp, &itr));
    /* insert into the same table, then dump the info again */
    if (recurse)
    custno = custno * 10;
    checkerr(errhp, OCIStmtPrepare(stmthp1, errhp, (text *) insar,
    (ub4) strlen((const char *) insar),
    (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
    /* bind the input variable */
    checkerr(errhp, OCIBindByName(stmthp1, &bnd1p, errhp, (text *) ":custno",
    (sb4) -1, (dvoid *) &custn o,
    (sb4) sizeof(sword), SQLT_INT,
    (dvoid *) 0, (ub2 *)0, (ub2 *)0, (ub4) 0, (ub4 *) 0,
    (ub4) OCI_DEFAULT));
    checkerr(errhp, OCIBindByName(stmthp1, &bnd2p, errhp, (text *) ":names",
    (sb4) -1, (dvoid *) 0,
    (sb4) 0, SQLT_NTY, (dvoid *) 0, (ub2 *)0, (ub2 *)0,
    (ub4) 0, (ub4 *) 0, (ub4) OCI_DEFAULT));
    /* if custno == 20, then insert null nested table */
    *indp = -1;
    checkerr(errhp, OCIBindObject(bnd2p, errhp, names_ar_tdo,
    (dvoid **) &names_ar,
    (ub4 *) 0, (custno == 20) ? (dvoid **) &indp :
    (dvoid **) 0, (ub4 *) 0));
    checkerr(errhp, OCIStmtExecute(svchp, stmthp1, errhp, (ub4) 1,
    (ub4) 0, (OCISnapshot *) NULL,
    (OCISnapshot *) NULL, (ub4) OCI_DEFAULT));
    checkerr(errhp, OCITransCommit(svchp, errhp, (ub4) 0));
    null

Maybe you are looking for

  • How can I display error if the input is not a number?

    I thought I knew how, but I am not sure on what is what in the ASCII character list. I need check for errors if the user inputs anything except a positive integer. How could I do that? I had something like this: int number;      if ((number<0)||(numb

  • Should i open folder and transfer cd file to n200 or whole fold

    I used mediasource to rip my cds to computer and ended up in widows explorer with a folder for the cd and inside the folder a file with cd in it.when i ripped using windows media i ended up with just a file with cd in it in explorer. In transfering c

  • Can't open or download on my macbook air

    I can't view or download docs from oracle on my Mac Book Pro

  • Power builder 6.5 and oracle 8.1.7

    dear friends I am using powerbuilder as front end and oracle as backend and extensively depend on Oracle stored procedures result set values for my datawindows.But i amd facing a problem .The problem being that i connect to ORACLE from Powerbuilder u

  • Security Update 2006-001 causing a problem?

    I just installed the new security update on my work mac. The result after the resart was that all of my programs act like they've never been opened before. My address book is gone, my mail started over, Firefox, iTunes, etc. Along with this went my d