Loop through checkbox in Oracle APEX 4.2 (using JQuery Mobile)

Hello!
I want question text and a report containing the possible answers is shown on a page. An answer can be selected by clicking on the checkbox. After hitting the submit button, the selected checkboxes containing the Answer Text, an answer_id and the current session_id are to be inserted into a table within the database.
Within Oracle APEX 4.2, I am using a classic report to achieve this. Thich is actually a bad solution, because the checkboxes within the report are shown as simple HTML checkboxes, instead of neat JQueryMobile checkboxes). Anyway, this is my current solution:
Is use this code for creating the classic report:
SELECT APEX_ITEM.CHECKBOX(1,answer_id), answer_id, answer_text
FROM ANSWERS
WHERE question_ID = :P10_Question_ID;
The insert of the data is done via the on submit process "On Submit - After Computations and Validations"
This is the code for the on submit process:
DECLARE var_session_id NUMBER := :P0_SESSION_ID;
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
INSERT INTO STUDENT_ANSWERS (answer_id, answer_text, session_id)
SELECT a.answer_id, a.answer_text, var_session_id
FROM ANSWERS a WHERE a.answer_id = APEX_APPLICATION.G_F01(i)
END LOOP;
COMMIT;
END;
But this solution does not work. Instead, nothing is inserted into the database.
I don't know why the process is not inserting into the database, maybe there is something wrong with this line here WHERE a.answer_id = APEX_APPLICATION.G_F01(i) ?
I even tried a simple update process for testing purposes, but this doesnt work either:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
UPDATE STUDENT_ANSWERS SET text = APEX_APPLICATION.G_F03(APEX_APPLICATION.G_F01(i))
WHERE am_id = APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(i));
END LOOP;
COMMIT;
END;
Can anybody tell me how to loop through a checkbox within ORACLE APEX 4.2 and how to insert the values ANSWER_ID, ANSWER_TEXT and SESSION_ID into the table STUDENT_ANSWERS after hitting the submit button? If you would know how to do it without using a report but a simple checkbox, this would be even more helpful for me!

I would start by putting this after submit, to check the contents of the array.
apex_debug.message('count:'||apex_application.g_f01.COUNT);
FOR i IN 1..apex_application.g_f01.COUNT LOOP
    apex_debug.message('i:'||i||':'||apex_application.g_f01(i));
END LOOP;
Then compare the contents with your answers table.

Similar Messages

  • Oracle APEX pages last used

    Is there any way to find out what date a page in an application is last used and by whom? This I am trying to find out for all the pages in an application. I can do that going through each page > Activity > Page views by user. But it is cumbersome to go into each page and run "By User for Page XX".

    >
    Please update your forum profile with a real handle instead of "908006".
    Is there any way to find out what date a page in an application is last used and by whom? This I am trying to find out for all the pages in an application. I can do that going through each page > Activity > Page views by user. But it is cumbersome to go into each page and run "By User for Page XX".This information is available through built-in reports and APEX views. See:
    <li>Monitoring Activity Within a Workspace
    <li>Creating Custom Activity Reports Using APEX_ACTIVITY_LOG
    <li>APEX views: Home > Application Builder > Application > Utilities > Application Express Views
    Note that the underlying logs are purged on a regular basis, so for the long term you need to copy the data to your own tables, as Martin handily suggests here.

  • Loop through month and year till date while using a merge statement

    Hello Guys,
    I have 2 tables with the following datas in them:-
    Company
    CompanyId CompanyName
    1                 Company1
    2                 Company2
    3                 Company3
    Employees
    EmployeeId EmployeeName CompanyId StartDate
    1                  Employee1        1                 12/21/2011
    2                  Employee2        1                 01/20/2012
    3                  Employee3        2                 03/23/2012
    4                  Employee4        2                 07/15/2012
    5                  Employee5        2                 01/20/2013
    6                  Employee6        3                 12/17/2013
    Now i want to check, How many people were recruited in the team in the specified month and year? I have the storage table as follows:-
    RecruiterIndicator
    CompanyId Year Month EmployeeRecruited
    1                 2011 12      1
    1                 2012 1        1
    2                 2012 3        1
    2                 2012 7        1
    2                 2013 1        1
    3                 2013 12      1
    This should be a merge stored procedure that should update the data if it is present for the same month year and company and insert if that is not present?
    Please help me with this
    Thanks
    Abhishek

    It's not really clear where the merge to come into play. To get the RecruiterIndicator table from Employess, this query should do:
    SELECT CompanyId, Year(StartDate), Month(StartDate), COUNT(*)
    FROM   Employees
    GROUP  BY CompanyId, Year(StartDate), Month(StartDate)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Nested Loops...looping through one month of data at a time year by year

    Hi all,
    I'm trying to create an insert statement that loops through a table that has 10 years of data (2001 to 2010) month by month to minimize impact on server and commits more frequently to avoid filling up the redo logs and rollback tablespaces. The table is large, has about 40 millions records per year. Lets say the structure of the table is the following:
    Customer_ID number(9),
    Order_Item_1 number(6),
    Order_Item_2 number(6),
    Order_Item_3 number(6),
    Order_date date
    The table is in flat format but I want to normalize it so that it looks like the following:
    Customer_ID Order_Seq Order_Item Order_date
    999999999 1 555555 01-jan-2001
    999999999 2 666666 01-jan-2001
    999999999 3 444444 01-jan-2001
    888888888 1 555555 03-jan-2001
    888888888 2 666666 03-jan-2001
    But because I want to loop through month by month....I need to set it up so that it loops through month by month, year by year (Using the Order Date Field) and Order_item by Order_item. Something like:
    so my insert statements would be something like if I hardcoded instead of put the insert statement into a loop:
    insert into orders_normalized
    (Customer_id,Order_seq,Order_item,Order_date) select customer_id,1,Order_item,Order_date where Order_item_1 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='01';
    insert into orders_normalized
    (Customer_id,Order_seq,Order_item,Order_date) select customer_id,2,Order_item,Order_date where Order_item_2 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='01';
    insert into orders_normalized
    (Customer_id,Order_seq,Order_item,Order_date) select customer_id,3,Order_item,Order_date where Order_item_3 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='01';
    insert into orders_normalized
    (Customer_id,Order_seq,Order_item,Order_date) select customer_id,1,Order_item,Order_date where Order_item_1 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='02';
    insert into orders_normalized
    (Customer_id,Order_seq,Order_item,Order_date) select customer_id,2,Order_item,Order_date where Order_item_2 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='02';
    insert into orders_normalized
    (Customer_id,Order_seq,Order_item,Order_date) select customer_id,3,Order_item,Order_date where Order_item_3 is not null and to_char(order_date,'yyyy') = '2001' and to_char(order_date,'mm')='03';
    Hope this makes sense.
    Thanks

    Does the sequence of items in an order really matter? In other words, do we really need to preserve that an item was in position 2 versus position 1? I bet that the sequence or position of each item in an order is not meaningful. They were probably numbered 1, 2, and 3 just to make them uniquely named columns so there would be three slots to hold up to 3 items in the denormalized table.
    You only have about 400 million rows to insert, so it could feasibly be done in a single transaction (depending on your database environment).
    You can always do a create table as select (CTAS) to help with undo / redo issues and get better performance. You could run it in parallel, and spit it out to a new table partitioned by month. Single DDL statement running in parallel making your new table--sounds good to me.
    How about something like this:
    CREATE TABLE ORDERS_NORMALIZED
    (CUSTOMER_ID, ORDER_ITEM, ORDER_DATE)
    PARTITION BY RANGE(ORDER_DATE)
    PARTITION p200901 VALUES LESS THAN (TO_DATE('200902','YYYYMM')),
    PARTITION p200902 VALUES LESS THAN (TO_DATE('200903','YYYYMM')),
    PARTITION p201012 VALUES LESS THAN (TO_DATE('201101','YYYYMM'))
    as SELECT CUSTOMER_ID, ORDER_ITEM_1, ORDER_DATE
       FROM OTHER_TABLE
       WHERE ORDER_ITEM_1 IS NOT NULL
       UNION ALL
       SELECT CUSTOMER_ID, ORDER_ITEM_2, ORDER_DATE
       FROM OTHER_TABLE
       WHERE ORDER_ITEM_2 IS NOT NULL
       UNION ALL
       SELECT CUSTOMER_ID, ORDER_ITEM_3, ORDER_DATE
       FROM OTHER_TABLE
       WHERE ORDER_ITEM_3 IS NOT NULL.....................
    Out of curiosity, why not normalize it further? You could have used two tables instead of one.
    One (ORDER) with:
    ORDER_ID
    CUSTOMER_ID
    DATE
    Order_id would be a new surrogate key / primary key.
    Another table (ORDER_ITEM) with:
    ORDER_ID
    ORDER_ITEM
    It would be a table that links ORDERS to ITEMS. You get the idea.

  • How to loop through Multiple Excel sheets and load them into a SQL Table?

    Hi ,
    I am having 1 excel sheet with 3 worksheet.
    I have configured using For each loop container and ADO.net rowset enumerator.
    Every thing is fine, but after running my package I am getting below error
    [Excel Source [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may
    be error messages posted before this with more information on why the AcquireConnection method call failed.
    Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified
    in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    [Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by
    another user, or you need permission to view and write its data.".
    Pleas suggest me the correct way of solving above issues.
    Thanks in advance :)
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi ,
    Please refer the below link for Looping multiple worksheet in a single SQL Table.
    http://www.singhvikash.in/2012/11/ssis-how-to-loop-through-multiple-excel.html
    Note:-If you using excel 2010 then you have to use EXCEL 12.0 .
    Above link explaining  step by step of Looping multiple worksheet in a single SQL Table.
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

  • Website using Oracle APEX

    Hi Gurus,
    Please tell me if Oracle APEX can be used to deploy a full fledged website on internet.
    I have the application ready on my personal machine but need to know if this can be made available for everyone on internet.
    Regards,
    Abhishek

    Abhishek,
    If your organization does not have IT infrastructure but has man power (APEX admins), you can use the Amazon EC2 which is cloud computing. Just simply pay monthly fee. Here is a post of APEX on cloud - http://jastraub.blogspot.com/2009/03/test-drive-oracle-application-express.html
    Otherwise, here is the list of companies which can host APEX applications - http://www.oracle.com/technology/products/database/application_express/html/apex_com_hosting.html
    Ittichai

  • Oracle APEX advanced training through Oracle University partner

    Hello,
    Has anyone ever taken the Advanced Workshop for APEX training offered on Oracle University through Oracle partner TransAmerica Training?
    Oracle Application Express: Advanced Workshop | Oracle Application Express (Oracle APEX) | Database Application Developm…
    I'm really excited to get some expert advanced knowledge and wanted to see if anyone had used this training or was planning on attending (They're in Ft Lauderdale and it's scheduled for mid-January, so I'm also excited to get out of the northeast winter for a week).
    Thanks.

    bump to see if there was any feedback or interest?

  • Insert a record into a table through email in an Oracle APEX application

    I developed an Oracle APEX application, there is a table called events. I can insert/update/delete a record in the table through browser. I am thinking in order to quickly do the data entry, user should be able to send an email, then the table should be inserted with values from email address, timestamp, subject and body. Anyd idea how to realize this functionality?
    - Denis

    Start by checking whether your mail server provides any API's for accessing emails , if it does you might be able to reduce a lot of work by using some kind of web service consumer from apex to your mail server. In any case your implementation is going to be dependent on your Mail Server configuration.
    Your problem breaks down to reading/accessing mails from the mail server from PLSQL (apex is driven by PLSQL).
    I found this other thread which could be of some use.
    WAY TO ACCESS A MAIL SERVER FROM ORACLE APEX
    <li>The following package might solve your problem directly(from carsten czarski of the German Apex community)
    [url http://plsqlmailclient.sourceforge.net]http://plsqlmailclient.sourceforge.net
    PS: POP3 support is still TBD.
    <li>I also found this posting in the orafaq forums which lists a java method and PLSQL code bit for it for accessing emails via POP3
    [url http://www.orafaq.com/forum/t/80928/2/]http://www.orafaq.com/forum/t/80928/2/
    If these do not work for you, find some java library to read mail from your server, write a PLSQL wrapper for it and use it in a scheduled job(DBMS_JOB)/a PLSQL block triggered from Apex.
    If you get stuck there, find some utility that can read mails, invoke them from your DB using java,shell scrpt,dbms_scheduler etc and use the utility's function for the rest.
    NOTE: I haven't tried any of these utilities and you must validate any java code before running them on your environment.
    Since aren't really much restrictions(other than spam checks) in sending a mail to your mail account, you might want to consider filtering out the mails from which you create records.

  • Reading and Updating MS Active Directory (AD) through Oracle APEX

    Hi All,
    Has anyone ever read and update the AD components using Oracle APEX?
    I know we can have APEX build in LDAP Authentication, but that is for the Authentication, what about reading other attributes like phone no., department, office etc. from MS AD; and about updating the same information.
    Is Oracle Identity Management the only solution?
    Windows 2008 R2 Server provide SOAP based AD web services (ADWS), has anyone used that with APEX (11g R2 with EPG configuration)?
    Is it possible to have a C# code (through external procedure) which could read and write MS AD; can we use only "C" code in oracle as external proc or C# as well?
    Any pointers would be of great help.
    Thanks,
    Ash

    Ash,
    It's possible to query data from the LDAP server, but it's not as easy as you'd like. I don't know about updating, but fopr querying, you're looking at creating a package using DBMS_LDAP and a pipelined function to get the data. Here's one example from a quick google search; there are others.
    One thing to be aware of that burned me: the default LDAP setting limits requests to 1,000 records. If your search gives more than that, you get an error (and no data at all). So you may find yourself having to use unions to get the full data, which slows things down a bit.
    -David

  • Oracle Looping through XML nodes

    Hi,
    I have this XML which i m getting as response from a webservice. i need to loop through nodes and i m not sure how to go about it. i have done example using dbms_xmldom but i m literally stuck. this is the xml here i need to loop through
    statuslognotes for one enquiry, there may be multiple statuslognotes and need to insert into database....
    i also need to check for multiple updatedenquiry and if thats got statuslognotes....i hope you get me.
    <ProcessOperationsResult xmlns="http://www.abc.co.uk/schema/am/connector/webservice" >
    <Response SchemaVersion="1.4" xmlns="" >
    <OperationResponse>
    <GetEnquiryStatusChangesResponse>
    <UpdatedEnquiry>
    <EnquiryNumber>104</EnquiryNumber>
    <ExternalSystemNumber>1</ExternalSystemNumber>
    <ExternalSystemReference>195</ExternalSystemReference>
    <EnquiryStatusLog>
    <EnquiryStatusCode>1224</EnquiryStatusCode>
    <EnquiryStatusName>Cancelled By User</EnquiryStatusName>
    <AssignedOfficerCode>BBB</AssignedOfficerCode>
    <AssignedOfficerName>Testing</AssignedOfficerName>
    <LoggedTime>2007-12-11T14:44:53</LoggedTime>
    <LogEffectiveTime>2007-12-11T14:44:52</LogEffectiveTime>
    <StatusFollowUpTime>2007-12-11T14:44:52</StatusFollowUpTime>
    <LoggedByUserName>System Supervisor</LoggedByUserName>
    <LoggedByUserId>AAA</LoggedByUserId>
    </EnquiryStatusLog>
    <EnquiryStatusLog>
    <EnquiryStatusCode>1225</EnquiryStatusCode>
    <EnquiryStatusName>Cancelled By User</EnquiryStatusName>
    <AssignedOfficerCode>DEF</AssignedOfficerCode>
    <AssignedOfficerName>Srinivas</AssignedOfficerName>
    <LoggedTime>2007-12-11T14:44:53</LoggedTime>
    <LogEffectiveTime>2007-12-11T14:44:52</LogEffectiveTime>
    <StatusFollowUpTime>2007-12-11T14:44:52</StatusFollowUpTime>
    <LoggedByUserName>System Supervisor</LoggedByUserName>
    <LoggedByUserId>AAA</LoggedByUserId>
    </EnquiryStatusLog>
    </UpdatedEnquiry>
    <UpdatedEnquiry>
    <EnquiryNumber>105</EnquiryNumber>
    <ExternalSystemNumber>1</ExternalSystemNumber>
    <ExternalSystemReference>196</ExternalSystemReference>
    <EnquiryStatusLog>
    <EnquiryStatusCode>1226</EnquiryStatusCode>
    <EnquiryStatusName>Cancelled By User</EnquiryStatusName>
    <AssignedOfficerCode>Test</AssignedOfficerCode>
    <AssignedOfficerName>SS</AssignedOfficerName>
    <LoggedTime>2007-12-11T14:44:53</LoggedTime>
    <LogEffectiveTime>2007-12-11T14:44:52</LogEffectiveTime>
    <StatusFollowUpTime>2007-12-11T14:44:52</StatusFollowUpTime>
    <LoggedByUserName>System Supervisor</LoggedByUserName>
    <LoggedByUserId>BS</LoggedByUserId>
    </EnquiryStatusLog>
    </UpdatedEnquiry>
    </GetEnquiryStatusChangesResponse>
    </OperationResponse>
    </Response>
    </ProcessOperationsResult>
    Any help appreciated....as i m new to this XPATH stuff in oracle.
    Cheers
    S

    hi,
    i have written this stored procedure, but i m sure this is not perfect. i want someone to help me out with this.
    CREATE OR REPLACE procedure ParseXML as
    l_xml XMLTYPE;
    l_value VARCHAR2(10);
    SCHEMALIST_DOM DBMS_XMLDOM.DOMDOCUMENT;
    SCHEMA_NODELIST DBMS_XMLDOM.DOMNODELIST;
    SCHEMA_NODELIST_SUB DBMS_XMLDOM.DOMNODELIST;
    SCHEMA_NODE DBMS_XMLDOM.DOMNODE;
    SCHEMA_sub_XPATH VARCHAR2(256);
    SCHEMA_XPATH VARCHAR2(256);
    CHILD_XPATH VARCHAR2(256);
    SOURCE_PATH VARCHAR2(256);
    XPATH_INDEX number(2);
    XPATH_sub_INDEX number(2);
    NODE_VALUE VARCHAR2(256);
    Statcode VARCHAR2(256);
    Statname VARCHAR2(256);
    Officer VARCHAR2(256);
    BEGIN
    l_xml := XMLTYPE.createXML('<ProcessOperationsResult xmlns="http://www.abc.co.uk/schema/am/connector/webservice">
    <Response SchemaVersion="1.4" xmlns="">
    <OperationResponse>
    <GetEnquiryStatusChangesResponse>
    <UpdatedEnquiry>
    <EnquiryNumber>104</EnquiryNumber>
    <ExternalSystemNumber>1</ExternalSystemNumber>
    <ExternalSystemReference>195</ExternalSystemReference>
    <EnquiryStatusLog>
    <EnquiryStatusCode>1224</EnquiryStatusCode>
    <EnquiryStatusName>Cancelled By User</EnquiryStatusName>
    <AssignedOfficerCode>TEST</AssignedOfficerCode>
    <AssignedOfficerName>test</AssignedOfficerName>
    <LoggedTime>2007-12-11T14:44:53</LoggedTime>
    <LogEffectiveTime>2007-12-11T14:44:52</LogEffectiveTime>
    <StatusFollowUpTime>2007-12-11T14:44:52</StatusFollowUpTime>
    <LoggedByUserName>System Supervisor</LoggedByUserName>
    <LoggedByUserId>BS</LoggedByUserId>
    </EnquiryStatusLog>
    <EnquiryStatusLog>
    <EnquiryStatusCode>1225</EnquiryStatusCode>
    <EnquiryStatusName>Cancelled By User</EnquiryStatusName>
    <AssignedOfficerCode>DEF</AssignedOfficerCode>
    <AssignedOfficerName>SSi</AssignedOfficerName>
    <LoggedTime>2007-12-11T14:44:53</LoggedTime>
    <LogEffectiveTime>2007-12-11T14:44:52</LogEffectiveTime>
    <StatusFollowUpTime>2007-12-11T14:44:52</StatusFollowUpTime>
    <LoggedByUserName>System Supervisor</LoggedByUserName>
    <LoggedByUserId>SBS</LoggedByUserId>
    </EnquiryStatusLog>
    </UpdatedEnquiry>
    <UpdatedEnquiry>
    <EnquiryNumber>105</EnquiryNumber>
    <ExternalSystemNumber>1</ExternalSystemNumber>
    <ExternalSystemReference>196</ExternalSystemReference>
    <EnquiryStatusLog>
    <EnquiryStatusCode>1226</EnquiryStatusCode>
    <EnquiryStatusName>Cancelled By User</EnquiryStatusName>
    <AssignedOfficerCode>TEST</AssignedOfficerCode>
    <AssignedOfficerName>test</AssignedOfficerName>
    <LoggedTime>2007-12-11T14:44:53</LoggedTime>
    <LogEffectiveTime>2007-12-11T14:44:52</LogEffectiveTime>
    <StatusFollowUpTime>2007-12-11T14:44:52</StatusFollowUpTime>
    <LoggedByUserName>System Supervisor</LoggedByUserName>
    <LoggedByUserId>SBS</LoggedByUserId>
    </EnquiryStatusLog>
    </UpdatedEnquiry>
    </GetEnquiryStatusChangesResponse>
    </OperationResponse>
    </Response>
    </ProcessOperationsResult>');
    SCHEMALIST_DOM := DBMS_XMLDOM.newDOMDocument(L_XML);
    SCHEMA_NODELIST := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(SCHEMALIST_DOM,'GetEnquiryStatusChangesResponse');
    SCHEMA_NODELIST_SUB := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(SCHEMALIST_DOM,'/UpdatedEnquiry/EnquiryStatusLog');
    FOR i in 0 .. (DBMS_XMLDOM.GETLENGTH(SCHEMA_NODELIST) - 1) LOOP
    XPATH_INDEX := i+1;
    FOR j in 0 .. (DBMS_XMLDOM.GETLENGTH(SCHEMA_NODELIST_SUB) - 1) LOOP
    XPATH_SUB_INDEX := J+1;
    SCHEMA_SUB_XPATH := '/GetEnquiryStatusChangesResponse/UpdatedEnquiry[' || XPATH_INDEX || ']/EnquiryStatusLog[' || XPATH_sub_INDEX || ']/';
    --dbms_output.put_line(SCHEMA_SUB_XPATH);
    CHILD_XPATH := SCHEMA_SUB_XPATH || 'EnquiryStatusCode/text()';
    dbms_output.put_line('child path text ' || child_XPATH);
    DBMS_XSLPROCESSOR.VALUEOF(DBMS_XMLDOM.MAKENODE(SCHEMALIST_DOM),CHILD_XPATH, Statcode);
    CHILD_XPATH := SCHEMA_SUB_XPATH || 'EnquiryStatusName/text()';
    DBMS_XSLPROCESSOR.VALUEOF(DBMS_XMLDOM.MAKENODE(SCHEMALIST_DOM),CHILD_XPATH, Statname);
    CHILD_XPATH := SCHEMA_SUB_XPATH || 'AssignedOfficerCode/text()';
    DBMS_XSLPROCESSOR.VALUEOF(DBMS_XMLDOM.MAKENODE(SCHEMALIST_DOM),CHILD_XPATH, Officer);
    dbms_output.put_line('EnquiryStatusCode => "' || Statcode || '",');
    dbms_output.put_line('EnquiryStatusname => "' || Statname || '",');
    dbms_output.put_line('AssignedOfficerCode => "' || Officer || '",');
    end loop;
    --GetEnquiryStatusChangesResponse/UpdatedEnquiry[2]
    schema_xpath := '/GetEnquiryStatusChangesResponse/UpdatedEnquiry[' || XPATH_INDEX || ']/EnquiryStatusLog['|| XPATH_INDEX || ']/' ;
    CHILD_XPATH := SCHEMA_XPATH || 'EnquiryStatusCode/text()';
    dbms_output.put_line('another node text ' || child_XPATH);
    DBMS_XSLPROCESSOR.VALUEOF(DBMS_XMLDOM.MAKENODE(SCHEMALIST_DOM),CHILD_XPATH, Statcode);
    end loop;
    end;
    Basically i may just get one UpdatedEnquiry record with multiple EnquiryStatusLog (changes),
    I need to get the EnquiryStatusLog nodes and create a insert stmt with the Enquiry Number.
    and if theres multiple <UpdatedEnquiry> nodes, i need the same thing done.
    Hope i make sense here.....
    Can someone help
    Cheers
    S

  • Is it possible to execute OS level commands through Oracle APEX?

    Hi,
    I would like to know if it is possible to execute OS level commands, say executing any command in command prompt using Oracle APEX.
    Thanks!

    Welcome to Oracle Forums!
    Please acquaint yourself with the FAQ and forum etiquette if you haven't already done so.
    Always state
    <ul>
    <li>Apex Version</li>
    <li>DB Version and edition</li>
    <li>Web server used.I.e. EPG, OHS, ApexListner Standalone or with J2EE container</li>
    <li>When asking about forms always state tabular form if it is a tabular form</li>
    <li>When asking about reports always state Classic / IR</li>
    <li>Always post code snippets enclosed in a pair of &#123;code&#125; tags as explained in FAQ</li>
    </ul>
    I would like to know if it is possible to execute OS level commands, say executing any command in command prompt using Oracle APEX.If by OS you are referring to the client side, then NO.
    Cheers,

  • Looping through row selector exonentially duplicating

    Using Apex 4.2
    Background
    Created a Tabular Form based on a view. Removed all the default multi-row updates and deletions, buttons and processes.
    I am using a tabular form because of the fact that I can gain access to a row selector.
    The row data itself is all read only so in effect this is a report with a row selector.
    This is because I can't find a way to select a row an interactive report, well I can and did but this was a work around.
    Problem
    I have created a button to process the selector to run the below code:
    begin
    kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f01(1)) ;
    kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f02(1)) ;
       for i in 1..wwv_flow.g_f01.count
       loop
       kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'i:'||i) ;
          kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'WF ID:'|| wwv_flow.g_f02 (wwv_flow.g_f01.count)) ;
       end loop;
    end;
    I just wanted to see what would be output. For one row this works fantastically and I can find the ID based on the row
    When I select more than one row the loop run's through for the number of rows but then also runs for the number of rows selected.
    So if I selected threee rows this above procedure would run three times, each times looping three times.
    I have set the execution scope to: For Created and Modified Rows in the button condition that appears.
    Required
    I only want to loop through the selected rows once per button click
    OR
    Know which row I am currently looping through.
    Really would appreciate some kind of input here.

    I think the built in selector is making your life harder because the information that contains is 1,2,3,4,5.  You then need to map 3 to the ID of your 3rd row.
    So, if you check row 1 and 3, on submit, the row selector will have two rows, one with value of 1 and with with value of 3.
    I would remove the selector, use and ID column that I can change to be Simple Checkbox (or whatever value you can use to uniquely identify it).  Or add your own apex_item.checkbox(n, ID) to your SQL.
    Then your loop on apex_application.g_f01.count (if that's the checkbox column) will only contain the elements checked and their values will be the ID that are checked.
    All that said, here's a useful example from Denes Kubicek
    http://apex.oracle.com/pls/otn/f?p=31517:95
    Hope this makes sense
    Thanks
    -Jorge
    http://rimblas.com/blog/
    Message was edited by: jrimblas
    Added link to Denes example page

  • Looping through SQL statements in shell script

    Hello members,
    I'm working on the Solaris environment and the DB i'm using is Oracle 10g. Skeleton of what I'm attempting;
    Write a ksh script to perform the following. I have no idea how to include my sql query within a shell script and loop through the statements. Have therefore given a jist of what I'm attempting, below.
    1. Copy file to be processed (one file at a time, from a list of 10 files in the folder ).
    for i in *
               do
               cp $i /home/temp[/CODE]2 . Create a snapshot(n) table : Initialize n = 1 -- -- To create my snapshot table and inserts records in SQL
    create table test insert account_no, balance from records_all;3. Checking if the table has been created successfully:
    select count(*) from snapshot1 -- query out the number of records in the table -- always fixed, say at 400000
    if( select count(*) from snapshot(n) = 400000 )
    echo " table creation successful.. proceed to the next step "
    else
    echo " problem creating table, exiting the script .. "  4. If table creation is successful,
    echo " select max(value) from results_all " -- printing the max value to console
    5. Process my files using the following jobs:
    ./runscript.ksh - READ -i $m ( m - initial value 001 )
    ./runscript.ksh - WRITE -i $m ( m - initial value 001 -- same as READ process_id )
    -- increment m by 1
    6. Wait for success log
    tail -f log($m)* | -egrep "^SUCCESS"7. looping to step1 to :
    Copy file 2 to temp folder;
    create snapshot(n+1) table
    Exit when all the files have been copied for processing.
    done -- End of Step 1
    Pointers on getting me moving will be very valuable.
    thanks,
    Kris

    Hi,
    Are you inserting the data from file or from some table.
    If it is from file, I suggest sql loader would be better, I suppose.
    If it is from table, then something like this
    for i in *
               do
    sqlplus username/password@db_name<<EOF
                create table test select * account_no, balance from records_all;
    EOF
    exit
    doneAnurag

  • Issue in Upgrading Oracle APEX 2.1 to 3.1

    Hi,
    I have recently installed Oracle Database 10g Express Edition (Oracle Database XE) which includes Oracle Application Express (Oracle APEX) release 2.1
    I have upgraded from Oracle APEX 2.1 to 3.1 by following instructions in http://www.oracle.com/technology/products/database/application_express/html/3.1_and_xe.html
    Following is the sequence of steps I followed
    1. @apexins SYSAUX SYSAUX TEMP /i/
    2. @APEX_HOME/apex/apxldimg.sql APEX_HOME
    3. @APEX_HOME/apex/apxxepwd.sql password
    Now Oracle Database express home page changes to
    http://127.0.0.1:8080/apex/f?p=4550:1:723721796272276
    All gif logos are missing and font appears differently. More importantly nothing happens after entering workspace/username/password and clicking login button. I am using internet exlorer 7 and it says "Error on Page" on the bottom status bar.
    Please let me know if any one encounterd similar issue and if you were able to fix the issue.
    Thanks for your help
    RSNAIK

    Hello,
    For all of you who have the same problem that we had.
    After two installs and desinstall, I have finally found what to do.
    You must stop the OracleXETNSListener service when upgrading Oracle Database 10g Express Edition.
    Here the steps to follow assuming that you have installed Oracle Database 10g Express Edition into C:\oraclexe
    and unzipped apex_3.1.2 into C:\apex on a Windows XP System :
    1. On Windows XP, Startup Menu, go to the Configuration panel, open Administration Tools, open Services, then you will click on the OracleXETNSListener service, stop it.
    2. On Windows XP, Startup Menu, select Execute, type cmd and press OK to open a DOS window.
    3. At the DOS prompt, type cd apex.
    4. At the DOS prompt, type sqlplus /nolog
    5. At the SQL prompt, type connect SYS as SYSDBA
    6. Type the password of the user SYSTEM that you choose when installing Oracle XE.
    7. At the SQL prompt, type *@apexins SYSAUX SYSAUX TEMP /i/* (may take 15 minutes or more)
    8. At the DOS prompt, be sure to be in the apex directory (C:\apex) then type sqlplus /nolog
    9. At the SQL prompt, type connect SYS as SYSDBA
    10. Type the password of the user SYSTEM that you choose when installing Oracle XE.
    11. At the SQL prompt, type *@apxchpwd*
    12. Choose a password for ADMIN, type it then press Enter
    13. At the SQL prompt, type *@apxldimg* C:\ (you will perhaps obtain a message like an error but the upgrade works fine)
    14. At the SQL prompt, type *@apxxepwd* password (where password is the ADMIN password choosen at step 12)
    15. At the SQL prompt, type quit
    16. At the DOS prompt, type exit
    17. Then go to the OracleXETNSListener service and start it.
    To connect as ADMIN, type the url http://127.0.0.1:8080/apex/apex_admin
    username : ADMIN
    password : your admin password
    You will be able to create workspaces (schemas) and users
    Now you will be able to connect to APEX at http://127.0.0.1:8080/apex
    workspace : your login name (workspace created in apex_admin)
    username : your login name (user created in apex_admin)
    password : your password (password defined for the user in apex_admin)
    I hope that this steps will be clear for all of you.
    Thank you to user10570446 who have provided a clear step through. So that I'd take the time to clarified my solution to my type of configuration.
    I hope that RSNAIK has been able to make the upgrade to APEX 3.1.2.
    Good day to everyone
    Edited by: Practos on 2008-12-10 09:37

  • How to loop through XML data in a table of XMLType?

    Hi,
    I am failry new to xml document processing in Oracle using PL/SQL.
    My DB version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    I have successfully loaded an xml document into a table using the following two statements:
    1) CREATE TABLE mytable2 OF XMLType;
    2) INSERT INTO mytable2 VALUES (XMLType(bfilename('IMAGE_FILE_LOC', 'IFTDISB20100330172157C002.xml'), nls_charset_id('AL32UTF8')));
    Now I need to traverse through the various nodes within the xml document and extract values of elements of each node. The question I have is:
    How do I loop through a node? A VALID record is enclosed within the <checkItem> </checkItem> tags.
    Here is a snippet of the data in that xml document:
    ++++++++++++++++++++++++++++++++++++++++++++++++
    <?xml version="1.0" encoding="UTF-8"?>
    <bdiData>
    <documentControlInfo>
    <documentInfo>
    <docDescription>Check images and data for Test Company, account number 1234567890</docDescription>
    <docID>
    <ID>20100330172157</ID>
    </docID>
    <docModifier>Test Company</docModifier>
    <docCreateDate>2010-03-30</docCreateDate>
    <docCreateTime>17:21:57-0700</docCreateTime>
    <standardVersion>1.0</standardVersion>
    <testIndicator>0</testIndicator>
    <resendIndicator>0</resendIndicator>
    </documentInfo>
    <sourceInfo>
    <sourceName>The Bank IFT</sourceName>
    <sourceID>
    <idOther>TheBankIFT</idOther>
    </sourceID>
    </sourceInfo>
    <destinationInfo>
    <destinationName>Test Company</destinationName>
    <destinationID>
    <idOther>FEI3592</idOther>
    </destinationID>
    </destinationInfo>
    </documentControlInfo>
    <checkItemCollection>
    <collectionInfo>
    <description>Items</description>
    <ID>1269994919135</ID>
    <Classification>
    <classification>Items</classification>
    </Classification>
    </collectionInfo>
    <checkItemBatch>
    <checkItemBatchInfo>
    <description>Paid Checks</description>
    <ID>1269994919135</ID>
    <Classification>
    <classification>Paid Checks</classification>
    </Classification>
    </checkItemBatchInfo>
    <checkItem>
    <checkItemType>check</checkItemType>
    <checkAmount>86468</checkAmount>
    <postingInfo>
    <date>2010-03-29</date>
    <RT>10700543</RT>
    <accountNumber>1234567890</accountNumber>
    <seqNum>009906631032</seqNum>
    <trancode>001051</trancode>
    <amount>86468</amount>
    <serialNumber>300040647</serialNumber>
    </postingInfo>
    <totalImageViewsDelivered>2</totalImageViewsDelivered>
    <imageView>
    <imageIndicator>Actual Item Image Present</imageIndicator>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Front</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003260000738400851844567205_Front.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Rear</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003260000738400851844567205_Rear.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    </imageView>
    </checkItem>
    <checkItem>
    <checkItemType>check</checkItemType>
    <checkAmount>045</checkAmount>
    <postingInfo>
    <date>2010-03-29</date>
    <RT>10700543</RT>
    <accountNumber>1234567890</accountNumber>
    <seqNum>008518967429</seqNum>
    <trancode>001051</trancode>
    <amount>045</amount>
    <serialNumber>200244935</serialNumber>
    </postingInfo>
    <totalImageViewsDelivered>2</totalImageViewsDelivered>
    <imageView>
    <imageIndicator>Actual Item Image Present</imageIndicator>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Front</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003290000713900851896742901_Front.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Rear</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003290000713900851896742901_Rear.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    </imageView>
    </checkItem>
    <checkItemBatchSummary>
    <totalItemCount>1028</totalItemCount>
    <totalBatchAmount>61370501</totalBatchAmount>
    <totalBatchImageViewsDelivered>2056</totalBatchImageViewsDelivered>
    </checkItemBatchSummary>
    </checkItemBatch>
    <collectionSummary>
    <totalBatchCount>1</totalBatchCount>
    <totalItemCount>1028</totalItemCount>
    <totalCollectionAmount>61370501</totalCollectionAmount>
    <totalCollectionImageViewsDelivered>2056</totalCollectionImageViewsDelivered>
    </collectionSummary>
    </checkItemCollection>
    <documentSummaryInfo>
    <totalCollectionCount>1</totalCollectionCount>
    <totalBatchCount>1</totalBatchCount>
    <totalItemCount>1028</totalItemCount>
    <totalDocumentAmount>61370501</totalDocumentAmount>
    <totalDocumentImageViewsDelivered>2056</totalDocumentImageViewsDelivered>
    </documentSummaryInfo>
    </bdiData>
    ++++++++++++++++++++++++++++++++++++++++++++++++
    Any ideas and or suggestions will be greatly appreciated.
    Cheers!
    Edited by: user12021655 on Aug 3, 2010 1:25 PM

    I really need to update my blog to get the example you are looking for posted. I did a quick search on the forums for XMLTable and found a good example at {message:id=4325701}. You will want to use OBJECT_VALUE in the PASSING clause where you need to reference the column in your table.
    Note: See the FAQ in the upper right for how to use the tag to wrap objects to retain formatting.  Also your XML is missing closing nodes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Create XML file from Oracle DB

    Hi, I'm working in a task to create electronic billing for Mexico Rules, to do this; I need to create a XML source that will contain all the information requested from Oracle DB. For this reason, I'm looking how to create this XML file from Oracle DB

  • Long render times in Premiere CS6

    Hello everyone. I am exporting my first ever Premiere show. It is a 82 min. long program, HDV 1080i. Everything is rendered - the entire timeline is green. It took well over 2 hours to render, which seems excessive to me, though I did have filters on

  • Crystal Reports Group-by-Summarized Data on SAP-BW

    Hi experts I am facing some strange problem while building report aginst SAP-BW I have two groups of data set in crystal Reports Ist group is on Business Area 2nd Group is on Cost Element(under business Area) and (YTD- Amount) Across  Business Area a

  • Firefox 33 HTML select elements do not display correctly

    HTML form <select> elements do not display options correctly in Firefox 33. For example: <select id="field_4" class="mainForm" name="field_4"> <option value=""></option> <option value="submitted"></option> <option value="pending"></option> <option va

  • XML Data

    Hi, We are using the offline scenario for ADOBE forms integration with ABAP. The data will be in XML format. The steps I have done. 1) I have converted the XSTRING to string using FM CATT_CONV_XSTRING_TO_STRING.    CALL FUNCTION 'ECATT_CONV_XSTRING_T