XMLNode is truncating the data
Hello Everyone,
I am using the below logic to print the data from the XMLNode.
XMLNode xmlNode = (XMLNode) am.invokeMethod("getEmpDataXML");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
xmlNode.print(outputStream);
System.out.println(outputStream.toString())
In the output, one of the columns data should be
"COMPENSATORY TIME/MANDATORY PD CREDIT" but its printing it as "COMPENSATORY TIME/MANDATORY PD C"
The last 4 letters are truncated. I don't know why its happening. Any advice would be really great.
getEmpDataXML method contains the following code:
public XMLNode getEmpDataXML()
OAViewObject vo = (OAViewObject)findViewObject("AbcVO");
XMLNode xmlNode = (XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
return xmlNode;
Thanks
Check the VO attribute length in VO wizard in Jdev. Increasing the varchar length should fix the issue.
--Mukul
Similar Messages
-
System automatically truncating the data
hi Friends,
i am using jdeveloper 11.1.1.6.0.
i have created field called price it's length is Number(22,12) . whenever user is giving more than 22 digits system is truncating the 22 digit to fractional number.
ex:user input: 1234567980123456789012
system showing: 1.234567980123 .
is there any solution for the above problem.Hi Johon,
1. Change in your vo query to fetch the price column once more time like price1
2. Change the type from number to string
I think my adf concept are good.
The idea behind this approach is that he has already tried your intelligent suggestion but not working.
I have already faced this problem and solved the same using the technique I shared over this forum.
Please read this to know why system automatically truncating the data
3.1 n-bit Unsigned Integers section
n Minimum Maximum
8 0 (2^8)-1 (=255)
16 0 (2^16)-1 (=65,535)
32 0 (2^32)-1 (=4,294,967,295) (9+ digits)
64 0 (2^64)-1 (=18,446,744,073,709,551,615) (19+ digits)
and your trying to save 22 digits.How it is possible?
Got it?
http://www.ntu.edu.sg/home/ehchua/programming/java/DataRepresentation.html
Edited by: 812903 on Mar 21, 2013 11:32 PM
Edited by: 812903 on Mar 21, 2013 11:43 PM -
The AppleWorks Spreadsheet just started giving me the message "attempting to paste cells off the document bounds. Truncate the data to fit?". What settings should I look at to continue the page vertically?
Go to Format > Document... & set the number of rows and/or columns you need then paste.
-
TO_TIMESTAMP Truncating the date
Oracle Version: 10.2.0.4
Why is to_timestamp function truncating sysdate (to 12:00 AM) ?
SQL > select value from nls_session_parameters where parameter='NLS_DATE_FORMAT';
VALUE
DD-MON-RR
SQL > select to_timestamp(Sysdate) From dual;
TO_TIMESTAMP(SYSDATE)
28-JUL-10 12.00.00 AMDocumentation
http://youngcow.net/doc/oracle10g/server.102/b14200/functions193.htm#sthref2021
is only talking about CHAR, VARCHAR2, NCHAR, or NVARCHAR2 as input datatypes. Is this the reason?
I just wanted to see Time quickly in SQL*Plus without having to set NLS_DATE_FORMAT every time.Thank you Frank. Thats just what i need.
Ajay,
The timestamp format was already set
SQL > select value from nls_session_parameters where parameter='NLS_TIMESTAMP_FORMAT';
VALUE
DD-MON-RR HH.MI.SSXFF AM
SQL > SELECT SYSTIMESTAMP FROM DUAL;
SYSTIMESTAMP
28-JUL-10 11.36.33.855765 PM +01:00Thanks everyone. -
When you run a stored procedure which loads a table,will it automatically truncate the data in the table before doing a load or the DBA has to truncate the data.
Hi,
SQL> CREATE TABLE test2222 (testcol VARCHAR2(20));
Table created.
SQL>
SQL> desc test
Name Null? Type
A NUMBER(19)
B NOT NULL NUMBER
SQL>
SQL> INSERT INTO test2222 VALUES ('ABC');
1 row created.
SQL> INSERT INTO test2222 VALUES ('DEF');
1 row created.
SQL> INSERT INTO test2222 VALUES ('xyz');
1 row created.
SQL> COMMIT;
Commit complete.
SQL>
SQL> SELECT * FROM test;
no rows selected
SQL>
SQL> BEGIN
2 EXECUTE IMMEDIATE 'TRUNCATE TABLE test2222';
3 END;
4 /
PL/SQL procedure successfully completed.
SQL>test is existing in DB....you can test with test2222;
- Pavan Kumar N
Edited by: Pavan Kumar on Oct 1, 2008 1:55 AM -
In Read_text FM, the data after 256 characters gets truncated
Hi All,
In this FM, the internal table can't have string type field. In my case the data is in multiple lines of internal table and I am concatenating into a single field which is of type DESCRIPTIONS(string). I am passing this data to a table in smartform.Only 255 characters are printed, remaining data gets truncated. I am using CONVERT_OTF and SX_TABLE_LINE_WIDTH_CHANGE FMs to create PDF. Is it the limitation or I am incorect here?Your posting title is misleading; there's nothing wrong with FM READ_TEXT. Yes, it returns a table of type TLINE, as you've noted. Perhaps you could close this post and repost in FORM PRINTING with an appropriate title like: Can't show more than 255 characters of text.....but search first, because you cannot be the first person to encounter this limitation.
-
Truncating leading zeros for the data
hi ,
I am doing a conversion project from oracle source system(DB2) to BI system. I have a situation here:
I am extracting material numbers from source system(DB2) into a ZXXXX characteristic and in the transfer structure i checked the conversion as well and for infoobject ZXXXX, i am using ALPHA conversion. but the data i get is truncating material numbers. For example, 050302 is coming as 50302 and truncating leading zero. I am not sure what needs to be done here.
Please advise..
Thanks in advance...Hi J Dorson,
This is the expected bahaviour if your InfoObject is configured to have ALPHA conversion. If the zero's in front of the material number is needed, then turn-off ALPHA conversion in your InfoObject (e.g. by removing the conversion exit). -
Hi,
I work on a migration project : Sybase to Oracle 10g.
There are a lot of request INSERT writed in Sybase with data too long to be insert in a table.
Example :
create table MyTable (txt varchar(10))
insert into MyTable values ('AAAAAAAAAAAAAAAAA');
So, i have lot of error ORA-12899 ...
With Sybase, there isn't error because the data are automaticly truncated.
Does it exist an option with Oracle to have the same behavior ? Without option, i have to add substr in many request.
Any idea ?Here is another possibility you may want to consider,
1. make the column generously large, enough that you can be sure it accommodates the longest string.
2. load the data
3. once the data is loaded write a simple query that tells you the length of the longest string that got loaded in the column
4. alter the column to be of a more reasonable size considering step 3.
This way, no need to substr everywhere and truncate values that should not have been truncated in the first place. If you do need to end up truncating the values, it will still be easier to do it once the data is loaded in a table than it is to cherrypick statements to modify in script.
HTH,
John. -
How can I truncate the time zone from a Date object without using String?
Does anyone know how to truncate the time zone portion of a Date object and maintain the object as Date, NOT String?
I just need the date, i.e., 05/02/2008 as a Date.
Thanks.
JDev1Although you haven't said so, I expect you must be having some problem with that?
My wild guess: the server is creating a Date object and setting its time component to zero (midnight). Of course since Date doesn't have a timezone, that would be midnight in the server's timezone. Then you are interpreting that date as if it were in your timezone, and since you are west of the server, it appears to be 11 PM or 9 PM or something on the day before.
What we do is to send our timezone to the server and tell the server to use it when creating the Date object. Alternatively, when formatting the Date object you could use a SimpleDateFormat with the server's timezone applied. There are no doubt other solutions that could be provided if we had a description of your problem. -
Adding one day to a oracle.jbo.domain.Date and truncating the time part
JDev 11.1.1.4.0
Hello
I need to add a day to oracle.jbo.domain.Date and get back a oracle.jbo.domain.Date without the time part.
So far I've got
Date valueDate = (Date)rowCpt.getAttribute("ValueDate");
Calendar cal = Calendar.getInstance();
cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
cal.add(Calendar.DATE, 1);
Date newDate = new oracle.jbo.domain.Date(new Timestamp(cal.getTime().getTime()));This adds 1 day to the date but keeps the time part of the date.
How do I get rid of the time part of the date ?
Thanks
PaulThe Calendar class allows you to set or clear each field.
Date valueDate = (Date)rowCpt.getAttribute("ValueDate");
Calendar cal = Calendar.getInstance();
cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
cal.add(Calendar.DATE, 1);
cal.clear(Calendar.HOUR);
cal.clear(Calendar.MINUTE);
cal.clear(Calendar.SECOND);
cal.clear(Calendar.MILLISECOND);
Date newDate = new oracle.jbo.domain.Date(cal.getTimeInMillis());should work.
Timo -
Truncate byte array of UTF-8 characters without corrupting the data?
Hi all,
I need to be able to determine if the byte array, which is truncated from the original byte array representing UTF-8 string, contains corrupted character. Knowing if the byte array contains corrupted character allows me to remove it from the truncated array.
As in the sample code below, when truncate the string with 16 bytes it displays ok. However, truncate with 17 bytes, the last character is corrupted. Is there a way to check to see if the character is corrupted so that it can be removed from the truncated byte array?
Thanks in advance,
Phuong
PS: The Japanese characters I chose it randomly from Unicode charts. I don't know their meaning so if it is offensive, please forgive me.
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.UnsupportedEncodingException;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
public class TestTruncateUTF8 extends JFrame
private static final long serialVersionUID = 1L;
private JTextArea textArea = new JTextArea(5,20);
private JLabel japanese = new JLabel("Japanese: " + "\u65e5\u672c\u3041\u3086\u308c\u306e");
* @param args
public static void main(String[] args)
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run()
JFrame frame = new TestTruncateUTF8();
frame.setVisible(true);
public TestTruncateUTF8()
super("Test Truncated");
JButton truncate17Button = new JButton("Truncate 17 bytes");
truncate17Button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
truncates(17);
JButton truncate16Button = new JButton("Truncate 16 bytes");
truncate16Button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
truncates(16);
JPanel panel1 = new JPanel();
panel1.setLayout(new BoxLayout(panel1, BoxLayout.Y_AXIS));
panel1.add(japanese);
panel1.add(truncate16Button);
panel1.add(truncate17Button);
panel1.add(new JScrollPane(textArea));
this.setLayout(new BorderLayout());
this.add(panel1, BorderLayout.CENTER);
this.pack();
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
private void truncates(int numOfBytesToTruncate)
try
byte[] bytes = japanese.getText().getBytes("UTF-8");
byte[] newBytes = new byte[numOfBytesToTruncate];
System.arraycopy(bytes, 0, newBytes, 0, numOfBytesToTruncate);
TestTruncateUTF8.this.putTextInsideJTextArea(bytes, newBytes);
catch (UnsupportedEncodingException e1)
e1.printStackTrace();
private void putTextInsideJTextArea(byte[] original, byte[] truncated)
try
textArea.append("\nOriginal String: " + new String(original, "UTF-8"));
textArea.append("\nTruncated String: " + new String(truncated, "UTF-8"));
textArea.append("\n*****************************\n");
catch (UnsupportedEncodingException e)
e.printStackTrace();
}Since the byte array is in UTF-8, you can easily examine whether it is corrupt or not by taking a look at the last 4 bytes (at most). That is because the bit distribution of each byte (1st, 2nd, 3rd, and 4th) in UTF-8 encoding is well defined in its spec.
BTW, a Japanese Hiragana/Kanji character typically has 3 bytes in UTF-8, so truncating with neither 16 nor 17 bytes would produce correct truncation.
HTH,
Naoto -
" Can not interpret the data in file " error while uploading the data in DB
Dear All ,
After running the below report I am getting the " Can not interpret the data in file " error.
Need to upload the data in DB through excel or .txt file.
Kindly advise to resolve the issue.
REPORT ZTEST_4.
data : it like ZPRINT_LOC occurs 0 with header line,
FILETABLE type table of FILE_TABLE,
wa_filetable like line of filetable,
wa_filename type string,
rc type i.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
CHANGING
FILE_TABLE = filetable
RC = rc.
IF SY-SUBRC = 0.
read table filetable into wa_filetable index 1.
move wa_filetable-FILENAME to wa_filename.
Else.
Write: / 'HI'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = wa_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it.
IF SY-SUBRC = 0.
Write: / 'HI'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
insert ZPRINT_LOC from table it.
if sy-subrc = 0.
commit work.
else.
rollback work.
endif.
Regards
Machindra Patade
Edited by: Machindra Patade on Apr 9, 2010 1:34 PMDear dedeepya reddy,
Not able to upload the excel but have sucess to upload the .csv file to db through the below code. Thanks for your advise.
REPORT ZTEST_3.
internal table declaration
DATA: itab TYPE STANDARD TABLE OF ZPRINT_LOC,
wa LIKE LINE OF itab,
wa1 like line of itab.
variable declaration
DATA: v_excel_string(2000) TYPE c,
v_file LIKE v_excel_string VALUE 'C:\Documents and Settings\devadm\Desktop\test.csv', " name of the file
delimiter TYPE c VALUE ' '. " delimiter with default value space
read the file from the application server
OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
write:/ 'error opening file'.
ELSE.
WHILE ( sy-subrc EQ 0 ).
READ DATASET v_file INTO wa.
IF NOT wa IS INITIAL.
append wa TO itab.
ENDIF.
CLEAR wa.
ENDWHILE.
ENDIF.
CLOSE DATASET v_file.
EXEC SQL.
TRUNCATE TABLE "ZPRINT_LOC"
ENDEXEC.
*------display the data from the internal table
LOOP AT itab into wa1.
WRITE:/ wa1-mandt,wa1-zloc_code,wa1-zloc_desc,wa1-zloc,wa1-zstate.
ENDLOOP.
insert ZPRINT_LOC from table itab. -
Refreshing the data in a flat file
Hi
I am working on data integration.
I need to fetch data from Oracle data base and then write it to a flat file.
It is working fine now,but for the next fetch I don't need the old data to remain there in the file.The data should get refreshed and only the newly fetched data should be present.
After the data is written to the flat file can i rename the file?
I need the format of the file to be 'File_yyyyMMDDHHmmss.txt'.
My final question is how should I FTP this to the target?
Please help me on this as soon as possible since this is needed in an urgent part of the delivery.All you ask is achievable:
1) The IKM SQL to file has a TRUNCATE option, which will if set to YES, will start from a clean file.
2) You could rename the file after writing it, but why not just write it with that name? If you set the resource name to be a variable, (e.g. #MyProj.MyFilename), and be sure to set the variable in the package before executing your interface, you should be able to get the file you want. Otherwise, you can use the OdiFileMove tool in your package to rename the file.
To set the name of the variable you can use a query on the database (if you are using Oracle, something like SELECT 'File_'||TOCHAR(SYSDATE) from DUAL.)
3) ODI has ftp classes built in- you can find the doc under doc\webhelp\en\ref_jython\jyt_ex_ftp.htm
Hope this helps
Message was edited by:
CTS -
The data of my materialized view....in the while
Hello
We have problems with materialized views
We have one wich re-build each a short period of time
¿Can i avoid the data to dissapear in the time process of refresh?
Is so annoing to our clients to see that "from time to time" the data just dissapear for one period of time -the time while the materialized view is refreshing-
Thank you in advance
Bruno. Madrid. Spain> Is so annoing to our clients to see that "from time to time" the data just dissapear for
one period of time -the time while the materialized view is refreshing-
Have a similar problem. And dealing with large data volumes that makes the DELETE of the MV a very undesirable feature. Not as much a the resource footprint required, but the time it takes to do this - and the very tight processing windows that exist.
The solution is a self-rolled and very likely not ideal for most - but it works well enough for us in production.
No MV. Create a partition table. Create a staging table. Do a manual "full refresh" of the staging table (TRUNCATE and direct path INSERT). Follow this by a partition exchange with the partition table (no validation and including indexes). The result is that the data is replaced in the partitioned table within a second - no long running and expensive DELETE. End-users not effected by having a truncate pulling the data from beneath their reports. -
Problem to upload the data into internal table record length more than 6000
Hi all
I stuck with this problem from past 3 days. I have to upload the data from excel sheet. iam making it tab delimited and trying to upload from gui_upload. but in the structure of file, we have, one field of 4000 characters, and other fields of 255 characters.
how can i upload this into internal table . From excel sheet or from tab delimeted or any other format? or any special function module is there? while iam doing this its truncating the datat 255 characters and not uploading the other fields also...
can any one of you help me out. ASAP
thnks in advancefrom one of the forum iam just pasting code which it is used in lsmw, try the same logic in ur code hope it can work.
you have to create multiple lines with do...enddo loop., like this:
(assuming excel_long_text-text is 924 characters long, 7 lines X 132 char)
__GLOBAL_DATA__
data: offset type i,
text_132(132) type c.
__BEGIN_OF_RECORD__ Before Using Conversion Rules
Rule : Default Settings Modified
Code: /sapdmc/ltxtl = init_/sapdmc/ltxtl.
CLEAR offset.
DO 7 TIMES.
text_132 = excel_long_text-text+offset(132).
offset = offset + 132.
__END_OF_RECORD__ After Using Conversion Rules
Rule : Default Settings Modified
Code: transfer_record.
ENDDO.
also check this
COMMIT_TEXT
To load long text into SAP
READ_TEXT
To load long text into SAP
Maybe you are looking for
-
Hello there, I am having few issues with BI 2004s system. Its a new implementation. - When you create Data source using DB connect in new system, it creates with old version. I could see the SMALL square box next to the Data source. I would
-
I opened up my firefox browser yesterday and it crashed. Since then I get an error message that says "unable to connect" every time I try to load the browser. The setting is set to "no proxy" So it should be connecting. My internet explorer browser i
-
Oracle 10g Database startup problem Please help
i am trying to start database but getting error; SQL> startup ORACLE instance started. Total System Global Area 281018368 bytes Fixed Size 788776 bytes Variable Size 229373656 bytes Database Buffers 50331648 bytes Redo Buffers 524288 bytes Database m
-
Aperture 3 tethered with Nikon D300 trouble
I've been having trouble shooting tethered with Aperture 3 and the Nikon D300. It works for a few shots then it jams with the spinning wheel until i have to force quit. Also the inspector column gets messed up with type over type. I'm assuming apple
-
HT201272 Cannot download previously purchased songs.
I go to iTunes store > purchased > name of artist ... and the songs I'm missing are listed. However, where the "download" button is supposed to be it says "downloaded" and clicking on it has no effect. I assume that I downloaded them once when I firs