Create text files-very urgent
how can i create a text file using 'comma' as delimiter.moreover table is having
around million records,i want to create a sy for eg.about 10 thousansd.is it a
time consuming process.Pls help me
Using SQL*Plus to format the output is easiest way
set colsep ,
set lines 1000
set pages 1000 -- or you can use pages 0 to suppress the column headings
spool output.txt
select * from emp where rownum < 10
spool off
EMPNO,ENAME ,JOB , MGR,HIREDATE , SAL, COMM, DEPTNO
7369,SMITH ,CLERK , 7902,17-DEC-80, 800, , 20
7499,ALLEN ,SALESMAN , 7698,20-FEB-81, 1600, 300, 30
7521,WARD ,SALESMAN , 7698,22-FEB-81, 1250, 500, 30
7566,JONES ,MANAGER , 7839,02-APR-81, 2975, , 20
7654,MARTIN ,SALESMAN , 7698,28-SEP-81, 1250, 1400, 30
7698,BLAKE ,MANAGER , 7839,01-MAY-81, 2850, , 30
7782,CLARK ,MANAGER , 7839,09-JUN-81, 2450, , 10
7788,SCOTT ,ANALYST , 7566,19-APR-87, 3000, , 20
7839,KING ,PRESIDENT, ,17-NOV-81, 5000, , 10
You can play around with your SQL and column data format to how you want
Cheers
Dave
Similar Messages
-
Problem in creating text file from report file
Hello Everybody...
I have problem in creating text file.
I had set System Parameter as below
DESTYPE : File
MODE : Character
DESNAME : gayu.txt
And ruler setting
Units : Character Cells
Character Cell Size : Horiziontal = 7
Vertiacle =12
GridSpacing : 1
no of snap points per grid spacing : 1
but when i run report it will give error
"REP_1219 M_2 or R_2 has no size -- length or width zero"
so is there any solution of that
or another way to convert report into text file?....Hi Folks,
Please don't go after that Error as its a very deceptive one. Please don't go for altering your design Or changing the size of items in your layout.
Similar errors I have come across in reports. I think its due to file transfer type. You might have transferred the file in Binary and your File Mode I am seeing it as CHAR.
This normally happens while making the Report Format as "Text". Either you change that format which I think is possible in your case as your basic requirement is making a report output of CHAR type.
Please check for this error in Metalink and proceed accordingly. I could fix similar errors when I changed Format type to PDF(from text).
Regards
Shibu -
Hi all
I have a table LFA1 with headers LIFNR, MANDT, NAME1, NAME2, ...., . That table contains data and I need to create text file that collects all headers with all data, where each field is separated by TAB.
thanks for your help.Here is program for KNA1.
*"Table declarations...................................................
tables:
kna1. " General Data in Customer Master
*"Selection screen elements............................................
select-options:
s_kunnr for kna1-kunnr. " Customer Number 1
*" Type declarations...................................................
types:
begin of type_s_customer_details,
name like kna1-kunnr,
address like kna1-adrnr,
title like kna1-anred,
createdon like kna1-erdat,
createdby like kna1-ernam,
end of type_s_customer_details.
Internal table to hold General Data in Customer Master data *
data:
t_customer_details type table
of type_s_customer_details
with header line.
START-OF-SELECTION EVENT *
start-of-selection.
perform select.
*& Form select
This subroutine selects information from database and exports the *
data into presentation layer *
There are no interface parameters to be passed to this subroutine. *
form select .
select kunnr
adrnr
anred
erdat
ernam
into table t_customer_details
from kna1
where kunnr in s_kunnr.
if sy-subrc ne 0.
write : / 'DATABASE SELECTION FAILED'.
else.
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = 'd:\customer_details.txt'
filetype = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
FILELENGTH =
tables
data_tab = t_customer_details
FIELDNAMES =
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22
if sy-subrc <> 0.
write : / 'Upload Failed' , sy-subrc.
else.
write : / 'Upload Completed'.
endif.
endif.
endform. " SELECT -
How to create text file of report in 10g
Hi,
I want to create text file of report in character mode and print that text file, without view it on screen.
i want to do this in Oracle developer 10g and run this report on web.
what coading i required to do for this pls. help me.Hello,
Execute the Reports with the parameters MODE=CHARACTER DESTYPE=PRINTER DESNAME=<printer name>
Regards -
How to create text file like this?
I want to create text file like attached file. I thought to create 2 text file: First text file make the headers ( Position, value 0,value 1....) , Second file make the table of data. Then combine them to be third text file. Someone can post other solutions?
Attachments:
testdf.txt 1 KB
try_textfile.vi 18 KBHi ha noi,
you don't need 2 intermediate textfiles!
Just write the header line first, then attach lines containing values...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Create text file in Database Trigger
Hello,
How to create text file in the database trigger. I am working on Row level trigger which has select statement if statement fails I have to create text file and insert record in text file. I tried to use file1 TEXT_IO.FILE_TYPE package it does not works.
Thanks,
AtifTEXT_IO is not available on the database. It is only available if you are doing client-side PL/SQL development in Oracle Forms. On the database side, you can use the UTL_FILE package.
Since writing to a file is not transactional, however, and because Oracle may have to call a trigger multiple times to ensure write consistency:
http://tkyte.blogspot.com/2005/09/part-iii-why-is-restart-important-to.html
http://tkyte.blogspot.com/2005/08/part-ii-seeing-restart.html
http://tkyte.blogspot.com/2005/08/something-different-part-i-of-iii.html
you aregenerally better off not writing to a file in a trigger. The better answer is generally to use Oracle Asynchronous Queues to send a message to another process that actually writes the file. That way, if the transaction rolls back, nothing gets written to the file.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Down load or create text file using bapi
hi friends,
My requirement is to create text file or down load text file in presentation server when the bapi runs in which the ip address is defined at the interface.
plz sujjest me,
points will be rewarded .
prasad.Hi,
The FM 'GUI_DOWNLOAD' should use the network path like '
10.10.10.10\shared_file\PO.txt'. Pass this value to the file path parameter and execute the program.
Thanks..
Preetham S -
Create a batch file "very urgent"
i want to create a batch file that run every hour to update the user_status table fields according to the following formula
if login = 1 and login_time status = 0 then login =3Write this statement into a text file and name it as
say test.sql
UPDATE user_status
SET login = 3
WHERE login = 1
AND login_time = 0;Then write a script in UNIX as following
$vi test_script.ksh
!# /bin/ksh
sqlplus `@test.sql`save it
write a crom job for every hour.
Codes not tested...
Hope this helps
Ghulam -
Communication b/w SAP and VB .exe file - Very urgent.
hi,
I am currently in a project implementing SAP for a cement manufacturing company. Here we have a VB .exe file which takes parameters and return values. now we need to connect this to application to SAP R/3 to pass data to that application and access the data from that .exe file.
Note: we don't have any source code for that vb .exe file its a third party software.
Its an very urgent one....
please guide me how to do it with all steps.
Any material please pass to [email protected]
Thanks in advance.form grosswt .
refresh itab3.
clear itab3.
Executing VB EXE file to get the weight from weigh bridge
call function 'WS_EXECUTE'
exporting
DOCUMENT = ' '
CD = ' '
COMMANDLINE = ' '
inform = 'X'
cd = 'C:\SAPWEI'
program = 'C:\sapwei\MyVB.exe'
STAT = ' '
WINID = ' '
OSMAC_SCRIPT = ' '
OSMAC_CREATOR = ' '
WIN16_EXT = ' '
EXEC_RC = ' '
IMPORTING
RBUFF =
EXCEPTIONS
FRONTEND_ERROR = 1
NO_BATCH = 2
PROG_NOT_FOUND = 3
ILLEGAL_OPTION = 4
GUI_REFUSE_EXECUTE = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Fetching Value from VB text file
call function 'WS_UPLOAD'
exporting
CODEPAGE = ' '
filename = 'C:\sapwei\w1.txt'
FILETYPE = 'ASC'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
tables
data_tab = itab3
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at itab3.
v1 = itab3-num.
pgrwt = v1.
endloop.
message 'Save Gross Weight' type 'S'.
endform. " grosswt -
Seeking simple example pl/sql to create text file from table data
hello,
I am hoping someone can provide very simple example of creating a file on my local harddrive using a pl/sql program. The basic steps are as follows:
First, I store some text in a varchar2 variable like this:
1. select sometext into otextvar from mytable where recordid = 1;
Second, I want this text to become a file in my data directory:
2. c:\data\sometext.txt
The second step is where I need help.
Any suggestions are greatly appreciated.Use this function
It will create for you a file in your /home/oracle directory with sysdate name and will insert all table names in it
CREATE OR REPLACE PROCEDURE my_proc AS
CURSOR cursor1 IS
SELECT table_name from all_tables;
CURSOR cursor2 IS
SELECT sysdate from dual;
rec1 cursor1%ROWTYPE;
rec2 cursor2%ROWTYPE;
created_file_name VARCHAR2(100);
file_name utl_file.file_type;
BEGIN
OPEN cursor2;
LOOP
FETCH cursor2 INTO rec2;
EXIT WHEN cursor2%NOTFOUND;
created_file_name:=rec2.sysdate;
file_name := utl_file.fopen('/home/oracle', created_file_name,'W');
OPEN cursor1;
LOOP
FETCH cursor1 INTO rec1;
EXIT WHEN cursor1%NOTFOUND;
utl_file.putf(file_name, '%s\n',rec1.TABLE_NAME);
END LOOP;
utl_file.fclose(file_name);
END LOOP;
END my_proc;
SQL>exec my_proc; -
Export to text file very, very slow
Hi, I am running 2.1.0.63 and doing an export of a query to a text file. The export was 66000 rows, but took incredibly almost around 2 hours to finish. The row counter in the status bar was very slow. The same exact query/export under 1.5.4 ran in about 5 mins. The row counter on both the fetching and exporting was just flying by.
Has anybody else experienced this ? What could be causing it to run that slow under this release ?
The other issue I have is once there has been no activity for a while, sqldeveloper hangs has to be restarted. I saw this being addressed in another post however, and will follow it there.
Any ideas on when a patch will be made available to this release ?
BTW, I really like some of the other new features of this release.
Thanks,
MarkOk, I think the issue was that I was exporting to a shared network drive. I redid it, saving it locally and it worked fine.
I still have the issue of inactivity and having to restart sqldeveloper.
Thanks. -
Create text file from form data
I need to create a form using dreamweaver and coldfusion. We
do not have coldfusion server. just Dreamweaver 8. Until we decide
what application server we will use, I need to create a text file
each time a user submits data from a form and put the data into a
text file. What would be the best way to handle this?if you do not have an application server like CF or PHP or
ASP (or
other) to process your form submissions, you should look for
a perl/cgi
script that can do it for you. i remember from awhile ago a
script
called bnbform from bignosebird.com ... it is used for
emailing form
submissions to a designated email address, but if i remember
correctly
it also stored form data in a text file....
Azadi -
Creating text file from SQL with adding counter in Filename.
Hi,
I have a requirement for creating the Tesxt files from Oracle DB which i can achieve by ODISQLUNLOAD.
But tricky part is that i want have a file name+ counter such that Counter should start with 1 for the first file of the day, then 2,... and reset to 1 for every new date.
e.g. file0001, file0002,file0003,file0004,.... file0100 and so on for one day.
But when i will create a file on next day it should be created as again file0001, file0002,file0003,file0004,.... file0100 and so on.
I may be able to achieve this using some variables but unable to think how could i achieve this.
Any help would be appreciated.
Thanks and Regards,
MaheshHi Mahesh,
If the files are loaded as one batch process, for instance, by executing a single package, you could perform a looping function and store the counter as a variable. It would be very similar to the blog post here: https://blogs.oracle.com/dataintegration/entry/using_variables_in_odi_creatin - but you would be using the #counter variable in your filename. Each day that the package is run, the counter starts at 1.
Hope this will fit your needs.
Enjoy!
Michael R. -
Email a created text file by the click of a button
Hi
What I am trying to do it that: In the Front Panels, All the data is collected via String Control and other Control, then when a press saved, a text file is created and stored in the path that I specified.
It is possible in LabView to using a Button called 'Email Created File' to then e-mail that file as an attachment.
What VIs or example does such a thing?
P.S. I'm deploying it to a PDA.
CheersVI below
Attachments:
email.vi 36 KB -
Cannot create text file acrobat reader X
Hi,
I am trying to create a text file for logging purposes. The creation of the text file works fine in Reader 8 & 9, but not in Reader X. I am just putting the file in the current directory of the pdf (for now on the Desktop), so it should have access/privileges to create the file.
ASFile pFile;
ASPathName volatile PathName = NULL;
PathName = ASFileSysCreatePathName(ASGetDefaultFileSys(), ASAtomFromString("Cstring"), "testA.txt", 0);
if (!PathName)
ASRaise (ASFileError(fileErrOpenFailed));
AVAlertNote("A");
ASInt32 ret1 = ASFileSysOpenFile(NULL, PathName, ASFILE_CREATE|ASFILE_WRITE, (ASFile*)&pFile);
if (ret1 != 0)
AVAlertNote("A1");
char buf[33];
sprintf(buf,"error %d",ret1);
AVAlertNote(buf);
return 0;
AVAlertNote("B");
In reader X the alert sequence is:
"A" -> "A1" -> "error 1074593797"
Instead of just "A" -> "B"
Any help would be appreciated.
Regards,
MagdaYou need to read up on the new Sandbox in Reader X.
Maybe you are looking for
-
Satellite L50-B-1XF - Win 7 64bit drivers and software
Hello, as I can't find anything about my model - Satellite L50-B-1XF (PSKTUE-04C00WGR) I will try it here... I bought two of these (one for me, one for my wife) with Win8.1 installed. Well... no need to say that this is one of the worst OS I ever see
-
dears, i have purchased a new macbook pro with lion os, then after a while for a notification to update the iPhoto app, and when i tried to update it said that unable to update, then i uninstalled it, then i tried to install it but it said these app
-
Ive changed devices phone and computer but i cant seem to retreive all my bought ringtones?
i just want to know how can i get my ringtones back that ive already purshased in the last 4 yrs of me having an iphone
-
O man, it won't work for nothing!
Ok hello everyone, I'm new to this whole router stuff. I have a WRT54G v.6 wireless-g broadband router that i just bought. I have a PC running Windows Me(I know, it sucks but luckily my laptop has WinXP) ISP: Verizon DSL Now the first thing i did was
-
Depreciation on assets with asset shutdown
To stop depreciation on assets with the 'asset shutdown' our test asset still shows planned posting of .01 one month and -.01 the next. Is this due to configuration of the depreciation key? Or, is there a program to make 'planned' equals 'posted' to