Problem uploading multibyte CSV file
I apologize, this topic has been addressed several times, but I still can't find the solution.
I have multibyte CSV files (extract from BI) : Excel says "Unicode txt" and when I save them from Excel in "Text CSV", they get half the size on the disk.
here is the piece of code where the uploaded file get converted from blob to clob then to varchar2 (CSV Util from Oleg.Lihvoinen http://dbswh.webhop.net/dbswh/f?p=BLOG:READ:0::::ARTICLE:11000346061523)
SELECT blob_content
INTO v_blob_data
FROM wwv_flow_files
WHERE NAME = p_file_name;
v_position := 1;
blob_csid := 873 ;
DBMS_LOB.createtemporary (lob_loc => v_clob_data,
CACHE => TRUE,
dur => DBMS_LOB.SESSION
DBMS_LOB.converttoclob (v_clob_data,
v_blob_data,
amount,
dest_offset,
src_offset,
blob_csid,
lang_ctx,
warning
v_clob_len := DBMS_LOB.getlength (v_clob_data);
IF v_clob_len = 0 THEN
RETURN;
END IF;
WHILE (v_position <= v_clob_len + 1)
LOOP
v_char := DBMS_LOB.SUBSTR (v_clob_data, c_chunk_len, v_position);
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
I have tried different values for "blob_csid := 873 ;" (and by the way, the list of possible values for this code is very difficult to find : I know, there is a function CS_name to CS_ID but a list would be great), but without any visible effect.
If I use the Apex CSV uploader app, the result is the same than with this code.
Here is an example :
�O�R�A�C�L�E�
instead of :
ORACLE
How I can have these files imported whithout an Excel conversion ?
Thanks.
Hum, looks like the error is thrown before the execution, during the sort of prepare/precompile of the package procedure, and it said that v_line := v_line || v_char is too small string buffer.
I am a bit surprised.
Anyone on this ????? I am doing answers myself, it will not help me a lot :)
Similar Messages
-
When I try to upload a CSV file in my program it gives me an error message - Do not have an E-mail address column even though I do have an E-mail column and a list of E-mail addresses. How can I resolve this problem?
What email program are you using? I sent a .csv file via Mail, it worked perfectly.
-
How do I upload a CSV file with embedded quotation marks into a table via ETL
I'm having a problem importing a CSV file via ETL that contains double-quotes, and prior solutions aren't helping. My data looks like this:
A
B114SA
CHLORASCRUB SWAB INS SUBASSEMB
A
S273SA
CHLORASCRUB MAXI INS SUBASSEMB
A
2AB286
WEB ZEE ANTISEPT 5410\4.5" CD
A
2AB512
WEB PDI PVP IODINE PREP PAD 3870/4.5
A
2AB542
WEB ZEE CLEAN WIPE NP5410/4.5
If I set the "Text Qualifier" to ' " ', then run it, it falls over on the third row, with the following error:
- Executing (Error)
Messages
Error 0xc0202055: Data Flow Task 1: The column delimiter for column "Column 2" was not found.
(SQL Server Import and Export Wizard)
Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "H:\AS400_file_transfers\LIMS\ACTITEMPF.CSV" on data row 3.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - ACTITEMPF_CSV" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine
called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
Any help?Full support for embedded quotes was added in SSIS 2012.
Which version are you using?
http://blogs.msdn.com/b/mattm/archive/2011/07/17/flat-file-source-changes-in-denali.aspx -
I have an issue where myself and another user are unable to upload a csv file to my application using the "File Browse" page item in V4.1.1. I get the following error, "Error ORA-01403: no data found".
This function was working perfectly last week prior to the upgrade of our APEX to V4.1.1 from V3. Other users are still able to upload the csv file, so the PL/SQL behind it must be ok.
So here is where I am up to with testing.
Tested the upload using my login on my PC – Fail
Tested the upload using my login on another PC – Fail
Tested the upload using other user’s login on my PC – Success
Tested the upload using other user’s login on another PC - Success
Any help would be greatly appreciated.
Cheers,
GregThe offending piece of code was in a block of script that I used from an online sample when I was first setting up this upload script. A colleague had the same issue in another application and rewrote the script to resolve the issue, see below.
I'm still perplexed as to why the majority of users could run it ok, and there were only 2 of us that it errored on. But now it's working for all, and I can go back to building some cool stuff in V4.1.1.00.23.
-- Read data from wwv_flow_files
select blob_content into v_blob_data
from wwv_flow_files
where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USERID)
and id = (select max(id) from wwv_flow_files where updated_by = :APP_USERID);
-- Rewritten to the following, which works.
select blob_content into v_blob_data
from wwv_flow_files
where id = (select ID from wwv_flow_files
where UPDATED_BY = :APP_USERID
and LAST_UPDATED = (select max(LAST_UPDATED) from wwv_flow_files where UPDATED_BY = :APP_USERID)); -
I have one problem in creating csv file.
If one column has single line value, it is coming in single cell. But if the column has no.of lines using carriage return while entering into the table,
I am not able to create csv file properly. That one column value takes more than one cell in csv.
For example the column "Issue" has following value:
"Dear
I hereby updated the Human Resources: New User Registration Form Request.
And sending the request for your action.
Regards
Karthik".
If i try to create the csv file that particular record is coming as follows:
0608001,AEGIS USERID,SINGAPORE,Dear
I hereby updated the Human Resources: New User Registration Form Request.
And sending the request for your action.
Regards
Karthik,closed.
If we try to load the data in table it is giving error since that one record is coming in more than one line. How can I store that value in a single line in csv file.
Pls help.I have tried using chr(10) and chr(13) like this......still it is not solved.
select REQNO ,
'"'||replace(SUBJECT,chr(13),' ')||'"' subject,
AREA ,
REQUESTOR ,
DEPT ,
COUNTRY ,
ASSIGN_TO ,
to_Date(START_DT) ,
START_TIME ,
PRIORITY ,
'"'||replace(issues, chr(13), ' ')||'"' issues,
'"'||replace(SOLUTIONS,chr(13),' ')||'"' SOLUTIONS ,
'"'||replace(REMARKS,chr(13),' ')||'"' REMARKS ,
to_date(CLOSED_DT) ,
CLOSED_TIME ,
MAN_DAYS ,
MAN_HRS ,
CLOSED_BY ,
STATUS from asg_log_mstr
Pls help. -
Flat File Upload as CSV File in BPS.
Hi Friends,
We have to upload CSV file to BPS and as of now we are able to upload tab spaced file as per the How to Document.
Kindly can some body post the COMPLETE CODE changes for Uploading the CSV File in both LOAD and WEB Function Modules.
For complete code points are guaranteed.Hi BI,
please check the following thread.
Load flat file to BPS - GUI issue
I've implemented the file upload for CSV file. please note the changes i've made -
Code for INIT function module :-
FUNCTION Z_BPS_FILE_UPLOAD_INIT_CSV.
""Local Interface:
*" IMPORTING
*" VALUE(I_AREA) TYPE UPC_Y_AREA
*" VALUE(I_PLEVEL) TYPE UPC_Y_PLEVEL OPTIONAL
*" VALUE(I_PACKAGE) TYPE UPC_Y_PACKAGE OPTIONAL
*" VALUE(I_METHOD) TYPE UPC_Y_METHOD OPTIONAL
*" VALUE(I_PARAM) TYPE UPC_Y_PARAM OPTIONAL
*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP OPTIONAL
*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL OPTIONAL
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA OPTIONAL
*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF OPTIONAL
*" EXPORTING
*" REFERENCE(ETO_CHAS) TYPE ANY TABLE
*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG
DATA: lto_chas TYPE yto_chas,
ls_chas TYPE ys_chas,
ls_exitp TYPE upf_ys_exitp,
ls_mesg TYPE upc_ys_mesg,
ls_chasel TYPE upc_ys_chasel, "<<<INSERT
ls_charng TYPE upc_ys_charng. "<<<INSERT
DATA: lt_filetab TYPE filetable,
ls_filetab TYPE file_table,
l_file TYPE string,
l_separator TYPE char01,
l_action TYPE i,
l_count TYPE i.
FIELD-SYMBOLS: <f> TYPE ANY. "<<<INSERT
Try to get file name from parameter
READ TABLE it_exitp INTO ls_exitp WITH KEY parnm = 'FILENAME'.
IF sy-subrc = 0.
l_file = ls_exitp-chavl.
ENDIF.
If no file name is given, prompt user for it
IF l_file IS INITIAL.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select Upload File'
default_extension = 'csv'
file_filter = 'Text Files (*.csv)'
CHANGING
file_table = lt_filetab
rc = l_count
user_action = l_action
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
OTHERS = 3. "#EC NOTEXT
IF sy-subrc <> 0.
CLEAR ls_mesg.
MOVE-CORRESPONDING syst TO ls_mesg.
APPEND ls_mesg TO et_mesg.
EXIT.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
LOOP AT lt_filetab INTO ls_filetab.
l_file = ls_filetab.
ENDLOOP.
CHECK l_action = 0.
ENDIF.
l_separator = 'X'.
Upload file from front-end (PC)
File format is tab-delimited ASCII
l_separator = ';' .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = 'DAT'
has_field_separator = l_separator
TABLES
data_tab = gt_file_csv
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
CLEAR ls_mesg.
MOVE-CORRESPONDING syst TO ls_mesg.
APPEND ls_mesg TO et_mesg.
EXIT.
ENDIF.
Create one dummy combination
If we don't do this, the upload won't work since the second function
will not be executed at all in case no transaction data exists so far.
The combination must be a subset of the planning level!
" >>> BEGIN INSERT
CLEAR ls_chas.
LOOP AT ito_chasel INTO ls_chasel.
READ TABLE ls_chasel-t_charng INTO ls_charng INDEX 1.
IF sy-subrc = 0.
ASSIGN COMPONENT ls_chasel-chanm OF STRUCTURE ls_chas TO <f>.
IF sy-subrc = 0.
<f> = ls_charng-low.
ENDIF.
ENDIF.
ENDLOOP.
" <<< END INSERT
COLLECT ls_chas INTO lto_chas.
eto_chas = lto_chas.
ENDFUNCTION.
Include should contains following declarations-
TYPES: begin of itab_CSV,
text(255) type c,
end of itab_CSV.
Global table to temporarily store loaded data.
DATA: gt_file_CSV TYPE STANDARD TABLE OF itab_csv WITH DEFAULT
KEY.
Hope it will help you.
Regards
Tarun -
Please help on uploading a CSV file on APEX through file browse
Hi All,
I need to upload a csv file in the table through file browse button.For that i have created the below process and function.This method is working perfectly fine when the file size is small.But i need to upload the file of 16 MB size and when i try to upload that file it gives error wwv_flow.accept error.Any expert of APEX please help me out on this error.As i am very new to APEX and i need to get this done as early as possible.Please provide any solution ,i will be really grateful to the person.
function_
create or replace function hex_to_decimal
--this function is based on one by Connor McDonald
--http://www.jlcomp.demon.co.uk/faq/base_convert.html
( p_hex_str in varchar2 ) return number
is
v_dec number;
v_hex varchar2(16) := '0123456789ABCDEF';
begin
v_dec := 0;
for indx in 1 .. length(p_hex_str)
loop
v_dec := v_dec * 16 + instr(v_hex,upper(substr(p_hex_str,indx,1)))-1;
end loop;
return v_dec;
end hex_to_decimal;
Process_
DECLARE
v_blob_data BLOB;
v_blob_len NUMBER;
v_position NUMBER;
v_clob_data CLOB := 'anything';
dest_offset NUMBER := 1;
src_offset NUMBER := 1;
blob_csid NUMBER := dbms_lob.default_csid;
lang_ctx INTEGER := dbms_lob.default_lang_ctx;
warning INTEGER;
v_raw_chunk RAW(10000);
v_char CHAR(1);
c_chunk_len number := 1;
v_line VARCHAR2 (32767) := NULL;
v_data_array wwv_flow_global.vc_arr2;
v_rows number;
v_sr_no number := 1;
BEGIN
delete from scg_recievables2;
-- Read data from wwv_flow_files</span>
select blob_content into v_blob_data
from wwv_flow_files
where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USER)
and id = (select max(id) from wwv_flow_files where updated_by = :APP_USER);
v_blob_len := dbms_lob.getlength(v_blob_data);
v_position := 1;
-- Read and convert binary to char</span>
WHILE ( v_position <= v_blob_len ) LOOP
dbms_lob.converttoclob(v_clob_data, v_blob_data, v_blob_len, dest_offset,src_offset,blob_csid,lang_ctx,warning);
v_char := dbms_lob.getlength(v_clob_data);
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved </span>
IF v_char = CHR(10) THEN
-- Convert comma to : to use wwv_flow_utilities </span>
v_line := REPLACE (v_line, ';', ':');
-- Convert each column separated by : into array of data </span>
v_data_array := wwv_flow_utilities.string_to_table (v_line);
if IsNumber(substr(v_data_array(9),1,1)) = 1 then
v_data_array(9) := substr(v_data_array(9),1,11);
else
v_data_array(9) := '01-JAN-1900';
end if;
v_data_array(9) := NVL(v_data_array(9),'01-JAN-1900');
-- Insert data into target table </span>
EXECUTE IMMEDIATE 'insert into scg_recievables2 (Account_receivable_number, the_account_number, bill_history_tran, service_number, item_type, the_amount_billed, the_remaining_amount,source_of_payment)
values (:1,:2,:3,:4,:5,:6,:7,:8,:9)'
USING
v_data_array(1),
v_data_array(2),
v_data_array(3),
v_data_array(4),
v_data_array(5),
v_data_array(6),
v_data_array(7),
v_data_array(8);
-- Clear out
v_line := NULL;
v_sr_no := v_sr_no + 1;
END IF;
END LOOP;
END;As noted, this confuses the issue, since a possible answer was posted in the OTHER thread.. Check your server logs, you are probably timing out.. From prior threads with a similar issue:
Have a look at the httpd.conf file (or get your system administrator to look at it) and see what the value of TimeOut is set to. You may need to increase it in order to export large tables via APEX.
http://www.apacheref.com/ref/http_core/Timeout.html
Thank you,
Tony Miller
Webster, TX
A lady came up to me on the street, pointed at my suede jacket and said "Do you know a cow was murdered to make that jacket?"
"I didn't know there were any witnesses", I replied " Now I'll have to kill you too" -
Upload a .CSV File into an Internal table
Hi,
What are the parameters to be filled into the Function Modules "GUI_UPLOAD" and "ALSM_EXCEL_TO_INTERNAL_TABLE" to Upload a .CSV File into an internal table.
Please send a sample code to support this....
Regards,
Aadhi.Hi,
Check the below code.
TYPE-POOLS: truxs.
TYPES:
BEGIN OF ty_line,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
END OF ty_line.
*data: ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY.
DATA: itab TYPE STANDARD TABLE OF ty_line WITH DEFAULT KEY.
DATA: itab1 TYPE truxs_t_text_data.
SELECT
vbeln
posnr
UP TO 10 ROWS
FROM vbap
INTO TABLE itab.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
i_field_seperator = ';'
TABLES
i_tab_sap_data = itab
CHANGING
i_tab_converted_data = itab1
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'd:\TEMP\test1.txt'
TABLES
data_tab = itab1
EXCEPTIONS
OTHERS = 1.
IF sy-subrc eq 0.
WRITE: 'Data downloaded successfully'.
ENDIF.
DATA: BEGIN OF IEXCEL OCCURS 0.
INCLUDE STRUCTURE ALSMEX_TABLINE.
DATA: END OF IEXCEL.
PARAMETERS: FILENM LIKE rlgrap-filename MEMORY ID M01,
NOHEADER AS CHECKBOX.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = FILENM
i_begin_col = 1
i_begin_row = 1
i_end_col = 100
i_end_row = 30000
tables
intern = IEXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'EXCEL UPLOAD FAILED ', FILENM, SY-SUBRC.
endif. -
Problems Uploading a Pages file in html format including pictures to web pa
I have problems uploading a Pages file in html format to a web page.
The files itself is downloaded but the images are not. How can I upload a page file in html including the pictures or illustrations?I just bought a macbook as well as the iwork software. I am having a few problems. I am a student and when I try to print out documents (originally word documents) it puts them automatically into textedit instead of pages. Also, the pages get all screwed up, things are missing, etc. How do I make pages my default and do i need to export? import? or do something so that these documents show up perfectly in pages?
A second questions- When i try to print out slideshows in keynote (originally from powerpoint) the handouts print on the little edge of the paper horizontally rather than the long way. I am hoping these are easy adjustments.
I would appreciate any help anyone can give me.
Thank you! -
I'm on 9i on a Microsoft Windows Server 2003.
What are some of the native tools to Oracle 9i for uploading a CSV File to a Table in the Database?Alex
I realize that "evangelist" is part of your job title. But are you really intending to exhume any old thread the search engine chucks that which may be relevant to your product? Because you are really going to start annoying people soon.
Obviously you will claim that your company's dual GPL/commercial licensing policy means that you are not violating these forums' Terms of use. But as your ultimate aim is no doubt to get people to buy the non-GPL option I suggest that you are breaking this rule: Forums shall be used in a noncommercial manner only.
Furthermore, a sufficient amount of this type of thread-bombing would (IMO) constitute unsolicited bulk e-mail, "junk mail," "spam" or chain letters.
Namaste, APC -
Upload a csv file in application server with the specified codepage(Poland
Hi,
i want to upload a csv file in application server with the specified codepage ( for poland ) , please let me know how to use open dataset for that.?
AnuragI would upload the file with transaction CG3Z in binary mode and do the code page translation with a report: read from server an save with different name.
-
Netbeans - How to Upload a csv File
Hi all
A J2EE question from a java beginner:
I am using NetBeans and JBoss to develop a web application.
I need to create a JSP page for user to upload a csv file and then read from the csv file (the file is in certain fixed format).
The csv file will be read line by line to be updated into database.
In JSP Page I have this:
<td align="left" scope="col"><input type="file" name="meterList" id="meterList"></td>
<td><input type="submit" name="upload" id="upload" value="Upload File" ></td>What should I do in Servlet when I clicked on the "Upload" button?
How if I want to control the uploading size and type of the the file?
How to get the file to be processed in servlet?
Your help is much appreciated.
Thanks alot.this question has been asked a million times
try searching next time
and uploading a csv file has nothing to do with netbeans -
Problem in uploading xls/csv file with Email address through oracle forms
Dear all,
I've created an interface to upload data from xls
and csv files to database tables.
I'm sucessed in this. Now i'm facing an issue.
If the xls/csv file having Email address,the
upload activity is not working..junk characters is
getting stored.
I came to know that, xls .csv file having email
address with hiperlink. so this may cause the
issue (just guessing)..
we can't restrict users to upload email without
hiperlink.. so what is the alternative to do
this..
Email address
[email protected]
[email protected]
[email protected]
etc...Can you give some more information:
What versions of Forms, database, Java, browser are you using?
How are you uploading data? Please show us your code.
What do you mean by "email with a hyperlink"? -
How to upload multiple .CSV files in the same time.
Hi Legends,
Can anyone please help me to resolve my issue?
This is very urgent and critical.
Description:
We have two users.1)edw_user_dump
2)prd_udm.
We need to upload the xx.csv file at the same time for these two users in oracle forms.
we have differentiated .csv file name based on the user names.
the main problem is in the sql loader command the xx.csv file name is created but the data is not captured in the server (kentucky) .
Below is my code for the upload.
-- To delete the Part_Mast.log file from the client
DECLARE
pid WEBUTIL_HOST.PROCESS_ID;
v_result PLS_INTEGER;
v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
BEGIN
v_result := WEBUTIL_HOST.Get_return_Code(pid ) ;
host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
END;
DECLARE
l_success boolean:=FALSE;
l_bare_filename varchar2(100):=NULL;
v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
BEGIN
-- Delete the content of the log and bad file
host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
--host('cat /dev/null > /tmp/Part_Mast.bad');
-- Upload the data file to Application Server
l_bare_filename := v_username||'_'||substr(:FIC_SOURCE,instr(:FIC_SOURCE,'\',-1)+1);
l_success := webutil_file_transfer.Client_To_AS_with_progress
(clientFile => :FIC_SOURCE
,serverFile => '/tmp/'||l_bare_filename
,progressTitle => 'Upload to Application Server in progress'
,progressSubTitle => 'Please wait'
,asynchronous => false
,callbackTrigger => null
IF l_success THEN
NULL;
ELSE
null;
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE Form_Trigger_Failure;
END;
DECLARE
v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
begin
host('cat /dev/null > /tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log');
host('cat /dev/null > /tmp/EDW_CF_IO_UPLOAD.bad');
end;
BEGIN
DECLARE
v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
v_password varchar2(30) := GET_APPLICATION_PROPERTY(PASSWORD);
v_connect_string varchar2(30) := GET_APPLICATION_PROPERTY(CONNECT_STRING);
a_host varchar2(500);
BEGIN
a_host :='/tmp/'||v_username||'_'||'"CF615 IO Upload.csv"';
host('sqlldr '||v_username||'/'||v_password||'@'||v_connect_string||' '|| 'control=/home/edw_bis/ctl/GLB_CF_IO_UPLOAD.CTL'||' '|| 'DATA=a_host'||' '|| 'LOG=/tmp/'||v_username||'_'||'EDW_CF_IO_UPLOAD.log SKIP=1 errors=200000 DIRECT=FALSE');
dbms_output.put_line(a_host);
END;
DECLARE
v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
begin
host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
EXCEPTION
WHEN OTHERS THEN
RAISE Form_Trigger_Failure;
END;
end;
DECLARE
al_id3 ALERT;
al_button Number;
BEGIN
edw_user_dump.SANM_PRC_MERGE_CF_IO_UPLOAD(:global.v_plsql_res,:global.v_ins_rec,:global.v_upd_rec);
IF NVL(:global.v_plsql_res,0) = 0 and (:global.v_ins_rec !=0 OR :global.v_upd_rec != 0 ) then
al_id3 :=FIND_ALERT('ROWINS');
SET_ALERT_PROPERTY(al_id3,alert_message_text,' Process Completed Successfully!'||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec);
al_button := SHOW_ALERT( al_id3 );
ELSIF (:global.v_plsql_res IN(-1,0) or :global.v_plsql_res > 0) and (:global.v_ins_rec =0 and :global.v_upd_rec = 0 and :global.v_del_rec =0 ) then
al_id3 :=FIND_ALERT('ROWINS');
SET_ALERT_PROPERTY(al_id3,alert_message_text,' Process Failed. Please Download the Log File '||CHR(10)||' Rows Failed : '||:global.v_plsql_res||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec);
al_button := SHOW_ALERT( al_id3 );
ELSE
al_id3 :=FIND_ALERT('ROWINS');
SET_ALERT_PROPERTY(al_id3,alert_message_text,'Please Download the Log File '||CHR(10)||' Rows Failed : '||:global.v_plsql_res||CHR(10)||' Rows Inserted : '||:global.v_ins_rec ||CHR(10)||' Rows Updated : '||:global.v_upd_rec );
al_button := SHOW_ALERT( al_id3 );
END IF;
EXCEPTION WHEN OTHERS THEN
RAISE Form_Trigger_Failure;
END;
DECLARE
v_username varchar2(30) := GET_APPLICATION_PROPERTY(USERNAME);
begin
host('cat /dev/null > /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
host('rm -rf /tmp/'||v_username||'_'||'"CF615 IO Upload.csv"');
end;
Thanks in advance!
Thanks,
MadhusudhananMadhusudhanan,
A couple of observations. First; always list your exact Forms version (eg; 10.1.2.0.2 not 10g R2). In most cases, the solution is different depending on the Forms version. Second; why must you use Forms to kick off a SQL Loader process? This is a server-side process and should be initiated by a server side process. If you absolutely must use Forms to kick off the process, again we need your Forms version in order to offer any solutions. Based on your code sample, I can asusme you are at least using Forms 9i becuase you are using WebUtil.
Is your Database and Application Server the same physical computer? If they are not, this would explain why your HOST command isn't working because HOST runs against the Application Server not the Database server.
Third; have you considered using and External Table (if your RDBMS version supports them) for each of the files you are attempting to upload? In this instance, it would be helpful to know your RDBMS version as well. External Tables can be a little frustrating to set up the first time, but as with any new construct you use - it gets easier the more you use it.
Fourth; are you getting any errors in your log file(s)? If so, what are the errors? Please list the full error message if you have one.
Finally, with respects to your statement:
Posted: Mar 18, 2011 2:30 PM - Madhu This is very urgent and critical.>
You have to understand that forum contributers are all volunteers - this is not our full-time job. If your issue is truely urgent I suggest you open a Service Request (SR) with Oracle Support! ;-)
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Uploading a csv file through XDB FTP
Hello
I'm developing a project where i need to upload a big amount of data, contained in a CSV file, on the file system of a database server and it would be great if the FTP service provided with XDB could be used to achieve such a job.
Does somebody know if XDB-FTP is able to upload files outside the XML repository and to upload them directly ( without intermediate steps that may generate heavy redo-log generation ) into a file-system on the database server?
I'd like to consider other good alternatives too, now I'm using a different FTP server but I would like to avoid this dependency.
Thanks
Bye AlessandroI finally solved the problem using a Java class that launches a daemon listening for an incoming connection, that stores the first stream on a text file and then terminates.
Definition of the java class
create or replace and compile java source named SimpleFileTransfer as
import java.net.*;
import java.io.*;
class SimpleFileTransfer {
private int port;
private int timeout;
private ServerSocket serverSocket;
private int buffSize = 8192;
private String savingFilePath;
public SimpleFileTransfer( int port, int timeout, String fname) throws IOException,SocketException {
this.port = port;
this.timeout = timeout;
this.savingFilePath = fname;
serverSocket = new ServerSocket(port);
serverSocket.setSoTimeout(timeout);
public void prepareToReceive() {
System.out.println("Preparing to receive "+savingFilePath+" on port "+port);
(new FileWriter()).start();
//System.out.println("Prepared to receive");
class FileWriter extends Thread {
Socket socket;
BufferedReader in;
PrintWriter out;
public void run() {
//System.out.println("Server started");
try {
socket = serverSocket.accept();
//System.out.println("Ready to receive");
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintWriter(savingFilePath);
char arr[] = new char[buffSize];
int readBytes;
while ( (readBytes = in.read(arr,0,buffSize)) >= 0 ) {
//System.out.println("Receive data starting with "+arr[0]);
out.write(arr,0,readBytes);
out.flush();
in.close();
out.close();
catch (IOException e) {
e.printStackTrace();
//System.out.println("Terminated");
public static void activateService(int port,int timeout,String savingFilePath) /*throws SocketException, IOException*/ {
try {
SimpleFileTransfer ft = new SimpleFileTransfer(port,timeout,savingFilePath);
ft.prepareToReceive();
catch (IOException e) {
e.printStackTrace();
public static void main(String args[]) throws IOException {
int myPort = 21000;
if (args[0].equals("server")) {
activateService(myPort,10000,"C:\\\\D.dat");
else (args[0].equals("client")) {
Socket s = new Socket("database_host",myPort);
BufferedReader in = new BufferedReader(new FileReader("D:\\\\D.dat"));
PrintWriter out = new PrintWriter(s.getOutputStream());
int readBytes;
int buffSize = 8192;
char arr[] = new char[buffSize];
while ( (readBytes = in.read(arr,0,buffSize)) >= 0 ) {
//System.out.println("Send data starting with "+arr[0]);
out.write(arr,0,readBytes);
out.flush();
in.close();
out.close();
}Definition of PL/SQL wrapping procedure to activate the daemon on the database
create or replace
procedure ENABLE_TRANSFER (
port in number,
millis_timeout in number,
saving_incoming_path varchar2
) is
language java
name 'SimpleFileTransfer.activateService(int,int,java.lang.String)';Activation of the daemon
begin
enable_transfer(21000,10000,'C:\temp\incoming.txt');
end;Sample call to the main method of the class to work as client for uploading.
prompt> java SimpleFileTransfer clientBye Alessandro
Maybe you are looking for
-
Tecra S11 mini Dsiplayport - sound output
Hi, I have read the user manual and I did not see anything about mini Displayport sound output. Is Tecra S11 supports sound output via mini displayport? Are there any mini displayport to HDMI cable which supports sound to send video and AUDIO to my L
-
Transport of ALE Interfaces for Function Module
hi, i have a Z function module, Z business object type and z message type identifying ALE interface. i need to move all the objects from Dev R3 to QA R3. What are the steps involved? Thanks, Tirumal
-
My eyedropper tool is automatically placing a selected color as the background color. I'm not sure what I did to change that. Can anyone help me figure out how to make it place the selected color as the foreground again. Thanks.
-
CORRECT PATH FOR BCT FI,CO,GL,LO COCKPIT AND MORE
HELLO MY EXPERTS ACTUALLY WE HAVE ACTIVATED THIS BUSINESS CONTENT OF FI-GL, AP, AR, AA, CO, FUNDNS MANAGEMENT PUBLIC SECTOR, LO COCKPIT, SD,MM,PM AND PURCHASING, RH AND TRESHURY. MY QUESTION IS WHATS IS THE CORRECT FLOW BECAUSE IN THE SAP HELP AND M
-
PB G4 17" doesn't recognize it is plugged in or charge battery
My Powerbook G4 17" doesn't recognize it is plugged in (battery icon doesn't show "plugged in" icon) nor will it charge battery (down to 42%!). I live far from an Apple dealer and know no one else who has a Powerbook so I can borrow their cord. I hav