Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLTOCursor Problem

Status
Not open for further replies.

Stan1243

Programmer
Jul 8, 2009
5
CA
Hello Experts,
I am using the following Command to convert a xml to cursor ;
XMLTOCURSOR("d:\test\HCAS0054_fmb_plsql.xml","ora2vfp",512)
There are no error but the result is a cursor with one Blank record.
Any help will be greatly appreciated.
Regards
Stanley
*************************************************************************************************************************************
The following is the Xml file. It looks jumbled up but if you open it in notepad++ or any other xml editor it will make more sense.
************************************************************************************************************************************
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Module xmlns=" <FormModule Name="HCAS0054">
<Block Name="CASE_NOTE">
<Item Name="CASE_NOTE_NO">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-ENTQRY" TriggerText="go_block('case_note_text'); &amp;#10;clear_block; &amp;#10;go_block('case_note'); &amp;#10;enter_query; &amp;#10;go_block('case_note_text'); &amp;#10;get_case_note_text; &amp;#10;go_block('case_note'); &amp;#10;if :case_note.case_note_no is null then &amp;#10; do_key('execute_query'); &amp;#10;end if;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" KeyboardHelpText="&lt;PRINT&gt;" Name="KEY-PRINT" TriggerText="-- if not HCX employee, prohibit faxing &amp;#10;if :company.m_user_location_no != 65 then &amp;#10; set_field('reprint_request.c_transmit_method_id',enterable,attr_off); &amp;#10; :reprint_request.c_transmit_method_id := 'PAPR'; &amp;#10;end if; &amp;#10;:reprint_request.c_no := :hcx_case.m_case_no; &amp;#10;:reprint_request.c_copy_count := 1; &amp;#10;go_field('reprint_request.c_destination_name');"/>
</Item>
<Item Name="CASE_NOTE_CATEGORY_ID">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="WHEN-VALIDATE-ITEM" TriggerText="if :case_note.case_note_category_id is not null then &amp;#10; begin &amp;#10; select descr, type_id &amp;#10; into :case_note.m_catg_descr, &amp;#10; :case_note.case_note_category_id &amp;#10; from ref_misc_code2 m2 &amp;#10; where m2.misc_code1_type_id = '0004' &amp;#10; and m2.active_ind = 'Y' &amp;#10; and type_id = :case_note.case_note_category_id; &amp;#10; exception when no_data_found then &amp;#10; bell; &amp;#10; message('Invalid Code, Press &lt;LIST&gt;'); &amp;#10; raise form_trigger_failure; &amp;#10; end; &amp;#10;end if;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-PREV-ITEM" TriggerText="if :system.block_status != 'QUERY' then &amp;#10; go_field('case_note.case_note_text'); &amp;#10;else &amp;#10; previous_field; &amp;#10;end if;"/>
</Item>
<Item Name="CASE_NOTE_TYPE_ID">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="WHEN-VALIDATE-ITEM" TriggerText="if :case_note.case_note_type_id is not null then &amp;#10; begin &amp;#10; select a.descr &amp;#10; into :m_type_descr &amp;#10; from ref_case_note_type a &amp;#10; where a.active_ind = 'Y' &amp;#10; and a.catgry_id = :case_note.case_note_category_id &amp;#10; and a.type_id = :case_note.case_note_type_id; &amp;#10; exception when no_data_found then &amp;#10; bell; &amp;#10; message('Invalid Code, Press &lt;LIST&gt;'); &amp;#10; raise form_trigger_failure; &amp;#10; end; &amp;#10;end if;"/>
</Item>
<Item Name="ACTIVITY_DATE">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="WHEN-VALIDATE-ITEM" TriggerText=":case_note.activity_date := conv_rr_date:)case_note.activity_date);"/>
</Item>
<Item Name="ACTIVITY_DURATION">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-NEXT-ITEM" TriggerText="if :system.record_status = 'QUERY' then &amp;#10; go_field('case_note.created_by'); &amp;#10;else &amp;#10; go_field('case_note.case_note_text'); &amp;#10;end if;"/>
</Item>
<Item Name="CASE_NOTE_TEXT">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="WHEN-NEW-ITEM-INSTANCE" TriggerText="set_field('case_note.case_note_text', echo, attr_on); &amp;#10;Edit_Field(1,10,80,13); &amp;#10;go_block('case_note_text'); &amp;#10;get_case_note_text; &amp;#10;go_field('case_note.case_note_text'); &amp;#10;set_field('case_note.case_note_text', echo, attr_off);"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-EDIT" TriggerText="set_field('case_note.case_note_text', echo, attr_on); &amp;#10;Edit_Field(1,10,80,13); &amp;#10;go_block('case_note_text'); &amp;#10;get_case_note_text; &amp;#10;go_field('case_note.case_note_text'); &amp;#10;set_field('case_note.case_note_text', echo, attr_off);"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-NEXT-ITEM" TriggerText="if :system.block_status != 'QUERY' then &amp;#10; do_key('Commit_Form'); &amp;#10;else &amp;#10; next_field; &amp;#10;end if;"/>
</Item>
<Item Name="CREATED_BY">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-PREV-ITEM" TriggerText="go_field('case_note.activity_duration');"/>
</Item>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="POST-QUERY" TriggerText="begin &amp;#10; select descr &amp;#10; into :case_note.m_type_descr &amp;#10; from ref_case_note_type &amp;#10; where type_id = :case_note.case_note_type_id &amp;#10; and catgry_id = :case_note.case_note_category_id; &amp;#10;exception when others then &amp;#10; :case_note.m_type_descr := '*** Desc Not Found ***'; &amp;#10;end; &amp;#10;begin &amp;#10; select descr &amp;#10; into :case_note.m_catg_descr &amp;#10; from ref_misc_code2 &amp;#10; where misc_code1_type_id = '0004' &amp;#10; and type_id = :case_note.case_note_category_id; &amp;#10;exception when others then &amp;#10; :case_note.m_catg_descr := '*** Desc Not Found ***'; &amp;#10;end; &amp;#10;get_user_name:)case_note.created_by,:case_note.m_create_name); &amp;#10;-- if this is an expanded denial, allow update to category and &amp;#10;-- type in order to correct erroneous note (SUPR/MGMT only) &amp;#10;if (:)case_note.case_note_category_id = 'EXPD' and &amp;#10; :case_note.case_note_type_id = 'DENN') or &amp;#10; :)case_note.case_note_category_id = 'OPRL' and &amp;#10; :case_note.case_note_type_id = 'OPRN')) and &amp;#10; :global.user_job_id in ('SUPR','MGMT') then &amp;#10; set_field('case_note.case_note_category_id',updateable,attr_on); &amp;#10; set_field('case_note.case_note_type_id',updateable,attr_on); &amp;#10;else &amp;#10; set_field('case_note.case_note_category_id',updateable,attr_off); &amp;#10; set_field('case_note.case_note_type_id',updateable,attr_off); &amp;#10;end if;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="PRE-INSERT" TriggerText=":case_note.case_note_no := null; &amp;#10;begin &amp;#10; select max(case_note_no) &amp;#10; into :case_note.case_note_no &amp;#10; from case_note &amp;#10; where case_no = :case_note.case_no; &amp;#10;exception &amp;#10; when others then &amp;#10; :case_note.case_note_no := null; &amp;#10;end; &amp;#10;if :case_note.case_note_no is null then &amp;#10; :case_note.case_note_no := 1; &amp;#10;else &amp;#10; :case_note.case_note_no := :case_note.case_note_no + 1; &amp;#10;end if; &amp;#10;-- if add CALO/PRO2 note, set indicator for possible update of status &amp;#10;if :case_note.case_note_category_id = 'CALO' and &amp;#10; :case_note.case_note_type_id = 'PRO2' then &amp;#10; if nvl:)global.case_status,'NEW') in ('NEW','QCVR','REOP') then &amp;#10; :global.fup_status := 'UTCP'; &amp;#10; end if; &amp;#10;end if;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-CREREC" TriggerText="go_block('create_note'); &amp;#10;clear_record;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-DOWN" TriggerText="if :system.cursor_field = 'CASE_NOTE.CASE_NOTE_NO' then &amp;#10; if :system.last_record != 'TRUE' then &amp;#10; down; &amp;#10; go_block('case_note_text'); &amp;#10; get_case_note_text; &amp;#10; go_block('case_note'); &amp;#10; -- if this is an expanded denial, allow update to category and &amp;#10; -- type in order to correct erroneous note (SUPR/MGMT only) &amp;#10; if (:)case_note.case_note_category_id = 'EXPD' and &amp;#10; :case_note.case_note_type_id = 'DENN') or &amp;#10; :)case_note.case_note_category_id = 'OPRL' and &amp;#10; :case_note.case_note_type_id = 'OPRN')) and &amp;#10; :global.user_job_id in ('SUPR','MGMT') then &amp;#10; set_field('case_note.case_note_category_id',updateable,attr_on); &amp;#10; set_field('case_note.case_note_type_id',updateable,attr_on); &amp;#10; else &amp;#10; set_field('case_note.case_note_category_id',updateable,attr_off); &amp;#10; set_field('case_note.case_note_type_id',updateable,attr_off); &amp;#10; end if; &amp;#10; else &amp;#10; message('At Last Record'); &amp;#10; end if; &amp;#10;else &amp;#10; null; &amp;#10;end if;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-EXEQRY" TriggerText="go_block('case_note_text'); &amp;#10;clear_block; &amp;#10;go_block('case_note'); &amp;#10;execute_query; &amp;#10;go_block('case_note_text'); &amp;#10;get_case_note_text; &amp;#10;go_block('case_note');"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-EXIT" TriggerText="-- if exit out of create a note, start over, don't exit form &amp;#10;if :system.record_status in ('NEW','INSERT') then &amp;#10; delete_record; &amp;#10; if :global.table_name is not null then &amp;#10; exit_case_notes; &amp;#10; elsif :global.case_note_count &gt; 0 then &amp;#10; do_key('execute_query'); &amp;#10; else &amp;#10; exit_case_notes; &amp;#10; end if; &amp;#10;else &amp;#10; exit_case_notes; &amp;#10;end if;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-NXTBLK" TriggerText="next_block; &amp;#10;:case_note_text.dummy := :case_note_text.m_case_note_text;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-UP" TriggerText="if :system.cursor_field = 'CASE_NOTE.CASE_NOTE_NO' then &amp;#10;-- if not at first record &amp;#10; if :case_note.case_note_no != :hcx_case.m_note_count then &amp;#10; up; &amp;#10; go_block('case_note_text'); &amp;#10; get_case_note_text; &amp;#10; go_block('case_note'); &amp;#10; -- if this is an expanded denial, allow update to category and &amp;#10; -- type in order to correct erroneous note (SUPR/MGMT only) &amp;#10; if (:)case_note.case_note_category_id = 'EXPD' and &amp;#10; :case_note.case_note_type_id = 'DENN') or &amp;#10; :)case_note.case_note_category_id = 'OPRL' and &amp;#10; :case_note.case_note_type_id = 'OPRN')) and &amp;#10; :global.user_job_id in ('SUPR','MGMT') then &amp;#10; set_field('case_note.case_note_category_id',updateable,attr_on); &amp;#10; set_field('case_note.case_note_type_id',updateable,attr_on); &amp;#10; else &amp;#10; set_field('case_note.case_note_category_id',updateable,attr_off); &amp;#10; set_field('case_note.case_note_type_id',updateable,attr_off); &amp;#10; end if; &amp;#10; else &amp;#10; message('At First Record'); &amp;#10; end if; &amp;#10;end if;"/>
</Block>
<Block Name="CASE_NOTE_TEXT">
<Item Name="M_CASE_NOTE_TEXT">
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-NEXT-ITEM" TriggerText="do_key('down');"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-PREV-ITEM" TriggerText="do_key('up');"/>
</Item>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-CREREC" TriggerText="go_block('create_note'); &amp;#10;clear_record;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-DOWN" TriggerText="if :case_note_text.dummy != :case_note_text.m_case_note_text then &amp;#10; bell; &amp;#10; :global.present_rec := :system.cursor_record; &amp;#10; get_case_note_text; &amp;#10; go_record:)global.present_rec); &amp;#10; message('Cannot Update Case Note Text'); &amp;#10;end if; &amp;#10;if :system.last_record != 'TRUE' then &amp;#10; down; &amp;#10; :case_note_text.dummy := :case_note_text.m_case_note_text; &amp;#10;else &amp;#10; message('At End of Note'); &amp;#10;end if;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-PRVBLK" TriggerText="if :case_note_text.dummy != :case_note_text.m_case_note_text then &amp;#10; bell; &amp;#10; get_case_note_text; &amp;#10; message('Cannot Update Case Note Text'); &amp;#10;end if; &amp;#10;previous_block; &amp;#10;:case_note_text.dummy := NULL;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-SCRDOWN" TriggerText="Scroll_down;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-SCRUP" TriggerText="Scroll_up;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-UP" TriggerText="if :case_note_text.dummy != :case_note_text.m_case_note_text then &amp;#10; bell; &amp;#10; :global.present_rec := :system.cursor_record; &amp;#10; get_case_note_text; &amp;#10; go_record:)global.present_rec); &amp;#10; message('Cannot Update Case Note Text'); &amp;#10;end if; &amp;#10;up; &amp;#10;:case_note_text.dummy := :case_note_text.m_case_note_text;"/>
</Block>

<ProgramUnit Name="CHECK_PACKAGE_FAILURE" ProgramUnitText="-- Procedure to check the status of the form &amp;#10;procedure check_package_failure is &amp;#10;begin &amp;#10; if not form_success then &amp;#10; raise FORM_TRIGGER_FAILURE; &amp;#10; end if; &amp;#10;end;" ProgramUnitType="Procedure"/>
<ProgramUnit Name="CHANGE_CASE" ProgramUnitText="-- Procedure to change Upper/Lower case into init cap &amp;#10;-- IF the name is entered in upper of lower case it is changed into &amp;#10;-- Initial caps. Call change_case:)block.field) &amp;#10;-- Possible use in on-validate-field, post-field or key triggers. &amp;#10;-- Author : Dale Hughes. &amp;#10;Procedure change_case(input IN OUT VARCHAR2) is &amp;#10;Begin &amp;#10;IF (input = upper(input)) OR &amp;#10; (input = lower(input)) then &amp;#10; input := initcap(input); &amp;#10; Message('Name has been CHANGED to initial capitalization format'); &amp;#10;END IF; &amp;#10;End;" ProgramUnitType="Procedure"/>
<ProgramUnit Name="ABENDFORM" ProgramUnitText="-- Procedure Abendform is used to display the error report and quit of &amp;#10;-- the process. &amp;#10;Procedure AbendForm IS &amp;#10; query VARCHAR2(2400); &amp;#10; nbr NUMBER; &amp;#10;BEGIN &amp;#10; :global.block_status := :SYSTEM.block_status; &amp;#10; :global.current_block := :SYSTEM.current_block; &amp;#10; :global.current_field := :SYSTEM.current_field; &amp;#10; :global.current_form := :SYSTEM.current_form; &amp;#10; :global.current_value := :SYSTEM.current_value; &amp;#10; :global.cursor_block := :SYSTEM.cursor_block; &amp;#10; :global.cursor_field := :SYSTEM.cursor_field; &amp;#10; :global.cursor_record := :SYSTEM.cursor_record; &amp;#10; :global.cursor_value := :SYSTEM.cursor_value; &amp;#10; :global.form_status := :SYSTEM.form_status; &amp;#10; :global.last_record := :SYSTEM.last_record; &amp;#10; :global.message_level := :SYSTEM.message_level; &amp;#10; :global.record_status := :SYSTEM.record_status; &amp;#10; :global.trigger_block := :SYSTEM.trigger_block; &amp;#10; :global.trigger_field := :SYSTEM.trigger_field; &amp;#10; :global.trigger_record := :SYSTEM.trigger_record; &amp;#10; nbr := ERROR_CODE; &amp;#10; :global.error_code := to_char(nbr); &amp;#10; :global.error_text := ERROR_TEXT; &amp;#10; :global.error_type := ERROR_TYPE; &amp;#10; nbr := MESSAGE_CODE; &amp;#10; :global.message_code := to_char(nbr); &amp;#10; :global.message_text := MESSAGE_TEXT; &amp;#10; :global.message_type := MESSAGE_TYPE; &amp;#10; nbr := SQLCODE; &amp;#10; :global.sqlcode := to_char(nbr); &amp;#10; :global.sqlerrm := SQLERRM; &amp;#10; query := SUBSTR:)SYSTEM.LAST_QUERY,1,2400); &amp;#10; :global.last_query := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query1 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query2 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query3 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query4 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query5 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query6 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query7 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query8 := SUBSTR(query,1,240); &amp;#10; query := SUBSTR(query,241); &amp;#10; :global.last_query9 := SUBSTR(query,1,240); &amp;#10; CLEAR_FORM(NO_COMMIT); &amp;#10; NEW_FORM('quit_form'); &amp;#10;EXCEPTION &amp;#10; WHEN OTHERS &amp;#10; THEN &amp;#10; CLEAR_FORM(NO_COMMIT); &amp;#10; NEW_FORM('quit_form'); &amp;#10;END;" ProgramUnitType="Procedure"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="false" FireInQuery="false" Name="POST-FORM" TriggerText="-- update global case note count &amp;#10;count_case_notes(to_number:)global.case_no),:hcx_case.m_note_count); &amp;#10; :global.case_note_count := :hcx_case.m_note_count;"/>
<Trigger DirtyInfo="true" DisplayInKeyboardHelp="true" FireInQuery="false" Name="KEY-COMMIT" TriggerText="if :system.block_status != 'QUERY' then &amp;#10; if :case_note.case_note_category_id is null then &amp;#10; bell; &amp;#10; go_field('case_note.case_note_category_id'); &amp;#10; message('Case note category has to be entered'); &amp;#10; raise form_trigger_failure; &amp;#10; end if; &amp;#10; if :case_note.case_note_type_id is null then &amp;#10; bell; &amp;#10; go_field('case_note.case_note_type_id'); &amp;#10; message('Case note type has to be entered'); &amp;#10; raise form_trigger_failure; &amp;#10; end if; &amp;#10; if :case_note.case_note_text is null then &amp;#10; bell; &amp;#10; go_field('case_note.case_note_text'); &amp;#10; message('Case note text has to be entered, '|| &amp;#10; ' Press &lt;EDIT&gt; to enter text.'); &amp;#10; raise form_trigger_failure; &amp;#10; end if; &amp;#10; go_block('save_note'); &amp;#10; clear_record; &amp;#10;else &amp;#10; do_key('key_exit'); &amp;#10;end if;"/>

</FormModule>
</Module>
 
XMLToCursor is to convert tabular data in XML format to a cursor. No more, no less. The XML you show is an Oracle Form Module, this is not data, this is a form.

This cannot work out, neither with XMLToCursor nor if doing that manually.

A cursor is a table, a table has columns and rows, and the columns of a table can only hold the same type of value, each column has a fieldtype. This general table schema does not fit on this XML o vice versa.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top