Generating an XML formated text file
Hi all
I am a PL/SQL programmer and have no idea about XML :-(
I am using ORACLE 10g and my application generates atleast 100 text files a day for customers. These files are manipulated using Utl_File package and gets data from the DB.These files are tab or comma delimeted. Now company wants to give an option to customers to get the same output in XML format. My understanding is that I need to get information from customers first to make the report template for them and then use some XML parser to get data from DB and give an output using that customer's specific template.
I wanna know, if there is any whitepaper or manual that can guide me step by step. I just need to make an idea how the things can go togather and the sequence of operation. I also wanna use only PL/SQL and not Java at this time.
Rashid
Message was edited by:
rashid68
check it out at http://www.orafaq.com/faqxml.htm
Similar Messages
-
Generate a report in text file format
Hello Experts,
I need to write a program to generate a report in a text file format which is later saved on a directory in the application server. I have the fields with the sources defined and also the filters, selections, rows and columns. For example:-
0company code (US) as the filter, 0CALDAY as the selection, CUSTNAM as the object in the row with sources coming from BUKRS and ZSD_CCUST. Can someone initiate or direct me to an already existing forum or throw some light on the issue.
Thanks,Hi,
As mentioned above, the Open Hub service allows to extract data from an InfoCube/ODS/InfoObject and then store it a database table or flat file stored in the application server. You can start in transaction RSBO and create an InfoSpoke there.
To schedule an extraction using an InfoSpoke, you need to place it in a process chain. -
Convert XML to text file and sending the same via Mail receiver adapter
Dear All,
I have a requirement like....
I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
the converted file needs to be sent to a mail address in text format.
Any body has idea how to achieve this?
Thanks in advance for your help.
Regards
Hari>
HP CReddy wrote:
> Dear All,
>
> I have a requirement like....
>
> I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
> the converted file needs to be sent to a mail address in text format.
>
> Any body has idea how to achieve this?
>
> Thanks in advance for your help.
>
> Regards
> Hari
use the StructXML2Plain or XML2Plain from the standard MessageTransformBean
Add the module to you Mail adapter before the mail adapters standard module itself
Ref: http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm -
Can I create a xml or text file?
Hi,
I would like to be able to create a text file or xml file
using users input(this is not for a web site so do have server
capabilities)
The file will be smiler to this with the user input in {}
Thanks for all your helpHey there,
Flash being a web based application doesnt allow writing any
files other than temp cookies or the ASO files. Now these files are
useless for the medium you are describing here.
Due to security reasons flash doesnt support XML/Text
writing, but has very good support on the reading XML/Text file. If
you are using the idea for a website then, maybe PHP, ASP along
with SQl might help you save data from flash to a database. And if
you have ideas of keeping this idea desktop based, maybe you can
use MDM Zinc, even PHP, or Visual Studio (where ExternalCallbacks
can be used).
You can decide. -
OMB Plus : how to get all the generated messages into a text file ?
Hello,
I wrote an OMB TCL script and I would like to know how to get all the messages generated during the exécution into a text file.
I tried this, but it works only for a puts command :
set DesProjet ACT_1
set filename [ open "c:\\temp\\INFDE_010_IMPORT_REPOSITORY_$DesProjet.log" w]
puts "test"
Thank you for your helpHello Alain, you should try the OMBLOG variable. If you set it inside OMBPlus:
set OMBLOG c:/temp/mylog.txtthen all the OWB specific commands are logged with their output. By OWB specific I mean all those that start with OMB.
This is more than what you see in the interface, because:
- messages inside procedures are logged; you wouldn't see them on std.output when you call a proc
- variables are resolved, so if you issue the command
set my_var VERY_IMPORTANT_TABLE
OMBDROP TABLE '$v_myvar'the log will show:
OMBDROP TABLE 'VERY_IMPORTANT_TABLE'
Table dropped
and you know something is wrong... so OMBLOG is very useful to intercept all manipulations on you repository.
If what you want instead is a dump of the screen output when you execute a script, I suggest you redirect standard output from the operating system command line. Unfortunately OMBPlus doesn't support all advanced redirection and tracing features of the TCL language.
Hope this helps, Antonio -
Safari showing xml as text file
My iPad Safari shows xml file as text. No tags or tree structure is show'n, only text between tags. Same problem with Chrome on iPad. What's wrong?
Nothing is wrong. That is the way that Safari displays XML by default.
-
How to store multiple format text file in a oracle table
Hi,
I want to store a file which has multiple format for field separation so is it possible in Oracle data integrator if yes then how .....
Waiting for reply
regards
palashHello,
<p>Read this article.</p>
Francois -
Generate dummy XML for an empty input text file
Hi All,
i know when XI gets an empty input text file, it does not generate a send message for it in sender communication channel.
in my scenario, if i get a file with data, i have to generate an XML message for it using file content conversion - this i have done...........
but if i get an empty text file, then i have to generate a dummy XML send message for it for my BPM.......
<b>Has anybody generated a dummy XML message for an empty input file........please respond only if you have practically generated a XML message in SXMB_MONI for an empty input text file.</b>
Thanks,
Rajeev GuptaHi All,
i made a J2EE adapter module to generate dummy xml for empty file.....but when i give a file with data in it, then my adapter module is called..... but when i give an empty file, then my adapter module is not called.........
so if somebody has practically generated a dummy XML for an empty file by any method, please tell.
Thanks,
Rajeev Gupta -
File name to be generated from outbound text file data
Hi Experts,
I am collecting IDOCs and generating IDOC-XML(for IDOCS) file and sending it to PI 7.0 using sender file adapter.
This is File to File scenario.
IDOC-XML file picked by sender file adapter gets transformed using XSL mapping in to .dat(text) file.
Sample Output of .dat file (target file)
STR SE 2008-10-3011:13:00$SEQ
EIH21148862 D2008102820081127SEK000000894800000000894800000000000000 0000XYZ co Ltd KL25533781 2114886209 335592 2508867
EIL21148862 0000000000000000100000000000020081021 335592 20081010KILLL899 Operating System
Now I want output file name to be: ABC_DEF_cc_yyyymmdd_segno.dat
ABC_DEF is constant
cc - means country code, in this case it should be "SE", which is marked in bold immediately after STR.
yyyymmdd - date format
segno - which means no of records like number of lines in text file, (say three records: STR, EIH, EIL)
Please feel free for any clarifications required.
I hope I am able to explain scenario.
I would really appreciate if you can help me with your valuable inouts.
Thanks,
Divyeshhi,
just put one more mapping as the last mapping in your interface mapping
it can be abap or java mapping
then as per this blog fill out Filename attribute which will set the file name
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
you can parse the whole IDOC structure in tthose mappings to get all the data you need for the filename
this is the easiest way I'd say
Regards,
Michal Krawczyk -
DME file in XML format in SAP 4.6C
Hi Experts,
For a Belgium client, I have a requirement to generate DME file in XML format for payments made to foreign and domestic vendors. I want to know the following,
1. Can DME file be generated in XML format using classic payment medium programs RFFOBE_E and RFFOBE_I.
2. If not why and what are the other options.
3. I also came to know that there is an options of using Payment medium workbench - through XML format trees BE_BEPDTA and BE_PIBDTA. But since we are in 4.6C, i am not able to create a payment format. Is there any support package or patch that is required.
4. I tried for SEPA_CT - again a XML format tree but was not very successful as that too was not available in SAP 4.6C. Is there any way that I can get this done in 4.6C - any support packages or patches available?
ThanksHi Kaylan,
could you please share that documentation with me too.
Thanks, Regards,
Alex Cardona -
Help on converting xml file to text file
Hi,
I have xml file and i want to convert to text file ...
How do i write a perticular tag in perticular line by the time converting xml to text file using xsl ...
Ex:
input XML file:
<NAME> venkat </NAME>
<ADDRESS>
5800 Lander Brook Drive
</ADDRESS>
output ASCII File:
245 venkat
300 5800 Lander Brook Drive
In this example TAG <NAME> should write into line 245 and
TAG <ADDRESS> should write into line 300 etc...
here is the xsl file to above xml file ..
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<xsl:value-of select="Name"/>
<xsl:value-of select="Address"/>
</xsl:template>
</xsl:stylesheet>
how do i write Name value in line number 245 in the text file , similarlly how do i write Address value in line number 300 in the text file ...
How do i specify the value has to go to a perticular line ... i know name has to goto some line number, address to some line number etc ,,,
Any help on this please .....
Thanks.sorry read: XSL.
you will have to create your own tool to generate your text file in order to truly ensure the position of your data in the text file. -
How to generate reports in text file without totals
Hi!!!
Does anybody knows how can I generate a report in text file
(separated by |), but without the lines with totalizations ?
In my application, the user can choose if he wants the output
in HTML,PDF or a text file. So, the solution to this question
must be implemented in code.
Thanks a lot,
Anderson.If you put a formatting trigger on any item or frame and return FALSE, it will disappear.
So the totals need to be within a frame which has a trigger which returns false if text file is chosen. -
Generating Text file from table using Shell script
I am using KSH for generating and FTPing a text file from a table.
While generating Text file I am not getting my Column names in orderly manner.
q2="select COLUMN1||' '||COLUMN2||' '||COLUMN3 from table1;"
set pagesize 0
set head off
set trimspool on
set trimout on
set colsep ' '
set linesize 1500
set trimspool on
spool /ss/app11/oastss/reports/$file2
select 'COLUMN1'||' '||'COLUMN2'||' '||'COLUMN3' from dual;
$q2
spool off;
EOF
I am getting the result some what like below in text file
COLUMN1 COLUMN2 COLUMN3
MALLIK_ACCT 17-SEP-11 908030482
MALLIK_ACCT 17-SEP-11 908266967
MALLIK_ACCT 17-SEP-11 909570766
I want the format like below
COLUMN1........ COLUMN2 .... COLUMN3
MALLIK_ACCT ...17-SEP-11 .... 908030482
MALLIK_ACCT ...17-SEP-11 .... 908266967
MALLIK_ACCT ...17-SEP-11 .... 909570766
I put dots(.) for illustration purpose.
column data length may icrease some times . it shoudl automatically adjust column and data so that they are in alignment. thanks in advance.Mallik wrote:
Hi my question is to format the headers so that they will be in alignment with column data and readable.So you want to output a query as a fixed width format data file? How about this (rather than using scripts)...
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
,p_dir IN VARCHAR2
,p_header_file IN VARCHAR2
,p_data_file IN VARCHAR2 := NULL) IS
v_finaltxt VARCHAR2(4000);
v_v_val VARCHAR2(4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.DESC_TAB;
col_num NUMBER;
v_fh UTL_FILE.FILE_TYPE;
v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
c := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
d := DBMS_SQL.EXECUTE(c);
DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
ELSE
DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
END CASE;
END LOOP;
-- This part outputs the HEADER
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 2 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 12 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
IF NOT v_samefile THEN
UTL_FILE.FCLOSE(v_fh);
END IF;
-- This part outputs the DATA
IF NOT v_samefile THEN
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
END IF;
LOOP
v_ret := DBMS_SQL.FETCH_ROWS(c);
EXIT WHEN v_ret = 0;
v_finaltxt := NULL;
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
v_finaltxt := v_finaltxt||rpad(nvl(v_v_val,' '),rec_tab(j).col_max_len,' ');
WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_n_val,'fm99999999999999999999999999999999999999'),' '),rec_tab(j).col_max_len,' ');
WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),' '),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
END LOOP;
UTL_FILE.FCLOSE(v_fh);
DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.csv file contains:
empno ename job mgr hiredate sal comm deptno
7369 SMITH CLERK 7902 17/12/1980 00:00:00800 20
7499 ALLEN SALESMAN 7698 20/02/1981 00:00:001600 300 30
7521 WARD SALESMAN 7698 22/02/1981 00:00:001250 500 30
7566 JONES MANAGER 7839 02/04/1981 00:00:002975 20
7654 MARTIN SALESMAN 7698 28/09/1981 00:00:001250 1400 30
7698 BLAKE MANAGER 7839 01/05/1981 00:00:002850 30
7782 CLARK MANAGER 7839 09/06/1981 00:00:002450 10
7788 SCOTT ANALYST 7566 19/04/1987 00:00:003000 20
7839 KING PRESIDENT 17/11/1981 00:00:005000 10
7844 TURNER SALESMAN 7698 08/09/1981 00:00:001500 0 30
7876 ADAMS CLERK 7788 23/05/1987 00:00:001100 20
7900 JAMES CLERK 7698 03/12/1981 00:00:00950 30
7902 FORD ANALYST 7566 03/12/1981 00:00:003000 20
7934 MILLER CLERK 7782 23/01/1982 00:00:001300 10
The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required (this is currently coded for VARCHAR2, NUMBER and DATE) -
Create XML format file in bulk insert with a data file with out delimiter
Hello
I have a date file with no delimiter like bellow
0080970393102312072981103378000004329392643958
0080970393102312072981103378000004329392643958
I just know 5 first number in a line is for example "ID of bank"
or 6th and 7th number in a line is for example "ID of employee"
Could you help me how can I create a XML format file?
thanks alotThis is a fixed file format. We need to know the length of each field before creating the format file. Say you have said the first 5 characters are Bank ID and 6th to 7th as Employee ID ... then the XML should look like,
<?xml version="1.0"?>
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1"xsi:type="CharFixed"LENGTH="5"/>
<FIELD ID="2"xsi:type="CharFixed"LENGTH="2"/>
<FIELD ID="3" xsi:type="CharFixed" LENGTH="8"/>
<FIELD ID="4" xsi:type="CharFixed" LENGTH="14"/>
<FIELD ID="5" xsi:type="CharFixed" LENGTH="14"/>
<FIELD ID="6" xsi:type="CharFixed" LENGTH="1"/>
</RECORD>
<ROW>
<COLUMNSOURCE="1"NAME="c1"xsi:type="SQLNCHAR"/>
<COLUMNSOURCE="2"NAME="c2"xsi:type="SQLNCHAR"/>
<COLUMN SOURCE="3" NAME="c3" xsi:type="SQLCHAR"/>
<COLUMN SOURCE="4" NAME="c4" xsi:type="SQLINT"
/>
<COLUMN SOURCE="5" NAME="c5" xsi:type="SQLINT"
/>
</ROW>
</BCPFORMAT>
Note: Similarly you need to specify the other length as well.
http://stackoverflow.com/questions/10708985/bulk-insert-from-fixed-format-text-file-ignores-rowterminator
Regards, RSingh -
HP Officejet 6700 installed desktop program displays xml text files when run
Afer installing the printer software and drivers on 64 bit Windows 7 Pro, the desktop shortcut and start menu entry "HP Officejet 6700" returns xml code text files . When the icon is first clicked a window asks me to choose which installed printer, then displays two xml files. The first file is titled "HPSPProgress" the second "HPSolutionPortal" using windows notepad.
The shortcut points to the following:
"C:\Program Files\HP\HP Officejet 6700\Bin\HP Officejet 6700.exe" -Start UDCDevicePage
The printer drivers and web based access run fine, and the desktop installed HP Scan program runs fine too. All printer functions work correctly. But this one desktop installed program will not run.
I have uninstalled, rebooted and re-installed multiple times as administrator and with various compatibility settings with no success. I have tried to install from CD as well as over the internet with the same result.
Advice please.
This question was solved.
View Solution.Hey,
I would advise running the patch fix posted by Kyle_W in the 4th message of the thread linked below.
http://h30434.www3.hp.com/t5/Notebook-Operating-Systems-e-g-Windows-8-and-Software/officejetpro-8600...
Let me know if this fixes your issue,
Jason
-------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
I am not an HP employee.
Maybe you are looking for
-
Trackpad zoom not working in photoshop
I have photoshop CS3 - and all other adobe CS3 programs. For whatever reason, the zoom in/out on the magic track pad doesn't work. Other function like pan/scroll work. In other applications, like preview zoom in/out on the track pad does work. Is it
-
HT201328 Does my computer need to be connected to the internet when I unlock my iPhone?
Does my computer need to be connected to the internet when I unlock my iPhone?
-
Have a quick question. How can you load an image to a dynamic text box from xml using a txt file and loadvars if you have html tags it will display &photo1 = <img src="photo1.jpg"/>&done=-1 var loadstuff = new LoadVars(); loadstuff.onLoad = function(
-
Essbase Add in Connection issues
Hi guys, My set up is this: Windows 7 64 bit with Ofifice 2010. I've installed Essbase but when when I hit connect in Excel, nothing happens. Hitting the other selecttions such as 'Query Designer' activates the other forms, just noting happens when I
-
How to stop ManagedClient from crashing my MBP when in sleep mode?
Since upgrading my Early 2011 MBP to Mavericks (now 10.9.1) it has a tendency to crash while in sleep mode. By "crash" I mean very loud fan activity - disturbing especially during night time. Sometimes the crash is so serious that when I click the t