Query the data and generate the flat file (.txt).

Hello

I work in Navision Financials Oracle E-Business Suite (11i).

I would like to implement a concurrent program that queries the database and output the results in a text file that I will ftp to an ftp server.

I would like to be able to do this by a pakcgae of PL/SQL, I do this with a PL/SQL package? How do I need to pass the query results? i.e. should I CHOOSE IN whatever it is, open a ref_cursor or put the results in a log or something that needs to be passed to the application? Or should I be queue info somewhere?

I could make it more difficult to do, but I just need someone to help me through the steps if possible - it would be greatly appreciated as I'm a bit stuck and need to do this quite quickly.

Thank you

Chris

You can use utl_file for the creation of a file.
The valid path lies in the parameter $ v where name like '% utl % '.

The steps would be
(1) create a unix call and your package shell script using fnd_request.submit_request
(2) in your package, use utl_file and ftp the file to another server

[http://sureshvaishya.blogspot.com]

Tags: Oracle Applications

Similar Questions

  • How to read the date and time of a file by labview information

    How to read the date and time of a file by labview information? for example, time created and updated time.

    The similar question had already spoken here (this is the old thread but still seems topical):

    http://forums.NI.com/T5/LabVIEW/file-date-created/TD-p/109836

  • Export a table for the flat file and must insert sysdate in flat file column

    Hi, I created an interface allowing to export an oracle table to a csv file. All the columns in the table work well. Then I need to insert the sysdate in a column in the csv file.

    I made the map as working in the transit area, implementation is to_char(sysdate,'dd/mm/yyyy'). But the result is insert in column 14.

    I tried to create a variable refreshing that choose double to_char(sysdate,'dd/mm/yyyy'), maps then as the csv file column, but he only insert 1 row and the format is YYYYMMDD.

    I tried to use SELECT '< % = odiRef.getSysDate ("YYYYMMDD") % >' double to the variable and it also only insert a line in the flat file.

    I used the same methodology in ODI10g, it works fine.

    So, I wonder how it can be implemented in 11g.

    Thank you

    It turns out that I used the snapshot_date as a field name, it may be a reserved word. After that I changed the name of the field, it works fine. Thank you.

  • Access to the flat file error

    Hello

    My Source is access DB and target is flat file.
    The IKM I use is IKM SQL to add files.


    When I try to run the Interface, I get this error: -.

    3100: 37000: java.sql.SQLException: error [Microsoft] [ODBC Microsoft Access driver] syntax (missing operator) in query expression ' CUSTOMER. [CustomerID] CUSTOMERID "."
    java.sql.SQLException: error [Microsoft] [ODBC Microsoft Access driver] syntax (missing operator) in query expression ' CUSTOMER. [CustomerID] CUSTOMERID "."

    at sun.jdbc.odbc.JdbcOdbc.createSQLException (unknown Source)

    at sun.jdbc.odbc.JdbcOdbc.standardError (unknown Source)

    at sun.jdbc.odbc.JdbcOdbc.SQLPrepare (unknown Source)

    at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement (unknown Source)

    at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement (unknown Source)

    at com.sunopsis.sql.SnpsQuery.a (SnpsQuery.java)

    at com.sunopsis.sql.SnpsQuery.a (SnpsQuery.java)

    at com.sunopsis.sql.SnpsQuery.updateExecStatement (SnpsQuery.java)

    at com.sunopsis.sql.SnpsQuery.executeQuery (SnpsQuery.java)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders (SnpSessTaskSql.java)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt (SnpSessTaskSql.java)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt (SnpSessTaskSqlI.java)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask (SnpSessTaskSql.java)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep (SnpSessStep.java)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession (SnpSession.java)

    at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand (DwgCommandSession.java)

    at com.sunopsis.dwg.cmd.DwgCommandBase.execute (DwgCommandBase.java)

    at com.sunopsis.dwg.cmd.e.i (e.java)

    at com.sunopsis.dwg.cmd.g.y (g.java)

    at com.sunopsis.dwg.cmd.e.run (e.java)

    at java.lang.Thread.run (unknown Source)

    Would appreciate the help.

    Chanduwar

    Hi Chandwar,

    As we discussed in Gtalk,
    the problem is the quotes in the select query.

    Select
    CUSTOMER. "" ' Town.
    CUSTOMER. "' Region '.
    'Customer' as a CUSTOMER
    where (1 = 1)

    Please customize step KM

    <%=snpRef.getColList("", "[EXPRESSION] [ALIAS_SEP] [CX_COL_NAME]", ",\n\t", "", "INS and !TRG") %>

    to remove the quotes and the expression of the Alias
    Please reffer to the PDF API user to customize the same.

    An additional point->

    Please try to use the appropriate kms which is dedicated for each technology,
    This will improve the performance and this kind of questions.

    Kind regards
    Its

  • Remove users from UDF attribute of unique values present in the flat file

    Hello
    I'm trying to remove users from the IOM by using a single value of one of the present of the UDF in the flat file for example say SSN. I preferred the approach to go through a scheduled task to remove users from IOM. I know that the permanent deletion of IOM through the database is not possible. To have written a custom code to do the same thing and I have used the tcuseroperationintf.deleteuser(long...) method. But I had a straight and simple query for the same thing. Should what value I contact in the long appropriate field in the list of the attributes of this method?

    Any guidance on this task would be appreciate.

    Thanks in advance,
    -oidm.

    You want to the Users.Key or the USR_KEY and give it in the format of variable length.

    -Kevin

  • Where to download the flat file for POC adapter

    Hi all

    We are currently looking at GoldenGate as a mechanism to capture changes to tables specified in an Oracle database and produce text files containing these changes in near real-time. Everything I read pointing adapter flat file for GoldenGate as a way to get there.

    I am now at the point where I want to start a little POC see prove if it will work for our needs. I downloaded GG for databases Oracle 12.1.2.1.0 RTO, as well as customer GG monitor and Director of GG. My question is now - where can I download the flat file adapter? It includes the GG for the download of Oracle?

    If I missed something in the documentation somewhere - I'm happy to be told where to read them.

    Kind regards

    John

    I'll answer my own question here...

    (1) delivery seems to be the only place to get it

    (2) 12 GoldenGate can capture a trail and send it to a configuration of GoldenGate 11 running FF adapter.

  • KM for the flat file to flat file

    Hello

    Including KM to use for the flat file to flat file extraction.


    Thank you.

    Hello

    Use LKM FILE SQL and SQL IKM FILE APPENDIX

    Make sure that the file exists and your waiting area is facing a pattern of RDBMS

    Thank you
    Fati

  • The use of javascript to save a pdf file in a different directory and generating a new file based on the form fields in the document name.

    I built the following script to create a submit button that will automatically save the document in a different directory on my computer. It will also use data form 'customer' field and 'date' to generate the file name. I printed the myPath variable, and it seems that he printed the correct string. I get the following error:

    TypeError: redeclaration of const path

    any help would be appreciated.

    var customer = this.getField("Customer").value;

    var date = this.getField("Date").value;

    var path = "C:/users/lead/My Documents/Test / '.

    Reg = date.match(/(\d+)\/(\d+)\/(\d+)/ var);

    var myPath = "C:/users/lead/My Documents/Test /" client + '_' + reg [1] + "." + reg [2] + "." +

    Reg [3] + ".pdf";

    this.saveAs (myPath);

    Thank you. It turns out that simply remove this additional path variable does the job. I used that in an earlier version of my code and I forgot that this is. My syntax also seems to be right.

  • How to view the flat file to ADF Flow task data

    Hello

    I have some data in a flat file.
    Now, I want to show the data in a table in the workflow of adf.

    Please help me to know how to achieve this functionality.

    Hello

    Have a look here: http://dstas.blogspot.de/2012/11/csv-files-with-adf-csvparser-example.html?m=1

    Once the file is loaded in a query of the VO, the workflow can construct the table by dragging the VO

    Frank

  • Create the flat file data from the oracle table

    d_adp_num char (10)
    d_schd_date tank (8)
    d_sched_code tank (25)
    d_pay_code char (50)
    d_mil_start char (4)
    d_mil_end char (4)
    d_duration char (5)
    d_site_code char (4)
    d_dept_id tank (6)

    Select payroll_id,
    schedule_date,
    reason_code, (sched_code)
    reason_code, (pay_code)
    start_time,
    end_time,
    total_hours,
    site_code,
    department_id
    of dept_staff
    where schedule_date between (sysdate + 1) and (sysdate + 90)


    loading data for the date range instead.
    sched_code - if 'Unavailable' reason_code = 'OD' and 'THE '.

    pay_code - "Berevevement BD" If reason_code = "BD".
    "UP PTO without reasonable excuse" If reason_code = 'UP '.
    "RG" If reason_code = "SH".
    "PTO" If reason_code = "GO".
    Here are some...

    start_time and end_time - convert military time
    based on start_ampm and end_ampm

    On this basis, I need help to create a flat file. Sewing of the flat and data file in dept_staff sample

    If site_code is there so no need to get department_id (see the sample flat file)
    ------------------------------------

    examples of data to flat file

    ZZW002324006072012 PTO
    0800160008.00
    ZZW002428106072012 RG
    1015174507.50HM34
    ZZW002391606072012 RG
    1100193008.50
    ZZW002430406072012 RG
    1100193008.50 130000
    ----------------------------

    dept_staff table data

    REASON_CODE_1 PAYROLL_ID SCHEDULE_DATE REASON_CODE START_TIME, END_TIME START_AMPM END_AMPM TOTAL_HOURS SITE_CODE DEPARTMENT_ID
    ZZW0024468 08/06/2012 HS HS 730 HAS 400 850 12 P
    ZZW0000199 08/06/2012 HS HS 730 HAS 400 850 14 P
    ZZW0023551 08/06/2012 SH SH 1145 A 930 975 GH08 95 P
    ZZW0024460 08/06/2012 SH SH 515 HAS 330 P 1025 GH08 95
    ZZW0023787 08/06/2012 SH SH 630 HAS 300 850 24 P
    ZZW0024595 08/06/2012 TR TR 730 HAS 400 850 90 P
    ZZW0023516 08/06/2012 OD OD 800 HAS 400 800 95 P
    ZZW0023784 08/06/2012 OD OD 800 HAS 400 800 5 P
    ZZW0024445 08/06/2012 SH SH 1145 A GH08 930 975 5 P
    ZZW0024525 08/06/2012 OD OD 800 HAS 400 800 23 P
    ZZW0024592 08/06/2012 TR TR 730 HAS 400 850 5 P
    ZZW0024509 08/06/2012 SH SH 95 MK21 830 HAS 330 P 700

    ZZW0023916 06/14/2012 SH SH 1100 A 850 27 730 P

    How to ask questions
    SQL and PL/SQL FAQ

    UTL_FILE allows to write the OS file

  • How to load the date and time from text file to oracle using sqlloader table

    Hi friends

    I need you to show me what I miss loading date and time text file in a table oracle using sqlloader

    It's my data in this way (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30
    my table in the database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);
    the code for the control in this path (c:\external\ctrl.ctl) file
    load data
     infile 'C:\external\my_data.txt'
     into table emp2
     fields terminated by ','
     (empno, ename, hiredate, etime, ejob, deptno)
    This is the error:
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Commit point reached - logical record count 5
    
    C:\>
    any help that I enjoyed

    Thank you

    Published by: user10947262 on May 31, 2010 09:47

    load data
    INFILE 'C:\external\my_data.txt '.
    in the table emp2
    fields completed by «,»
    (empno, ename, hiredate, etime, Elysa, deptno)

    Try

    load data
     infile 'C:\external\my_data.txt'
     into table emp2
     fields terminated by ','
     (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    

    This is the error:

    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Commit point reached - logical record count 5
    
    C:\>
    

    This isn't a mistake, you can see errors in the log file and bad.

  • Could not load the flat file (csv) through FDMEE

    Hi Experts,

    I am trying to load data from flat file to HFM via FDMEE, it throws the below error

    2014-06-06 16:35:13, 465 INFO [AIF]: beginning of the process FDMEE, process ID: 1 341
    2014-06-06 16:35:13, 465 [AIF] INFO: recording of the FDMEE level: 4
    2014-06-06 16:35:13, 465 [AIF] INFO: FDMEE log file: d:\orcl\FDMEE\outbox\logs\CONSOL_1341.log
    2014-06-06 16:35:13, 465 [AIF] INFO: User: hyp_admin
    2014-06-06 16:35:13, 465 [AIF] INFO: location: HFM UXC (Partitionkey:59)
    2014-06-06 16:35:13, 465 [AIF] INFO: period name: Apr-14 (period key: 1/04/14 12:00 AM)
    2014-06-06 16:35:13, 465 INFO [AIF]: name of the category: real (main category: 4)
    2014-06-06 16:35:13, 465 [AIF] INFO: name rule: HFM UXC D300 (rule ID:69)
    2014-06-06 16:35:15, 785 [AIF] INFO: Jython Version: 2.5.1 (Release_2_5_1:6813, September 26 2009, 13:47:54)
    [JRockit (R) Oracle (Oracle Corporation)]
    2014-06-06 16:35:15, 785 [AIF] INFO: Java platform: java1.6.0_37
    2014-06-06 16:35:15, 785 [AIF] INFO: log the file encoding: UTF-8
    2014-06-06 16:35:19, 132 [AIF] INFO: - START IMPORT STEP -
    2014-06-06 16:35:25, 188 [AIF] INFO: file name: UXC_D300_Apr - 14.csv
    2014-06-06 16:35:25, 360 FATAL [AIF]: error in Comm.doScriptInit
    Traceback (most recent call changed):
    File '< string >", line 347 in doScriptInit
    Exception: java.lang.Exception: NO details found for Loadid:1341

    2014-06-06 16:35:25, 655 FATAL [AIF]: load balances data launch GL error
    2014-06-06 16:35:25, 671 INFO [AIF]: end process FDMEE, process ID: 1341

    The pointers will be greatly appreciated.

    Thank you very much

    Jeff

    This error is usually related to if you do not properly apply patch ODI.

    Can you take a look at the opatch inventory, rollback FDMEE and ODI patch and then apply again.

    Make sure that these patches are applied successfully without any errors.

    Thank you
    ~ KKT ~.

  • Of size zero image blob in the flat file DB

    Hello friends,

    I am just new on ODI 11 G.

    Try to load images of flat filesystem from unix to Table DB using ODI 11 G.

    The image loaded by '0' File size - IE empty. I don't understand.

    Here the log files, control files and exit the generated file.


    CTL file:

    " )


    Appreciate your quick response.

    Thank you/kumar

    Published by: kumar73 on July 3, 2012 07:13

    Check the code you have. Your chemin_image is a FILLER. Thus, the LOBFILE charge NULL in the DB.

  • Ignoring the fields in the flat file

    I have a table with column empid and dat_of_birth. I get a flat file with fields location | empname | EmpID. salary | dat_of_birth
    How can I load only empid and dat_of_birth?

    In addition, how can even be done using external table?

    Hoek wrote:
    Load the entire file and select only the columns you need?

    No need. Simply use FILL even as in SQL * Loader. For example:

    Data file:

    New York|King|123|10000|04.21.1967
    Boston|Smith|456|5000|07.11.1976
    

    External table:

    CREATE TABLE test_tbl(
                          empid number,
                          dat_of_birth date
                         )
      ORGANIZATION EXTERNAL(
                            TYPE ORACLE_LOADER
                            DEFAULT DIRECTORY tmp
                            ACCESS PARAMETERS (
                                               FIELDS TERMINATED BY '|'
                                               (
                                                filler,
                                                filler,
                                                empid,
                                                filler,
                                                dat_of_birth date 'mm.dd.yyyy'
                                               )
                                              )
                            LOCATION ('test_tbl.txt')
                           )
    /
    
    Table created.
    
    SQL> select * from test_tbl
      2  /
    
         EMPID DAT_OF_BI
    ---------- ---------
           123 21-APR-67
           456 11-JUL-76
    
    SQL> 
    

    SY.

  • Add char strings in the flat file

    Hi all
    I need to insert in a flat file, the string "BEGINNING OF FILE" at the top of the file before the header and the string "END-OF-FILE" at the end of the file. I use KM 'IKM SQL to the file Append' and ODI.
    I need your help!

    Thank you.

    Giovanni Albetti

    Hi Giovanni

    I did some tests here and procedures using an os command looks like:

    I understand that you are under windows.

    1) put the first procedure with something like:

    echo START OF FILE > MyFile.txt

    (2) run you interface where myfile.txt is your target. Do not use the option Truncate

    (3) to the second procedure just write:

    echo END OF FILE > MyFile.txt

    There is no more simple...

    Make sense?

Maybe you are looking for