Save an oracle package to a flat file

Hallo,
how can I save an oracle package to a flat file?
Best Regards
Werner

Here is a script you can use. You may need to change the references to dba_source to user_source or all_source depending on your access privileges.
set termout off
store set sqlplus.cfg replace
column pkg_spec new_value pkg_spec noprint
column pkg_body new_value pkg_body noprint
set pagesize 0
set linesize 10000
set trimspool on
set echo off
set verify off
set feedback off
set timing off
set recsep off
set termout on
accept pkg prompt   'Package name:  '
accept owner prompt 'Owner:         '
set termout off
select lower('&&pkg') || '_spec.sql' pkg_spec,
  lower('&&pkg') || '_body.sql' pkg_body from dual;
spool &pkg_spec
select 'create or replace' from dual;
select text from dba_source
  where owner = upper('&&owner')
  and name = upper('&&pkg')
  and type = 'PACKAGE'
  order by line;
select '/' || chr(10) || 'sho err' from dual;
spool off
spool &pkg_body
select 'create or replace' from dual;
select text from dba_source
  where owner = upper('&&owner')
  and name = upper('&&pkg')
  and type = 'PACKAGE BODY'
  order by line;
select '/' || chr(10) || 'sho err' from dual;
spool off
@sqlplus.cfg
set termout on

Similar Messages

  • How to extract table from oracle in to delimited flat files

    Hi i have the following requirement.i tried one dump procedure but i could extract table one by one.i need to do extract on regular basis using plsql procedure.
    Data will be extracted from production tables in Oracle into pipe delimited flat files that will be sent by SFTP. The list below represents the tables that will be used for extract along with a notation whether the entire table is extracted or only incremental transactional data.
    Table name extraction type No of records
    EXPIRE     All Records     157 - One Time     All Records     17
    ACE All Records     7,970
    DATA All Records     5,868
    MEMBER     All Records     24,794,879
    MEMBER Incremental & Update     13,893,587 (Initial Load)
    MEMBERRED All Records     25,108,606
    MEMBERPOINT     All Records     42,487,640
    MEMBERCOM     Incremental & Update     14,337,561 (Initial Load)
    MEMBERCODE     Incremental Only     14,985,568 (Initial Load)
    MEMBERDETAIL     Incremental Only     14,341,890 (Initial Load)
    MEMBERHISTORY     Incremental Only     70,021,067 (Initial Load)
    suggest me how can i extract these tables by using plsql procedure.In the above table some table has be extract select list of column.

    Saubhik wrote:
    This may help you.
    Re: Dynamic Fetch on dynamic Sql
    Well I was going to post my standard response, but I see I don't have to. ;)

  • To Generate Oracle Package from OWB *.mdl file

    Hi,
    I want to generate an Oracle Package from OWB *.mdl file. I know this can be done using the OWB GUI. But is there a way to automate this using a script for a given set of mappings?
    Such a thing is required because I have a large number of mappings and i need to create the Oracle package scripts for the same.

    Hi borkur,
    As you told I tried the same in OMBPlus. I created a file called "comp_src.txt" with the following code:
    proc compile_mappings {} {
    OMBCONNECT owbrepos/owbrepos@blrkec20974d:1521:FDMD1B
    OMBCC 'FDM/BOE'
    OMBCOMPILE MAPPING 'BOE_EXPN_POPULATE_IU_1' OUTPUT VALIDATION_RESULT TO '/nav' WRITE
    SUCCESS
    OUTPUT GENERATION_SCRIPTS TO '/nav'.
    OMBCOMPILE TABLE 'T1' OUTPUT GENERATION_SCRIPTS TO '/nav'
    But i am getting an error message as below:
    OMB+> source C:/oracle/ora93/owb/bin/win32/comp_src.txt
    OMB+> compile_mappings
    Cannot establish connection in single-user mode!
    OMB+>
    I am new to OMBPlus and i came to know that Multi-user mode is default. Then why i am getting this error (Cannot establish connection in single-user mode!)
    Regards,
    Naveen

  • Oracle OWB integrator for Flat Files 3.0

    Hi,
    I have installed owb 11g r2 in my machine, but while creating flat files module for file import it is showing that
    it does not find *"Oracle OWB integrator for Flat Files 3.0"*. so i cannot use "import metadata using flat file wizard".
    do i need to install the owb again or the Oracle OWB integrator for Flat Files 3.0 alone..or how do i integrate it with owb....... please help if anyone can,,
    Thanks..

    Here is the certification matrix
    https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0CFEQFjAE&url=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fmiddleware%2Fdata-integration%2Fodi-11gr1certmatrix-ps6-1928216.xls&ei=mtmUUcX7DoiJrQek04DwAg&usg=AFQjCNGoOUFQHdK7Ti2DLb6vz_3s-miP3A&sig2=q3rf2foe9bl4_WbsLPwWng&bvm=bv.46471029,d.bmk

  • How to create a dynamic SSIS package for multiple flat file destinations

    Hi,
    I have to create a ssis package which has single data flow task and inside that I have 23 source (sql- select * from - statements)- destination (flat files, 23 distinct) connection.
    Now for each product I have to create separate SSIS package (i.e. if prod=abc then these read select * from abc_tables and 23 abc_ txt files)
    I want to do it dynamically, means only single package and inside that variables will take select * values for each source-dest connection (so i believe 23 variables) and same for destination flat files.
    Let me know. :)
    ANK HIT - if reply helps, please mark it as ANSWER or helpful post

    Sorry It seems you're contradicting yourself. you say I know my source and dest structure and the you're
    asking all I want is to have a dynamic structure
    what does that mean?
    and reading your next sentence
    I want to run a package for 5 products, instead of creating 5 ssis packages with 23 source- dest connection, I would
    like to have one with only 23 source- dest connections 
    What I feel is what you're looking for is to  have a looping structure to loop through each of the 5
    products.
    In that case what you could do is this
    1. Create a object variable in SSIS 
    2. Use a Execute SQL Task to populate the variable with all available products (I think you'll have a master table for that). Set ResultSet property to Full ResultSet and then in ResultSet tab map Object variable to 0 th index
    3. use a ForEachLoop container with ADO .NET recordset enumerator and map to object variable. Create a variable of datatype same as that of Product identifier field to get individual values out
    4. Inside loop create your data flow task with 23 source destination connection. In the query part use a parameter for product field and map it to the variable containing product value to get only data for the product.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can we save multiple IDocs as a single Flat file in R/3 system ?

    Hi,
    How can we save Multiple Idocs as a single Flat IDoc in R/3 (Not xmlized)
    Kulwinder

    Hi,
    Check this link for Mutiple IDOCs into single File.
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
    Regards,
    phani
    Reward points if Helpful:)

  • Extracting a flat file from oracle table

    I have moved the knowledge module KIM ISO SQL to FileAppend from the Metadata to my project folder.
    But when I create an interface mapping the oracle table and a flat file on a different unix server, in the drop down menu , it shows only KIM SQL TO SQL and KIM Control Append.It does not show up the SQL to FileAppend knowledge module option.
    What should I do to extract a flat file from oracle table?
    Thanks
    Hima
    Overstock.com

    All IKM in the Drop Down Menu are dependent of the target technology.
    A question, at this interface, is your target table a file ?

  • Extraction of procedure from DB to flat file

    I have recently moved from using Informix to Oracle and I am trying to find a way to extract a procedure from the Oracle database to a flat file on my system. Informix has utility dbschema which allowed me to do that, what does Oracle have that can do the same thing.
    Thanks,
    Bret.

    Bret,
    You can do the same using SQL*PLUS. To output a stored procedure, function or package to a flat file, you will have to query the user_source view. You need to know the procedure name.
    These are the steps:
    1) Log in to SQL*PLUS
    2) Issue the following statement:
    SET HEADING OFF
    SET FEEDBACK OFF
    spool file_name
    SELECT text from user_source
    WHERE name = 'PROCEDURE_NAME';
    spool off
    where file_name is the output file name the source code will be generated into. PROCEDURE_NAME is the name of the procedure, function or package.
    NOTE: The name of the procedure must be in upper case.
    Regards,
    John

  • How to create flat file with fixed lenght records

    I need help to export an Oracle table to a flat file with fixed lenght and without columns separator.
    the fixed length is the more important demand.
    My table have 50 columns with varchar, date and number .
    Date and number columns may be empty, null o with values.
    Thanks a lot for any help.
    [email protected]

    Hi,
    You can use this trick:
    SQL>desc t
    Name                                      Null?    Type
    NAME                                               VARCHAR2(20)
    SEX                                                VARCHAR2(1)
    SQL>SELECT LENGTH(LPAD(NAME,20,' ')||LPAD(SEX,1,' ')), LPAD(NAME,20,' ')||LPAD(SEX,1,' ') FROM T;
    LENGTH(LPAD(NAME,20,'')||LPAD(SEX,1,'')) LPAD(NAME,20,'')||LPA
                                          21                    aF
                                          21                    BM
                                          21                    CF
                                          21                    DM
    4 rows selected.
    SQL>SELECT *  FROM t;
    NAME                 S
    a                    F
    B                    M
    C                    F
    D                    M
    4 rows selected.Regards

  • SSIS Flat File Source not populating varchar column

    I have SSIS package that imports flat files with column separator | from "Flat File Source" into the database trough "OLE DB Destination".
    For one of the columns (file contains UIDs in curly brackets) destination column is varchar(250) null-able, when "Retain nulls" is set to true complete data have been imported, but when "Retain nulls" is set to false beside fact that in
    the file data is not null and it is not empty string it is not imported and in the destination column is empty string.
    I know that this "Retain nulls" applies to the columns that contains NULLs but this is not the case.
    If someone have experience with such issue please help.
    Thank you in advance.

    From your statement it looks like when you have curly brackets it skips the value and inserts nulls instead. And that may be the reason why its working fine when you change retain null value. 
    I would suggest 
    Make your setting "retain null" to true and load the flat file, then check what happens to the values having curly braces (is there any value or null) , if there is value we need to check for that(please share a sample file). And if it having null
    instead of "{value}", I would suggest to put a script task to remove { from your flat file and then try load the data.
    Hope this helps.
    Regards, -Amit

  • Generating a flat file

    Hi,
    I have data in my oracle DB and I generated the data using procedure, using consume adapter service, oracleDBbinding.
    The schema has been formed in my Visual Studio project which it will be my source schema. Now I need to generate a text file with a flat file format!! How do I accomplish that?
    I need that text file with a flat file format in order to create my destination schema using the flat file schema wizard!

    helpful!
    But I still can't figure out how to generate oracle data in a flat file format and insert these
    data to my destination schema using flat file wizard.
    What I'm trying to explain is that I don't have a sample file of data which I need to create based on the data that is available in Oracle DB.
    Example of data:
    PO1999-10-20
    US Alice Smith 123 Maple Street Mill Valley CA 90952
    US Robert Smith 8 Oak Avenue Old Town PA 95819
    ITEMS,ITEM872-AA|Lawnmower|1|148.95|Confirm this is electric,ITEM926-AA|Baby Monitor|1|39.98|Confirm this is electric

  • Web Dynpro component - Flat file upload

    Hi,
    We have a requirement to upload a flat file to Planning cube (real time cube) through Web Dynpro component.
    Web Dynpro component which we have developed is able to read the records from the flat file.
    Now, the issue is u201CHow can we save the records read from the flat file to planning cubeu201D?
    If anyone has worked on the similar requirement, pls reply. Thanks in advance.
    Note : We have a planning sequence which will be executed on the click of UPLOAD button.
                  This planning sequence has a filter on Infoprovider (cube which we are using for planning) and a planning function of type u201CFile uploadu201D in which we have defined the flat file format.
                  Aggregation level is made on Multiprovider which has 2 underlying cubes (One is realtime and other one is standard).
    Is there any function module in which we can pass the name of the flat file so that it will be uploaded in planing cube?
    Regards,
    Ankur

    You can deploy solution provided by Marc Bernard within following SDN's contribution:
    [u201CLoad a File into SAP NetWeaver BI Integrated Planningu201D |http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90cef248-29e0-2910-11bb-df8dece7e22c]
    This uses webdynpro functionality.

  • SSIS Compare 2 flat files and create a third flat file

    Hey all,
    I have two flat files structured as:
    Flat File A:
    3213,214,14,21421,354,325
    Flat File B:
    3213,214,14, 55,89, 21421,354,325
    I am trying to create an ETL Package that compares Flat File A, to Flat File B, finds an anomaly, in this case
    55,89, then outputs the anomalies to Flat File C, separated by commas.
    How would I go about doing this? Everything I have looked at shows comparisons between SQL DB's.
    Any suggestions?
    Thank you

    Hi, I'm looking for a no code solution for my clients. They're happy with drag and drop, but would prefer a no-code solution. Is this possible?
    sorry what do you mean by drag and drop? what will client drag and drop? From what interface?
    If you can give bigger picture then it would help
    In SSIS you've to implement using SSIS tasks only
    And in the above case you need to write code in any case be it script task which is in C#,VB .NET or be it execute sql task which is sql.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Flat file loading... how to automate the loading of multiple files

    HI Alll,
    I'm wondering if it's possible to create a routine that automates the loading of several flat files into a PSA table.
    I only want a single info package, and I would like this info package to load file 1, then load file 2, file 3 etc etc....
    The alternative is to create info packages for each flat file, but this seems clunky and inefficient.
    Is this possible?
    Regards,
    Frederick

    Hi,
    It is not possible with single infopackage. you have to create different infopackages. But you can put it in process chain in sequence to load different flat files.

  • Processing complex flat file

    I have a requirement to load complex (hierarchical) flat file to Oracle database. The flat file has multiple (different) records. Each record is fixed positional.Here is an example
    1 123455 6777888
    2566773 4444 test
    466666 7844 tyeww
    477777 7844 tyeww
    5213
    Records are identified by the first character in the line. (In this example we have record type 1, record type 2, record type 4 and record type 5). Also the records are hierarchical.
    Record Type 1
    ---Record Type 2 *
    ------Record Type 4 *
    ---Record Type 5
    When the data is loaded to database it should be normalized. That means I have to take some value from Record Type 1, Record Type 2 and Record Type 4.
    Can ODI handle this? do I have to write some script? If so How?

    OK,
    The following technique will help you:
    1) Create a database sequence
    2) create a interface to load a temp table (I named MY_TEMP_TABLE) with 1 "varchar' column so long as the biggest record (I named col_record), 1 column to store the sequence (I named col_seq) and 1 column to storage the parent line (that one should accept null values) (I named col_parent)
    3) Map the record to col_record at source
    4) Map the sequence to the col_seq at staging area
    5) at col_parent column, put the following code and map it to staging area:
    case when substr(src.col_record, 1,1) 1
    then (select max(col_sequence)
    from MY_TEMP_TABLE mtt
    where substr(mtt.col_record, 1,1) < substr(src.col_record, 1,1)
    else
    null
    end
    PS: src.col_record is the column from your text file
    This code will create the right hierarchy to the file.
    after that, you can you the first technique that I told you, dragging and drooping this MY_TEMP_TABLE so many time as records types at a new interface, each one with the right filter, and create the joins.
    You could even, add one more column to load the record type and work with it instead the "substr" command in the above select and at filter in the new interface.
    Did I miss something? Does it solve the problem?

Maybe you are looking for

  • Event for infotype 1001 updates doesn't trigger

    Hi everyone, I'm facing the following problem at HR Workflow I've created the object ZEHSBUS900, subtype of PDOTYPE_SH. And so, created two events: NOTIFYCREATE and NOTIFYUPDATE. At SWEHR3 transaction, I have this two entries: S     Position     1001

  • Oracle 8.1.6 on Mandrake 7.2?

    Has anyone been able to get the Universal Installer to work on Mandrake 7.2? It starts on my box, but then none of the buttons in the lower bar (Exit, Help, Installed products, Previous, and Next) work. It's weird, because if I click on "About Oracle

  • How to set up a link between sap fica transaction and cic front office

    Hi Guys, How to configure between SAP FICA transaction (FPR1 for create installation plan) to CIC front office. I did some changes in FPR1 transaction, same changes which are not reflecting on CIC screen, when i log on to CIC0 and select the create i

  • F4 help on selection screen in BI Query sort

    Hi,Everyone: I have designed a query in bw and set   0calmonth as varient, when i excute the query and open the varient,the value is sorted ascending,how can i set it sort descending? can anybody help me ?

  • HT201436 Visual voicemail just dials voicemail and will not display

    Hey, I have tried all the above things and been to the apple store and my iphone5 still won't show my visual voicemail.  It just dials voicemail automatically.  Will there be a fix for this in an update? I don't know what else to try.  I think it may