Howto create SQL DDL script using kodo 3?

How do I create a SQL script (DDL script) for my database using kodo 3?
I've looked everywhere and can't figure it out :-(
The deprecated/replaced schematool had an outputfile option that did the
trick.
However, there seems to be no such option for the new mappingtool?
Thanks
Jesper

Jesper Ladegaard wrote:
How do I create a SQL script (DDL script) for my database using kodo 3?
I've looked everywhere and can't figure it out :-(
The deprecated/replaced schematool had an outputfile option that did the
trick.
However, there seems to be no such option for the new mappingtool?
Thanks
JesperI think it works:
java kodo.jdbc.schema.SchemaTool -file ddl.sql -a createDB
or
java kodo.jdbc.schema.SchemaTool -file ddl.sql -a dropDB
Regards,
Vladimiras

Similar Messages

  • Creating SQL-Loader script for more than one table at a time

    Hi,
    I am using OMWB 2.0.2.0.0 with Oracle 8.1.7 and Sybase 11.9.
    It looks like I can create SQL-Loader scripts for all the tables
    or for one table at a time. If I want to create SQL-Loader
    scripts for 5-6 tables, I have to either create script for all
    the tables and then delete the unwanted tables or create the
    scripts for one table at a time and then merge them.
    Is there a simple way to create migration scripts for more than
    one but not all tables at a time?
    Thanks,
    Prashant Rane

    No there is no multi-select for creating SQL-Loader scripts.
    You can either create them separately or create them all and
    then discard the one you do not need.

  • Where can I get SQL DDL script repository?

    Hello;
    Do you know where I can get the huge SQL DDL script repository?
    Thanks;
    Ornsiri

    Hi,
    Welcome , you can use dbms_metadata.get_ddl to get the Script.
    Example
    select dbms_metadata.get_ddl('TABLE','DEPT','SCOTT') from dual;
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1794096300346327738
    thanks

  • How to create SQL Connections String using JSP

    Hi, Dear I wrote sample Jsp program(Create a table and Inserted to Table) using SQLConnection
    I got this Error, how to rectify please help me?
    This is my Connection String
    <%
    String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
         Class.forName(driver).newInstance();
         Connection con=null;
         ResultSet rst=null;
         Statement stmt=null;
         try
              String url=java.sql.DriverManager.getConnection("jdbc:sqlserver://10.1.5.6:1433;Database=manickaraj;User=sa; Password=test*");
              con=DriverManager.getConnection(url);
              stmt=con.createStatement();
         catch(Exception e)
    System.out.println(e.getMessage());
         if(request.getParameter("action") != null)
              String CategoryName=request.getParameter("Category1");
              String Description=request.getParameter("Description1");
    String Status=request.getParameter("Status1");
              stmt.executeUpdate("insert into Category(CategoryName,Description) values('"+CategoryName+"','"+Description+"','"+Status+"')");
              rst=stmt.executeQuery("select * from Category");
    %>
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 5 in the jsp file: /CategoryAction.jsp
    Generated servlet error:
    C:\Documents and Settings\manickaraj\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\SampleJsp\org\apache\jsp\CategoryAction_jsp.java:61: incompatible types
    found : java.sql.Connection
    required: java.lang.String
    An error occurred at line: 5 in the jsp file: /CategoryAction.jsp
    Generated servlet error:
              String url=java.sql.DriverManager.getConnection("jdbc:sqlserver://10.1.2.4:1433;Database=manickaraj;User=sa; Password=test*");
              ^
    1 error
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

    package shop;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    public class DAClass {
         private static Connection conn;
         private static ResultSet rs;
         private static PreparedStatement ps;
         public static void connect(String dsn, String un, String pwd) {
              try {
                   //access or Mysql odbc connectivity
                   //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   //conn=DriverManager.getConnection("jdbc:odbc:"+dsn,un,pwd);
                   //mysql
                   //Class.forName("com.mysql.jdbc.Driver");
                   //conn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/eshop?user=root&password=root");
                InitialContext ctx = new InitialContext();
         DataSource ds = (DataSource) ctx.lookup("jdbc/eshop");
          conn = ds.getConnection();
         //DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/MySQLDB")
              catch(Exception e) {
                   //return "not soory";
         public static boolean chkPwd(String un, String pwd) {
              try {
                   boolean b=false;
                   ps=conn.prepareStatement("select * from cust_info where cust_name=? and cust_pwd=?");               
                   ps.setString(1,un);
                   ps.setString(2,pwd);
                   rs=ps.executeQuery();
                   while(rs.next()) {
                        b=true;
                   return b;
              catch(Exception e) {
                   return false;
    }changed the code like this other part is same.implemented connection pooling but still its too lazy loding can you guide me?

  • Howto create a powershell script to search the C drive for any *.pst files and copy them to a single directory

    I have a bunch of people who are saving their pst files all over the place. how do I write a script that does the following
    searches the C:\ drive for *.pst and copies them all the E:\pstfiles

    Hi,
    How about using below command:
    Move-Item c:\*.pst E:\pstfiles -force
    For more details about move-item, I would like suggest you use get-help command:
    get-help move-item
    In addition:
    Using the Move-Item Cmdlet
    http://technet.microsoft.com/en-us/library/ee176910.aspx
    Regards,
    Yan Li
    Yan Li
    TechNet Community Support

  • Howto create non-modal dialogs using ADF Faces

    I would like to use Dialogs in a non-modal manner.
    Trying to use
    <af:commandLink useWindow="true" action="dialog:infoPopup" blocking="false">
    <af:setActionListener from="#{row.xyId}" to="#{infoPopup.currentId}" />
    </af:commandLink>
    doesn't work as expected. I'll get the dialog, but I can't use the page behind it.
    Alternatively I tried to show the page using Javascript opening the pageInfo.faces, but here I have an order problem. The onClick event is processed first and the #{infoPopup.currentId} will be populated after rendering the JSF page. But I want to show infos depending on the xyId.
    Is there any other way to open windows/dialogs?
    Thanks in advance
    Stephan

    The "blocking" attribute basically just blocks you from clicking the commandLink or commandButton twice (or more) before the first click has been processed by the server and a response has been received.
    It is a very good util for avoiding those unwanted IndexOutOfBoundsExcepions when a user hits many buttons thus sending multiple requests to the server.
    By the way, I'd like to see the answer to the non-modal dialog window, because we have a need for them, too.
    Kind regards,
    dj

  • How to generate the DDL script of all the schema objects.

    Hi All,
    I just wanted to make centralized repository for Oracle database and to create a base version, I need to create the DDL scripts of all the database objects so that i can check in the same ddl scripts (sql) files in to my central repository.
    I need do this schedule job which will generate the ddl scripts once in a month(This should be automated process)
    Please help me out about this.
    Oracle version - 9i
    Thanks in advance.
    Thanks,
    Santosh
    Edited by: Santosh_Oracle on Feb 23, 2011 10:26 PM

    It is definitely possible to revise the script.
    Look at it, you already have 80 percent of it for free, and you didn't even need to Google.
    Just ask a FAQ in a forum loaded with FAQs!
    And Toad can save everything to one script per object.
    Sybrand Bakker
    Senior Oracle DBA

  • Using SQL Server Script to create Oracle DB Schema

    Hi,
    I have a SQL Server script which does a few things such as creating databases (after dropping), creating tables etc. Now I want to replicate the SQL Server databases and their tables etc in an Oracle9i DB. How would a SQL Server script compare to an Oracle script? i.e. what differences are there? and how would I have to alter the script to have it work on Oracle?
    As an example, my SQL Server script would look something like this:
    DROP DATABASE test1;
    DROP DATABASE test2;
    CREATE DATABASE test1;
    CREATE DATABASE test2;
    GO;
    USE test1;
    CREATE TABLE Table1 (
    TableOneID INT IDENTITY PRIMARY KEY NOT NULL,
    Name VARCHAR(255) NOT NULL,
    PRIMARY KEY(TableOneID));
    CREATE TABLE Table2 (
    TableTwoID INT IDENTITY NOT NULL,
    TableOneID INT NOT NULL,
    PRIMARY KEY(TableTwoID, TableOneID),
    FOREIGN KEY(TableOneID) REFERENCES Table1(TableOneID));
    USE test2;
    CREATE TABLE ....
    etc...
    thanks!

    Also I think
    CREATE TABLE table1
    ( tableoneid INT PRIMARY KEY NOT NULL
    , name VARCHAR(255) NOT NULL
    , PRIMARY KEY(tableoneid) );should probably be
    CREATE TABLE table1
    ( tableoneid INT CONSTRAINT table1_pk PRIMARY KEY
    , name VARCHAR(255) NOT NULL );otherwise you specify the primary key twice (and PRIMARY KEY implies NOT NULL so the NOT NULL is redundant).
    Then TABLE2 might need to be something like:
    CREATE TABLE table2
    ( tabletwoid INT NOT NULL
    , tableoneid NOT NULL CONSTRAINT table2_table1_fk REFERENCES table1
    , CONSTRAINT table2_pk PRIMARY KEY(tabletwoid, tableoneid) );although the table-level constraint syntax could be used for the foreign keys if it meant less editing of your scripts. The "CONSTRAINT constraintname" clause of constraints is optional but recommended, as otherwise they will get system-generated names like "SYS_C005157". (Note that if you specify the FK inline as part of the column definition you do not need to include a datatype.)
    If the IDENTITY clause causes a sequential value to be assigned as a default, there is no direct equivalent to that in Oracle. The nearest thing would be a row-level BEFORE INSERT trigger.

  • Can SQL Developer be used for Oracle Support "HTML Output" Diag Scripts ?

    Hi All,
    Oracle Support has asked me to run a diagnostic script (OTL_Diag.sql for anyone familar with the script) that produces output in HTML format using SQL*Plus to help troubleshoot an OTL problem we are having. Unfortunately I don't have SQL*Plus installed and my company is not on board with me installing it because of the SQL*NET connection required. Instead I have access to SQL Developer 3.1.0.7. While this works fine for most situations I'm having problems generating the required .html output file that Support needs.
    I've tried runing the OTL_Diag.sql a couple of ways using SQL Developer. First, I opened the file from SQL Developer and using the Run Script functionality (F5) I executed the code that way. This method did give me an opportunity to input the necessary parms and it did create the 'start' of the HTML file on my (Windows) file system, but the script seemed to abort with a java error that indicated some sort of format error (sorry, I'm not a java person so I can't provide any more info, but I'll be glad to get the exact error message if anyone thinks that will help solve my issue).
    My second approach was to open a SQL Window where I typed in @C:\OTL_Diag.sql without quotes. This approach also gave me the opportunity to enter the necessary input parms and it seemed to end normally. It also created the 'start' of the diaganostic output file on my Windows file system, but it 'completed' before any of the 'real' diaganostic output was written to the .html file.
    The Metalink note clearly specifies that the OTL_Diag.sql script is to be run with SQL*Plus 10.2 or above so I don't think I can complain too loudly to Oracle about this...but given that I don't have access to this product (and it is useless for me to again ask to install it) I am hoping someone out there has some ideas or insight as to how I can use SQL Developer to execute this diag script in a manner that will produce the required .html output file.
    Thanks in advance to anyone taking time to read my post !!
    Jeff
    Edited by: user13111861 on Jul 10, 2012 6:43 PM
    Edited by: user13111861 on Jul 10, 2012 7:51 PM

    >
    As a result, at this point in time my only available tool to run the OTL_Diag.sql script (provided by Oracle Support) is SQL Developer
    >
    Then you will have to edit the script, break it into pieces, execute each piece manually and save the output to feed into the next piece as required based on what the script is actually doing. Don't post the script or contents as that will likely violate your support agreement.
    As I already mentioned the script may be using syntax and/or commands that are simply not supported by sql*developer. One likely area is the script may be producing intermediate output scripts that are then processed by a later portion of the script. If that is the case then my suggestion to execute the pieces manually should work but you will need to do some trial-and-error to see.
    Even if you appear to be successful you will still have an issue when you communicate the results of your 'test' to Oracle support and they determine you didn't follow their instructions to use the proper tool.
    Sounds like your management is either ignorant or incompetent so I suggest you cover yourself by documentating the instructions from Oracle support and the direct orders you were given to disregard those instructions. No need to discuss that issue further but clearly there are resources available somewhere in the org that has the proper privileges or they wouldn't be able to maintain and support the database. If they want to pay for support they should heed their advice. Nuff said.

  • Using Data Pump to get a copy of all the CREATE TABLSPACE DDL in a database

    I have been looking through the documentation for a way to export.
    I was thinking I could get the DDL using the below and them don an IMPDP SQLFILES=yyy.sql
    cat expddl.sql
    DIRECTORY=dpdata1
    JOB_NAME=EXP_JOB
    CONTENT=METADATA_ONLY
    FULL=yes
    DUMPFILE=export_${ORACLE_SID}.dmp
    LOGFILE=export_${ORACLE_SID}.log
    I would have thought you could just do an INCUDE on the tablespace but it does not like that.
    10.2.0.3

    I would like to know why you want create tablespace DDLs ? As if you have to import it on the same machine (or the machine with similar mount points) the import should do that automatically for you. And if you have to do it on some other machine, you can always use SQLFILE option to generate DDL from the export dump.
    Regards,
    Amardeep Sidhu

  • New database create script using DBCA

    Hi,
    I'm trying to generate a database create script using DBCA. I have another database running on the same physical server(HP-UX and oracle 10g R2). When I run the DBCA, it is creating scripts to Clone DB and Clone RMAN restore. Why it is not generating to create a new database instead of cloning the DB.
    Thanks

    Rock2 wrote:
    Hi,
    I'm trying to generate a database create script using DBCA. I have another database running on the same physical server(HP-UX and oracle 10g R2). When I run the DBCA, it is creating scripts to Clone DB and Clone RMAN restore. Why it is not generating to create a new database instead of cloning the DB.
    ThanksWhen you launch dbca, you need to select to create a 'custom' database, not one of the pre-canned templates. The templates will all result in a script that does an rman restore from a backup that comes with the product. Selecting 'custom' database will result in scripts built around the CREATE DATABASE sql statement.

  • Running sql or perl script using DBMS_JOB

    Hi,
    Is there a way to run a sql or perl script using DBMS_JOB procedures? I have a perl script which checks out the table usage and emails the report to specific users. I want to run this script in a job scheduler, where I am using dbms_job to add the job. Please help. Any suggestions are greatly appreciated. Thanks.
    -Kristine

    You cannot run sql or perl scrips using DBMS_JOBS. You can run only Oracle procedures, functions, packages with DBMS_JOBS. They have to be stored in the database. You will have to create a Pro*C program that is listening on the pipe and push data to that pipe by using dbms_pipe. Then you can execute anything you want.

  • Unable to generate insert stmt scripts using sql developer

    We are not able to generate INSERT statement script using SQL Developer. In the INSERT script system is inserting some spaces due to carriage return which we cannot reviewed individually.

    DELETE FROM IM_INSTANCE_EXT_VAL_FRM
    WHERE IEVF_TRG_FLD_NAME = 'PRAI_NUM_03'
    AND IEVF_INST_CODE = 'APV-QQ-03'
    AND IEVF_BLK_NAME = 'PGIT_POL_RISK_ADDL_INFO_01';
    -- INSERTING into IM_INSTANCE_EXT_VAL_FRM
    Insert into IM_INSTANCE_EXT_VAL_FRM (IEVF_SYS_ID,IEVF_INST_CODE,IEVF_PROG_CODE,IEVF_BLK_NAME,IEVF_TRG_FLD_NAME,IEVF_ACT_FLDS,IEVF_ACTION,IEVF_PROC,IEVF_SRNO,IEVF_ERR_NO,IEVF_ERR_YN,IEVF_APP_CODE,IEVF_REMARKS,IEVF_UPD_UID,IEVF_UPD_DT,IEVF_CR_UID,IEVF_CR_DT,IEVF_TRG_NAME,IEVF_CLEAR_FLD_YN,IEVF_VALIDATE_YN) values (IEVF_SYS_ID.NEXTVAL,'APV-QQ-03','PGIT6_03','PGIT_POL_RISK_ADDL_INFO_01','PRAI_NUM_03','PRAI_DATA_15,','ENABLED','VFB_EV_GEN.EXT_VAL_DISABLE_PHY_DAMAGE(:PGIT_POL_RISK_ADDL_INFO_01.PRAI_POL_SYS_ID,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_END_NO_IDX,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_END_SR_NO,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_LVL1_SYS_ID,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_CODE_02,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_03,:P_FLAG_OUT)',1,null,'N','01','VALIADTION',null,null,'PREMIA',
    to_date('19-SEP-07','DD-MON-RR'),'WHEN-VALIDATE-ITEM','0','1');
    Insert into IM_INSTANCE_EXT_VAL_FRM (IEVF_SYS_ID,IEVF_INST_CODE,IEVF_PROG_CODE,IEVF_BLK_NAME,IEVF_TRG_FLD_NAME,IEVF_ACT_FLDS,IEVF_ACTION,IEVF_PROC,IEVF_SRNO,IEVF_ERR_NO,IEVF_ERR_YN,IEVF_APP_CODE,IEVF_REMARKS,IEVF_UPD_UID,IEVF_UPD_DT,IEVF_CR_UID,IEVF_CR_DT,IEVF_TRG_NAME,IEVF_CLEAR_FLD_YN,IEVF_VALIDATE_YN) values (IEVF_SYS_ID.NEXTVAL,'APV-QQ-03','PGIT6_03','PGIT_POL_RISK_ADDL_INFO_01','PRAI_NUM_03',null,'VALIDATE','VFB_EV_GEN.EXT_VAL_VEHICLE_AGE(:PGIT_POL_RISK_ADDL_INFO_01.PRAI_POL_SYS_ID,     :PGIT_POL_RISK_ADDL_INFO_01.PRAI_PSEC_SYS_ID,
    ''APV'',
    ''APV'',
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_03,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_07,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_08,
    :P_FLAG_OUT,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_35_OUT) ',3,null,'N','01','VALIADTION',null,null,'PREMIA',to_date('19-SEP-07','DD-MON-RR'),'WHEN-VALIDATE-ITEM','1','1');
    Insert into IM_INSTANCE_EXT_VAL_FRM (IEVF_SYS_ID,IEVF_INST_CODE,IEVF_PROG_CODE,IEVF_BLK_NAME,IEVF_TRG_FLD_NAME,IEVF_ACT_FLDS,IEVF_ACTION,IEVF_PROC,IEVF_SRNO,IEVF_ERR_NO,IEVF_ERR_YN,IEVF_APP_CODE,IEVF_REMARKS,IEVF_UPD_UID,IEVF_UPD_DT,IEVF_CR_UID,IEVF_CR_DT,IEVF_TRG_NAME,IEVF_CLEAR_FLD_YN,IEVF_VALIDATE_YN) values (IEVF_SYS_ID.NEXTVAL,'APV-QQ-03','PGIT6_03','PGIT_POL_RISK_ADDL_INFO_01','PRAI_NUM_03','PRAI_DATA_15,','DEFAULT','VFB_EV_GEN.DEFAULT_PHYSICAL_DAMAGE_SYMBOL(:PGIT_POL_RISK_ADDL_INFO_01.PRAI_POL_SYS_ID,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_PROD_CODE,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_PSEC_SYS_ID,
    ''APV'',
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_03,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_07,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_CODE_03,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_CODE_02,
    :P_FLAG_OUT,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_DATA_15_OUT)',2,null,'N','01','DEFAULT',null,null,'PREMIA',to_date('30-AUG-07','DD-MON-RR'),'WHEN-VALIDATE-ITEM','0','1');
    Insert into IM_INSTANCE_EXT_VAL_FRM (IEVF_SYS_ID,IEVF_INST_CODE,IEVF_PROG_CODE,IEVF_BLK_NAME,IEVF_TRG_FLD_NAME,IEVF_ACT_FLDS,IEVF_ACTION,IEVF_PROC,IEVF_SRNO,IEVF_ERR_NO,IEVF_ERR_YN,IEVF_APP_CODE,IEVF_REMARKS,IEVF_UPD_UID,IEVF_UPD_DT,IEVF_CR_UID,IEVF_CR_DT,IEVF_TRG_NAME,IEVF_CLEAR_FLD_YN,IEVF_VALIDATE_YN) values (IEVF_SYS_ID.NEXTVAL,'APV-QQ-03','PGIT6_03','PGIT_POL_RISK_ADDL_INFO_01','PRAI_NUM_03',null,'VALIDATE','VFB_EV_GEN.EXT_VAL_PHY_DAMAGE(:PGIT_POL_RISK_ADDL_INFO_01.PRAI_POL_SYS_ID,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_END_NO_IDX,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_END_SR_NO,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_LVL1_SYS_ID,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_CODE_02,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_NUM_03,
    :P_FLAG_OUT,
    :PGIT_POL_RISK_ADDL_INFO_01.PRAI_DATA_15_OUT)',9,null,'N','01','VALIADTION',null,null,'PREMIA',
    to_date('19-SEP-07','DD-MON-RR'),'WHEN-VALIDATE-ITEM','1','1');
    script which is taken from Sql Developer and got error while running in SQL* PLUS
    Following error was raised on running the script in SQL * PLUS
    5 rows deleted.
    1 row created.
    1 row created.
    1 row created.
    SP2-0734: unknown command beginning ":P_FLAG_OU..." - rest of line ignored.
    SP2-0734: unknown command beginning ":PGIT_POL_..." - rest of line ignored.
    SP2-0734: unknown command beginning "to_date('1..." - rest of line ignored.

  • Create script from another script using PROMPT

    Oracle 11
    Instead of having to link to another database I want to create 2 scripts that are executed from a shell script and run them separately. Script1 run in Database1 would create Script 2 by using PROMPT to create the second script while grabbing a date from database1 to pass into database2. I almost have it but the problem is ... Script2 uses COPY FROM and I have to put a "-" at the end of each line which the PROMPT takes as a literal instead of as part of the output.
    SCRIPT1:
    set pagesize 0
    set trimspool on
    set linesize 2000
    set echo off
    set verify off
    set feedback off
    set sqlblanklines on
    spool /home/michelle/sql_scripts/sl_dtc_copy2.sql
    PROMPT whenever sqlerror exit sql.sqlcode rollback
    PROMPT SET ARRAYSIZE 5000
    PROMPT SET COPYCOMMIT 20
    PROMPT set linesize 4000
    PROMPT
    PROMPT COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2}
    PROMPT CREATE SL_DTC_TMP USING SELECT DISTINCT
    PROMPT col1, col2, col3
    PROMPT FROM dual
    PROMPT WHERE veh_data_elements_cd = 'ODO_READ'
    PROMPT and       dh.data_collected_timstm >= 
    select trunc(sysdate)-7 from dual;
    PROMPT and       substr(vdh.vin,10,1) in ('A','B','C','D')
    PROMPT /
    PROMPT spool off
    PROMPT exit
    spool off
    exitSCRIPT2 NOW:
    whenever sqlerror exit sql.sqlcode rollback
    SET ARRAYSIZE 5000
    SET COPYCOMMIT 20
    set linesize 4000
    COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2}
    CREATE SL_DTC_TMP USING SELECT DISTINCT
    col1, col2, col3
    FROM dual
    WHERE veh_data_elements_cd = 'ODO_READ'
    and       dh.data_collected_timstm >=
    12-AUG-11
    and       substr(vdh.vin,10,1) in ('A','B','C','D')
    spool off
    exitSCRIPT2 HOW IT NEEDS TO BE:
    --- A [SPACE] AND A [-] at the end of each line
    --- THE DATE NEEDS TO HAVE SINGLE QUOTES AND PREFERABLY AT THE END OF THE PREVIOUS LINE
    whenever sqlerror exit sql.sqlcode rollback
    SET ARRAYSIZE 5000
    SET COPYCOMMIT 20
    set linesize 4000
    COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2} -
    CREATE SL_DTC_TMP USING SELECT DISTINCT -
    col1, col2, col3 -
    FROM dual -
    WHERE veh_data_elements_cd = 'ODO_READ' -
    and       dh.data_collected_timstm >= '12-AUG-11' -
    and       substr(vdh.vin,10,1) in ('A','B','C','D')
    spool off
    exitTHANK YOU

    Try
    select 'whenever sqlerror exit sql.sqlcode rollback'                    ||chr(10)||
           'SET ARRAYSIZE 5000'                                             ||chr(10)||
           'SET COPYCOMMIT 20'                                              ||chr(10)||
           'set linesize 4000'                                              ||chr(10)||
           ' '                                                              ||chr(10)||
           'COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2} -'||chr(10)||
           'CREATE SL_DTC_TMP USING SELECT DISTINCT -'                      ||chr(10)||
           'col1, col2, col3 -'                                             ||chr(10)||
           'FROM dual -'                                                    ||chr(10)||
           'WHERE veh_data_elements_cd = ''ODO_READ'' -'                    ||chr(10)||
           'and       dh.data_collected_timstm >= ''12-AUG-11'' -'          ||chr(10)||
           'and       substr(vdh.vin,10,1) in (''A'',''B'',''C'',''D'')'
           as Script
    from dual

  • Create a follow up page in scripts using Duplex and Tumble Duplex in print

    How to create a follow up page in scripts using Duplex and Tumble Duplex in print mode of scripts ?

    it depends upon output device types.
    Regards
    Prabhu

Maybe you are looking for

  • Firefox won't load parts of web pages or let me log into certain websites

    I don't quite know how to really explain this, so I'll provide two examples of the problems I'm experiencing: The first is that, whenever I go onto any of those Wikia sites, Firefox doesn't seem to load anything other than the main page content. By t

  • Error while starting up SOA server

    Hi All, I have OIM installed on a linux 64 bit server with SOA as well. When I start the servers, the Admin and OIM servers get started properly. However when I start SOA I get the following errors in the logs. Also the issue is that none of the defa

  • Post Goods Receipt for Inbound Delivery with BAPI_GOODSMVT_CREATE

    Hello, I try to post GR for an Inbound Delivey with BAPI_GOODSMVT_CREATE and it is not working. I know delivery number and PO number and give both to the bapi. I am not sure how to set the movement indicator in the item. When I set it to B. I do get

  • Error occured in the data selection while extract data from Source system

    Hello Friends i am facing Problem while extracting data to Biw System from SAP R/3 system The error mesage is 'Error occured in the data selection ' i.e. Monitoring - Details tab - Extraction - With error

  • Using Java/JVM as a Scripting Component in C++

    I've been doing some research into the JNI and had a couple questions. Specifically, what I'm looking for is the use of Java / the JVM as a scripting language for a C++ application. I'd like to combine the speed of C++ as the application's core with