Problems while uploading text documents into Database
I just upgraded our database from 9iR1 to 9iR2 (9.2.0.1.0). The server
character set is AL32UTF8. Now I'm facing a problem when
uploading text documents into the database via a web frontend.
I use the upload table defined for the PL/SQL Database Access Descriptor:
create table TB_UPLOAD (
NAME VARCHAR2(256) not null,
MIME_TYPE VARCHAR2(128),
DOC_SIZE NUMBER,
DAD_CHARSET VARCHAR2(128),
LAST_UPDATED DATE,
CONTENT_TYPE VARCHAR2(128),
BLOB_CONTENT BLOB);
After uploading a text document containing the two words "hallo welt",
the following statement returns not "hallo welt", but "68616C6C6F2077656C74":
declare
b_loc blob;
v_amount integer := 100;
v_buffer varchar2(100);
v_offset integer := 1;
begin
select blob_content into b_loc from tb_upload where name like 'mydoc.txt';
dbms_lob.read(b_loc, v_amount, v_offset, v_buffer);
htp.prn(v_buffer);
end;
What is this? I studied the documentation, but didn't found a solution.
When trying to use Oracle's built-in procedure wpg_docload.download_file,
the content is shown the way it should be. Unfortunately, I can't use
wpg_docload.download_file in order to copy the BLOB content to another table.
Any hints would be appreciated!
Thanks so much in advance!
Roman
E-Mail: [email protected]
Hi Roman,
the upload uses a BLOB (Binary Lob). Your Document is
stored as is in the binary representation. If you
use dbms_lob.read on a blob and your buffer is a varchar2 the binary representation is not translated!!!
use a raw for the buffer and utl_raw.cast_to_varchar2
to do the conversion to varchar.
try this
Procedure SHOW_DOC(p_name doc_test.name%TYPE)
IS
v_len number;
v_mime_type tb_upload.mime_type%TYPE;
v_offset integer := 1;
v_Buf_size integer := 32767;
v_buf raw(32767);
v_blob blob;
v_Doc_name varchar2(1000);
BEGIN
v_doc_name := url_Decode(p_name);
select mime_type,doc_size,blob_content
into v_mime_Type,v_len,v_blob
from tb_upload
where name = v_doc_name;
OWA_UTIL.MIME_HEADER(v_Mime_Type);
begin
LOOP
DBMS_LOB.READ(v_blob,v_buf_size,v_offset,v_buf);
HTP.PRN(UTL_RAW.CAST_TO_VARCHAR2(v_buf));
v_offset := v_offset + v_buf_size;
END LOOP;
exception
when no_data_found then
null;
end;
END;
HTH
detlev
Similar Messages
-
Problems while uploading text documents into Unicode Database
I just upgraded our database from 9iR1 to 9iR2 (9.2.0.1.0). The server
character set is AL32UTF8. Now I'm facing a problem when
uploading text documents into the database via a web frontend.
I use the upload table defined for the PL/SQL Database Access Descriptor:
create table TB_UPLOAD (
NAME VARCHAR2(256) not null,
MIME_TYPE VARCHAR2(128),
DOC_SIZE NUMBER,
DAD_CHARSET VARCHAR2(128),
LAST_UPDATED DATE,
CONTENT_TYPE VARCHAR2(128),
BLOB_CONTENT BLOB);
After uploading a text document containing the two words "hallo welt",
the following statement returns not "hallo welt", but "68616C6C6F2077656C74":
declare
b_loc blob;
v_amount integer := 100;
v_buffer varchar2(100);
v_offset integer := 1;
begin
select blob_content into b_loc from tb_upload where name like 'mydoc.txt';
dbms_lob.read(b_loc, v_amount, v_offset, v_buffer);
htp.prn(v_buffer);
end;
What is this? I studied the documentation, but didn't found a solution.
When trying to use Oracle's built-in procedure wpg_docload.download_file,
the content is shown the way it should be. Unfortunately, I can't use
wpg_docload.download_file in order to copy the BLOB content to another table.
Any hints would be appreciated!
Thanks so much in advance!
Roman
E-Mail: [email protected]Hi Roman,
the upload uses a BLOB (Binary Lob). Your Document is
stored as is in the binary representation. If you
use dbms_lob.read on a blob and your buffer is a varchar2 the binary representation is not translated!!!
use a raw for the buffer and utl_raw.cast_to_varchar2
to do the conversion to varchar.
try this
Procedure SHOW_DOC(p_name doc_test.name%TYPE)
IS
v_len number;
v_mime_type tb_upload.mime_type%TYPE;
v_offset integer := 1;
v_Buf_size integer := 32767;
v_buf raw(32767);
v_blob blob;
v_Doc_name varchar2(1000);
BEGIN
v_doc_name := url_Decode(p_name);
select mime_type,doc_size,blob_content
into v_mime_Type,v_len,v_blob
from tb_upload
where name = v_doc_name;
OWA_UTIL.MIME_HEADER(v_Mime_Type);
begin
LOOP
DBMS_LOB.READ(v_blob,v_buf_size,v_offset,v_buf);
HTP.PRN(UTL_RAW.CAST_TO_VARCHAR2(v_buf));
v_offset := v_offset + v_buf_size;
END LOOP;
exception
when no_data_found then
null;
end;
END;
HTH
detlev -
hi,
am trying to upload a document in a document library which is associated with content types [ the content type contains 10 site columns and one of them is taxonomy field]. i added this content type in the document library.
this document library is residing in a team site which is saved as a template and based on this template i have created sub sites.
and when i tried to upload a file to the doc lib, it throws me "access denied error".
what may be went wrong .
any help is appreciated!Access denied indicates the user account uploading the file doesn't have access to the library, or sometimes it means there's already a document in the library with the same name that was never checked in. It's also possible that your template contains
custom code that tries to do something that is not allowed.
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com -
Problem while uploading Portal Theme into R/3 System?
Hello Guru's
I am trying to upload Portal Theme into R/3 system.
We have a program which will upload to a given path.
T.Code SE38 Program name BSP_update_mimerepos.
When I upload the theme using the program I get some folders,
like Common, r, UR
when cross checked with the standard I see css files are missing when uploading.
please help me on resolving this.
Thanks in Advance.
Points will be rewarded for helpful inputs.
Regards,
Pramodsolved went with WD_THEMES report to upload the theme to R/3 system.
search in forum to find out the solution.
cheers-
Pramod -
Problem while uploading text file through portal into WebDAV repository .
Hi all...
I am not able to upload any file through portal onto my webDav repository for remote server however reverse is possible i.e. any document created at remote server is reflected in portal.
Everytime when i try to upload file though portal , i get the following error::
The item could not be created because an exception occurred in the framework.
Kindly suggest what to do....
ThankSHi Chetna,
Have you specified any user information in the webdav repository....Like always connect through this user, in the webdav repsository tab....This user may not have write permission in the windows.
Also are you sure that the user you logged in portal by which you failed to create new files or folders and the user that was able to create file in the windows are one and the same.....
Regards,
Ganesh N -
Problems while uploading company logo into sap script
Hi Experts,
When i am inserting company logo into sap scripts, i successfully uploaded, but the problem is i am getting black and white image instead of color,but in RSTXLDMC i am giving parameter as BCOL only, could anybody help to get my problem resolved. it is very urgent. The logo which i am inserting is colored.
bye
M.Rajendra SinghHI
GOOD
How to Upload graphics (IMAGE) to your Sapscript?
Command in your Sapscript
/: INCLUDE Z_YOUR_LOGO OBJECT TEXT ID ST LANGUAGE E
These are the steps to be followed for uploading graphics in R/3 system
1. First save the file as BMP
2. Open the BMP file in IMaging (Goto -> Programs -> Accessories -> Imaging) and
make it Zoom as 100% and save as *.TIFF
3. Open SE38 and execute program RSTXLDMC
4. Give your TIFF file path name
5. Select Bcol (for Color)
6. TEXT ID will be ZHEX-MACRO-*.
7. Inplace of * write your own logo name (ZCOMPANYLOGO)
8. Execute the program
9. Now Goto SE71 create your ZFORM
10. Create logo window
11. Goto text element of logo window
or
In 4.6x :-
1. Goto SE71 Change the mode to GRAPHICAL
2. Choose the Graph Tabstrips
3. Now type in some name for the LOGO WINDOW
4. Press the IMPORT BUTTON and then IMPORT the BMP file from your DESKTOP
5. The code will be written automatically. You just need to drag and drop wherever you want
the graphics to be.
Please note that in 4.6c onwards, you can also used Windows Bitmap file ( .BMP).
THANKS
MRUTYUN -
Long text problem while uploading Inspection plan through BDC.
Hi,
I am facing some problem while uploading the inspection plan. There are few MICs for which we are having long text, while uploading the inspection plan through BDC - some other long text is getting copied into the MIC's long text. After checking I came to know that in function module, read_text - some text which is stored in ABAP memory is getting copied into the inspection plan.
I am working in SAP release 4.7. I have checked with SAP notes: 97419, but it is also not satisfying.
Waiting for quick solution.
Thanks in advance.
FahiéHi a®s,
Thanks a lot for your kind reply.
My requirement is I want to maintain long text for few MICs (which are not having long texts at MIC level) in inspection plan (QP01).
When I am trying to manually assign the MIC's to inspection plan (QP01), long text is copied whereas I am not clicking the long text icon in (QP01). Long text is not maintained in MIC level, still some long text is copied to this MIC. This was also happening while uploading the inspection plan thro' BDC.
I believe what you have mentioned about function module SAVE_TEXT cannot be used here since long text is already copied before we pass the long text. Also if we pass some long text, still apart from the long text what we have passed there is some other long text copied (extra long text).
Waiting for quick solution.
Thanks in advance.
Fahié -
Issue while uploading .TIFF file into Standard text using RSTXLDMC
Hi All,
We are facing issues while uploading .TIFF file into standard text through program RSTXLDMC.
Getting the following error.
TIFF format error: No baseline TIFF 6.0 file.
The image is a colored one.
Please provide me solution if anyone has worked in this area.
Thanks in Advance,
Anand Raj Kuruba.Hi,
Often this error occurs because the TIFF file you have has been saved with some form of compression. You need to open in a picture edit program and save as TIFF making sure options are set so there is no compression.
Andrew -
"Function code cannot be selected" error while uploading a document.
Hi,
When we try to upload a document into SAP the user is getting the error "Function code cannot be selected". Detailed error is given below. Only one user is facing this error in PRD. For all other users it is working fine. We replicated the same issue in testing systems and it is working fine there with the same user's id.
The detailed error is,
No batch input data for screen SAPLF040 0300
Message no. 00344
Diagnosis
The transaction sent a screen that was not expected in the batch input session and which therefore could not be supplied with data.
Possible reasons:
1. The batch input session was created incorrectly. The sequence of screens was recordly incorrectly.
2. The transaction behaves differently in background processing in a batch work process than when running in dialog (SY-BATCH is queried and changes the screen sequence).
3. The transaction has undergone user-specific Customizing and therefore certain screens may be skipped or processed differently, according to the current user. If the person who created a batch input session is not the same as the person now processing it, this problem may occur frequently.
System Response
None.
Procedure
For 1: Either re-create the session or process it in expert mode. Correct the batch input program.
For 2. It is very difficult to analyze this problem, particularly in the case that the screen sequence or the display-only options of fields differ according to whether the transaction is being processed in the background or as an online dialog. It could also be that this kind of transaction cannot run with batch input.
For 3: Have the creator of the session process it. If no error occurs now, then this is a program with user-specific Customizing.Hi Amar,
I am facing the same issue while processing Vendor master inbound idocs, Few Idocs gone in error with error message "Function code cannot be selected".
Could you please suggest any solution found for the same.
Thanks in advance
Shivam -
Problem while import u201CSAPKU60003 & SAPKNA7013u201D into SAP CRM 2007
Gentlemen,
I have a problem while import u201CSAPKU60003 & SAPKNA7013u201D into SAP CRM 2007,
My current Support Package Level is:
SAP_ABA 700 0015
SAP_BASIS 700 0015
PI_BASIS 2006_1_700 0006
ST-PI 2005_1_700 0006
CRMUIF 600 0003
SAP_BW 700 0017
SAP_AP 700 0012
BBPCRM 600 0002
First I had the following error:
Syslog: k CQ3 : UMGSETTING& rscpexcc 12
GetDBMigrateCodePagesLangs uses TCP0D, TCPDB, TCP0C.
0 entries from FUNCT (%/SAPCND/CNF_GET_RECORD_FROM_DB%) deleted.
0 d / 0 i / 0 u / 6 = 100% ucf FUPARAREF
6 entries for FUPARAREF imported (/SAPCND/CNF_GET_RECORD_FROM_DBA*).
0 entries from RODIR (FUNC/SAPCND/CNF_GET_RECORD_FROM_DB) deleted.
0 entries from RODIR (FUNC/SAPCND/CNF_GET_RECORD_FROM_DB) deleted.
0 d / 0 i / 0 u / 1 = 100% ucf TFTIT
1 entry for TFTIT imported (D/SAPCND/CNF_GET_RECORD_FROM_DB*).
successfully set a temporary lock on table REPOSRC
REPOS /SAPCND/LDETERMINATION$14 A replaced.
REPOS /SAPCND/LDETERMINATIONU14 A replaced.
[dev trc ,00000] Wed Nov 26 16:33:14 2008 1315447 8.171484
[dbdsoci. ,00000] *** ERROR => invalid offset 0 for placeholder 16
71 8.171555
unsuccessful statement: EXEC SQL: SELECT ID,OBJECT,LANGU,TYP,VERSION FROM DOKIL WHERE (LANGU IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
dsql_open returned with unexpected error code 2
Please contact the SAP support.
End of Transport (0016).
date&time: 26.11.2008 - 16:33:14
5 warnings occured.
3 errors occured.
Main import
End date and time : 20081126163314
Ended with return code: ===> 16 <===
After I got this error I upgraded the Kernel from patch level 159 to 179,
After that I restarted the update again but the system is still running on u201CIMPORT_PROPERu201D and dose not given any update,
From Import logs of the queue I can see the following,
Summary:
24 DOCUT imported.
16 DYNPS imported.
30 DYNPT imported.
387 REPOS imported.
43 REPOT imported.
Totally 505 Objects imported.
Totally 3636 tabentries deleted.
Totally 14 objects activated.
Totally 12229 tabentries imported.
62066888 bytes modified in database.
[dev trc ,00000] Wed Nov 26 18:14:19 2008 20996974 40.917838
[dev trc ,00000] Disconnecting from ALL connections: 30 40.917868
[dev trc ,00000] Disconnecting from connection 0 ... 287 40.918155
[dev trc ,00000] Closing user session (con_hdl=0,svchp=00000000003005B8,usrhp=00000000002FB748)
5759 40.923914
[dev trc ,00000] Detaching from DB Server (con_hdl=0,svchp=00000000003005B8,srvhp=00000000061530E8)
921 40.924835
[dev trc ,00000] Now I'm disconnected from ORACLE 8230 40.933065
[dev trc ,00000] Disconnected from connection 0 90 40.933155
[dev trc ,00000] statistics db_con_commit (com_total=527, com_tx=307)
59 40.933214
[dev trc ,00000] statistics db_con_rollback (roll_total=0, roll_tx=0)
52 40.933266
Disconnected from database.
End of Transport (0004).
date&time: 26.11.2008 - 18:14:19
2 warnings occured.
Main import
End date and time : 20081126181419
Ended with return code: ===> 4 <===
Please advice me.
Regards,
AhmedI have similar problem while updating support packages in SAP R/3 4.6C environment.
000 unsuccessful statement: EXEC SQL: SELECT ID,OBJECT,LANGU,TYP,VERSION FROM DOKIL WHERE (LANGU IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,
000 dsql_open returned with unexpected error code 1
000 unsuccessful statement: EXEC SQL: SELECT ID,OBJECT,LANGU,TYP,VERSION FROM DOKIL WHERE (LANGU IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,
000 dsql_open returned with unexpected error code 1
Here is an outline of series of events that happened:-
We are applying in support packages in SAP R/3 4.6C HR Development
(TFI) environment. We planned with installing all the SP stacks
starting from 1 to 9.
-Updated kernel, tp , r3trans and SPAM level to latest level.
We received the following error in Import_Proper step of Support
package upgrade. Though the step has been repeated after making sure
that we have all the required files at OS level, we go this error
repeatedly.
Main import
Transport request___: SAPKB46C52
System______________: TFI
tp path : tp
Version and Release: 305.13.25 46D
check-sum error in datafile after 9374854 bytes.
Main import
End date and time : 20081205192603
Ended with return code: ===> 16 <===
When we renamed Co-File & data_file at OS level to see if the files are
created again and reran we got the following error.
Main import
Transport request___: SAPKB46C52
System______________: TFI
tp path : tp
Version and Release: 305.13.24 46D
Main import
End date and time : 20081205185117
Ended with return code: ===> 12 <===
We tried importing the individual support package SAPKB46C52 from STMS
and the transport cancelled at an earlier step with the same error.
Dictionary import
Transport request___: SAPKB46C52
System______________: TFI
tp path : tp
Version and Release: 305.13.25 46D
check-sum error in datafile after 9374854 bytes.
Dictionary import
End date and time : 20081205195929
Ended with return code: ===> 16 <===
While playing around I have deleted the transport from the tp buffer
and added manually, before doing so I made a backup of tp buffer at OS
level and I got following error though I reverted back to backed-up
copy.
- Error in phase: IMPORT_PROPER
- Reason for error: TP_BUFFER_INCONSISTENCY
- Return code: 0008
- Error message: Wrong sequence of Packages in the tp buffer (e.g.
SAPKB46C52 )
I then tried to disassemble the package separately and reran the
import queue. Now I have RC 8 on that support package.
When I did R3trans -l on the datafile it completed successfully.
D:\>R3trans -l \usr\sap\trans\data\RB46C52.SAP
This is R3trans version 6.05 (release 46D - 27.10.08 - 16:32:00).
R3trans finished (0000).
I verified the size of file "CSR0120031469_0023301.PAT" and it is the
same as mentioned in SSP.
Let us know is there is a workaround. -
Problem while uploading data with GUI UPLOAD Function
Hi,
I am facing problem while uploading data with FM GUI UPLOAD in out text file there are 7 row but after the FM GUI UPLOAD there are 14 entries are coming in Internal table and each alternate row is coming as blank with 0000 in some column in internal table first row is proper and second line is blank so on.
what can be the problem .
The program in which we are using this we are using it from last 2 year but we are facing problem today only.
regards,
zafarHi,
The file formate is same as it is from last two years it is automatically generated by one another bar code server and there is no change in the file formate.
So waht can be the problem to check any inconsistancy in system i have develop a samll program fro uploading a text file with same function module , but it is working fine.
regards,
zafar -
Errors have occured while transferring the document into another system.
Hi GURUs,
Please help me to come out from this problem........
An error has occured in the system YDQCLNT100 while copying the document
Message no. CRM_ORDER_MISC 020
Diagnosis
Errors have occured while transferring the document into another system. Refer to the attached log for error messages.
Transmission log
Product cannot be recoded for R/3 System YDQCLNT100 (Notification E CRM_ORDER_MISC 015)
Product cannot be recoded for R/3 System YDQCLNT100 (Notification E CRM_ORDER_MISC 015)
Please suggest something ASAP....
i'll be highly Grateful to you.....
Regards,
AnkurHi Gangadhar,
Can you plz explain me elaborately, where should i check for partner function of the equipment and how this partner function is related to this issue.
I think partner function will be there only for BP. Can you plz clarify me.
Thanks in advance
Ankur -
Getting error while uploading a document in a library
Hi,
I'm getting a weird error while uploading the document in the library. And I don't get it all the times but most of the times.
It reads:
The file <library name>/<file name> has been modified by i:0#.<user-id> on <datetime stamp>
How to resolve this ? I have referred many articles on this one, but none helped.
Thanks for your response in advance.
RegardsHi Prajk,
Based on your description, I recommend to check if there are any ItemAdded event receiver or workflows which are triggered when an item is created to update the document properties in the library.
If there is any ItemAdded event receiver on the library, I recommend to wait for ItemAdded to finish before the ListFieldIterator control residing on EditForm.aspx loads (It’s the ListFieldIterator which displays the Item’s fields ).
http://blogs.msdn.com/b/manuj/archive/2009/09/22/itemadded-event-on-document-library-the-file-has-been-modified-by-on-error.aspx
If there is any workflow on the library, I recommend to add a Pause for Duration step at the beginning of the workflows.
If above cannot work, please check ULS log for detailed error message.
For SharePoint 2013, by default, ULS log is at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS.
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
I get two screens while uploading a document in a library
Hi,
I get two upload screens while uploading a document to a library. Take a look at the below screenshots. Can somebody please tell me how can I club these two to one.
I need only one upload screen with all the metadata listed.
Many thanks for your response.
p.s. also please tell me an out of the box way to do this. Even scripting is okay.
1.
2.In the first screenshot I can see the link "Upload files using Windows Explorer instead". You can use that option to upload your files and the default values for metadata would be taken for those files.
From the second screenshot I can see there are custom columns in metadata because of which the second dialog is shown. If there are no custom columns in metadata then the second dialog will not appear. -
Hello i am rajesh i am having problem while conveting other files into pdf format please help me
i am rajesh i am having problem while converting other files into acrobat format please help me
Hello Rajesh,
I'm sorry to hear you're having trouble. Are you using Acrobat.com to convert your files to PDF? Please let me know where you are having trouble and I will do my best to help you convert your files. For your reference, here is a list of filetypes that can be converted to PDF online with Acrobat.com:
http://kb2.adobe.com/cps/524/cpsid_52456.html#Create%20PDF
Best,
Rebecca
Maybe you are looking for
-
Is there a way to get Zenwork's wake-on-lan feature to work across subnets? I am not a LAN administrator so pardon any ignorance you see in my question. Zenwork's wake-on-lan function won't work on our LAN because our switches are set to not allow fo
-
I have been successfully accessing a secure site using a Citrix plugin. The security certificate for the site was renewed on 17 September and is valid, but is apparently supported by Explorer. When I accessed it today, Firefox reported it as Insecure
-
DVI Port Very Very Stiff! Normal?
Hi, when connecting the dvi to vga video adapter it is a very tight connection (very stiff to put in and pull out)! Is this normal? Thanks
-
Pdf full screen mode page size
Hi all, I am building an interactive pdf and everything is working nicely, other than the page size when the file is started. What happens is that when you open the file and it autostarts in full screen mode the first page is full screen, then when n
-
I have one software product that runs on Windows but do not have windows on my mac. Is parallels the best option to be able to use my windows based software