SQL Developer - Adding a column comment via SQL

When I add a comment in SQL*Plus via SQL, such as COMMENT ON COLUMN "MY_OWNER"."MY_TABLE"."MY_COLUMN" IS 'column comment' it works fine. When I try the same thing in SQL Developer I receive a message "No SQL statement entered".
I realize this can be done in SQL Developer via action buttons in the user interface; but I need to be able to do it via SQL since my procedure generates this code for hundreds of columns at one time.
Is there a SQL way to do this in SQL Developer? Alternatively, can SQL Developer call SQL*Plus to run commands?

This is a current bug when executing as statement (F9).
Good news is it does work when running as script (F5).
Have fun,
K.

Similar Messages

  • SQL Developer dropping first column in a SQL SELECT

    Am not too certain who to report this to... but I just noticed that SQL Developer will not return the first column in a SELECT statement when there is a comment just after the SELECT reserved word when running the query in the SQL Worksheet. For instance:
    SELECT -- > HEADER INFORMATION STARTS HERE <--
    w.stu_id HDR_STU_ID,
    w.wiser_id HDR_WISER_ID,
    iep.wiep_id HDR_WIEP_ID,
    sis.wisis_id HDR_WISIS_ID,
    FROM wiser_exit exit
    INNER JOIN wiser w
    ON exit.wiser_id = w.wiser_id
    INNER JOIN wiser_iep iep
    ON w.wiser_id = iep.wiser_id
    INNER JOIN vw_wiser_iep_sis sis
    ON iep.wiep_id = sis.wiep_id
    will just return columns 2 - 4 (HDR_WISER_ID, HDR_WIEP_ID, and HDR_WISIS_ID), and NOT column HDR_STU_ID.
    I verified this by running the same query in SQL Commands in the SQL Workshop of APEX, and the resultset returned all the columns including HDR_STU_ID.
    Just ran another quick test in SQL Developer, and get the same results from a SELECT against a single table:
    SELECT -- > HEADER INFORMATION STARTS HERE <--
    county_cd,
    odd_even_flg,
    street_name
    FROM dime
    Did not return the county_cd column.
    I know, it's just a minor quirk, but I thought I would mention it.

    John,
    Thank you. I replaced the '--' comments with the '/*' '*/' style and it picked up the first column.
    I guess I'll just have to break an old habit I've been doing for years for comments. Dang, I hope all that old code doesn't break...
    Thomas
    Spoke too soon. I followed up by checking what Oracle's 'Oracle Database 10g The Complete Reference' had to say about the issue of using '--' for comments and under '-- (Comment)' it says "-- tells oracle a comment has begun. Everything from that point to the end of the line is treated as a comment. These delimiters are used only within SQL itself or in PL/SQL ..."
    So I guess I can continue using '--', but need to keep in mind that in certain circumstances it might not work as expected. YMMV
    Edited by: Thomas 8246 on Feb 19, 2010 8:09 PM

  • Running SQLs in background in batch mode via SQL developer ( windows 7)

    Hi
    Can anybody share any tips to run a set of SQLs in background in batch mode via SQL developer in Windows 7 environment
    am trying something as below but not succeeding though
    1) Create a .txt file name 'mysqlfile.txt' in desktop which contains the below statements
    Create table A
    Create table B
    2) Create a .bat file name 'run.bat' and kept in desktop which contains the below statements ( syntax may not be correct though)
    sqldeveloper -s <DBusername>/<pwd>@//<Hostname>:<port>/<SID>@<C:\Users\<username>\Desktop/mysqlfile.txt>
    3) Double click 'run.bat'
    Regards
    -Learnsequel

    SQL Developer doesn't have a command-line interface to support what you're looking for.
    You could use SQL*Plus.
    We have some requests on the Exchange in this area you could add your vote to. This is an area we are investigating for future releases.

  • SQL Developer 4.0 column headings

    I give!  Uncle, uncle, uncle!
    I migrated from SQL Developer 3.xxx to 4.0.  My queries no longer show column headings.  I have looked through "preferences" and have not found the answer.  I have tried SQL commands that work in SQL*Plus.
    What am I missing?  How do I get my column headings back in the output?

    Result of "show all" include pagesize -1 and linesize -1.
    Ah, sorry!   I forgot the rule is a bit more complicated than stated in my first post.  Pagesize 0 and heading off suppress the column headings.  In addition (from some discussion notes)...
    In SQLDeveloper we decided to have the LINESIZE and PAGESIZE set to -1 by default so the table gets printed without any restrictions on dimensions (LINESIZE & PAGESIZE).  Yes the labels columns won't print for PAGESIZE = -1 and LINESIZE > 0 and no indentation for data.
    In SQLPlus we can't set pagesize -1, but when we set the PAGESIZE = 0 and LINESIZE > 0 the labels won't print but the line indentation results will be same in
    SQLDeveloper.
    So, for your case, make sure to leave heading on and both pagesize and linesize either at their default setting of -1, or both set greater than 0.  If you wish to set them automatically to non-default values, then in ...
    Tools > Preferences > Database (remember to expand Database, then click on it so it has the focus) > Filename for connection startup script
    provide a file specification to a script containing any such SET statements.  Similar in concept to SQL*Plus checking for the existence of a login.sql script.
    Best Wishes,
    Gary

  • SQL Developer Seems to have messed up SQL Plus & Crystal Connectivity

    Hi all,
    previously I have been able to connect to a DB via SQL Plus. Also, I have been able to report on it with Crystal Reports XI.
    I'm not certain, but I believe this has occurred since installing SQL Developer?!?!? Since once I installed, no need to use SQL Plus anymore and just haven't needed Crystal for a while.
    My TNSNames.ora in C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN seems fine (it worked before)
    SQLNet.ora has the following in it......
    #SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= ( TNSNAMES, EZCONNECT )
    A TNSPing returns.....
    C:\>TNSPING PVNGDEV1
    TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 09-SEP-2
    008 17:28:21
    Copyright (c) 1997, 2005, Oracle. All rights reserved.
    Used parameter files:
    C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora
    TNS-03505: Failed to resolve name
    C:\>
    When I try and create a connection via Crystal I get....
    Crystal Reports
    Failed to open the connection.
    Details: ORA-12154: TNS:could not resolve the connect identifier specified
    [Database Vendor Code: 12154 ]
    This is sending me absolutely crazy and have already spent 1/2 day trying to fix it.
    Please - any ideas?
    Regards
    DC
    SQL Developer 1.5.1
    Oracle Client 10.2
    Crystal Developer XI

    PROBLEM SOLVED - WHAT A MYSTERY and a WASTE OF MY TIME.
    APOLOGIES TO SQL Develoepr for being the prime suspect - I still love you!
    TNSNAmes.ORA as follows works!!!!!!
    pvngdev1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ********)(PORT = 1521))
    (CONNECT_DATA =
    (SID = pvngdev1)
    However, the following does not
    PVODB =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PVODB)
    PVOQA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))
    (CONNECT_DATA =
    (SID = PVOQA)
    # - Enterprise Reporting
    ERSDEVDB =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))
    (CONNECT_DATA =
    (SID = sasrpt)
    (SERVER = DEDICATED)
    # - PVNG
    PVNGDEV1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PVNGDEV1)
    PVNGQA1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PVNGQA1)
    DESTDEV1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = DESTDEV1)
    Why is this.
    I guess I 'll build up TNSNAmes connection by connectuion and test and see how I get on.
    Regards all
    DC

  • SQL Developer database copy corrupts wrapped PL/SQL

    SQL Developer 3.0.04.34, database 11.2.0.2.2
    Database copy brings over the wrapped pl/sql DDL, but somehow corrupts the code and will not compile.
    It must be recreated from source plb file.
    expdp / impdp does not have this problem.
    This would appear to be a bug.
    Wayne Linton

    user4792902 wrote:
    Also it looks like the SQL Developer loads all the Data from sources Schema for each table in memory and copies to destination Schema.Yes
    Any idea how to over come that...Don't use it, use the database's IMPDP/EXPDP tools for copying large quantities of data or whole schemas or databases.
    Also adding the Filter or selection like the Database Export functionality in Database Copy will really be helpful in this kind of situation. The Developer team has any plans?Probably not right now, but you can request this at the SQL Developer Exchange though, so other users can vote and add weight for possible future implementation.
    Regards,
    K.

  • Does SQL Developer support a default Path to SQL scripts

    Just started using SQL Developer.
    In the past, I created shortcuts on my PC desktop to run SQLPLUS to the different
    instances as follows:
    1. Create a shortcut to PLUS80W.exe
    2. Set the property "Start in" to a directory where the SQL scripts are located.
    3. Add the login/password@instance to the end of the shortcut.
    In this way, ypu only needed to click on the shortcut to log into SQLPLUS and run your
    scripts via @script.sql etc.
    Can you setup a default path to SQL scripts SQL Developer so that it can locate
    the scripts on your PC ?

    I did notice in version 13.43 that if you close SQL Developer with a SQL script open in the SQL Worksheet, when you startup SQL Developer the next time it automatically opens the file in the SQL Worksheet with no database connection. It also sets the default path for SQL scripts to be the directory where your open SQL file resides. If you right-click in the SQL Workshop and then click on "Open File" the directory defaults to the directory of the SQL file that is open.
    Mike

  • 30EA3 SQL Developer 3 error message while migrating SQL sever database

    I was mirating a SQL sever 2005 database to Oracle 11g, and got the following error message during the process:
    "Migration action have failed. Check the migration reports for Detail. :null".
    After the error message, I could see the "Captured Database Objects" and "Converted Database objects" under the "Migration Projects". However, if I open the generated scripts, it only contains the fowlloing, nothing else:
    "SET DEFINE OFF;
    PROMPT Creating User Emulation ...
    CREATE USER Emulation IDENTIFIED BY Emulation DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
    GRANT CREATE SESSION, RESOURCE, CREATE VIEW, CREATE MATERIALIZED VIEW, CREATE SYNONYM,CREATE PUBLIC SYNONYM TO Emulation;"
    What's the cause of this problem, please advice. Thanks.
    Bob

    Hi Bob,
    The next thing in the generation script should have been the definition of the sqlserver_utilities package.
    This package emulates some of the system functions found in SQL Server.
    It gets placed into your converted model as the very last step of the conversion.
    Building the generation script (where your failure happened) is straight forward and I wouldn't expect an error here.
    I would guess something went wrong during the capture or conversion and is only surfacing during the generation phase when it tried to write the sqlserver_utilities package to the generation file.
    I could be wrong, but I would manually check that conversion completed successfully first.
    1) Browse you converted model under
    Migration Projects "Nav" : Projects > YourProjectName > YourModelName(default a date)> Converted Database Objects > Procedures > YourProcName
    a) Are there any red crosses on any of these nodes in your navigator ?
    b) If you right click on a converted database name is "reconvert" grayed out or available?
    c) run the following in the SQL Worksheet against the same connection you used for the migration repository
    select * from md_packages;
    Is there one row there with the definition of sqlserver_utilities in its package_header and native_sql columns?
    Also do you have anything in the capture issues, conversion status or conversion issues reports (double click you project and the migration reports should pop up on the right hand side, each report a separate tab) ?
    Just trying to pinpoint what happened here.
    Thanks for your feedback,
    Dermot
    SQL Developer Team.
    Edited by: Dermot ONeill on Feb 16, 2011 2:48 PM

  • SQL Developer Unit Testing - Validation with PL/SQL

    Hi,
    I am trying to create Unit tests using SQL Developer UT framework.
    But when i am creating validation using User PL/SQL code option.
    Then how can i check value returned by l_count in code snippet below:
    -- Please raise an exception if the validation fails.
    -- For example:
    DECLARE
    l_count NUMBER;
    wrong_count EXCEPTION;
    BEGIN
    SELECT count(*) into l_count
    FROM test_recon
    WHERE
    match_num = 99836936
    AND Stg_status_flag <> 'E';
    IF l_count = 0
    THEN
    RAISE wrong_count;
    END IF;
    END;
    Also, can someone please refer me to few more demo examples (apart from oracle docs) to implement good test cases with SQL developer.
    I appreciate your help.
    Regards
    Dipali

    Probably not the answer you're looking for, but back when I was playing around with the Unit Test stuff, I didn't have sys privs, and the DBAs were a little busy at the time to set a up a repository for me. Rather than wait, I installed Oracle XE on my machine and created a small dev schema and deployed unit test to that. It's so much easier to perform quick proof of concepts when you have full control.

  • Missing SQL Developer functions when connecting to MS SQL Server 2005

    Hi all,
    I've connected SQL Developer to a ms sql server db. Now I can't use the functions from SQL Developer like
    - Drag&Drop tables to the sql-sheet,
    - autocompletition of attributes (Strg+Space).
    Is this function not supported or do I have to change some preferences?
    THX Steve

    Unfortunately most of the advanced functions of SQL Developer are supported only for oracle databases, so on ms sql, or almost anything else you can do little more than browse data.

  • SQL Developer viewing schemas on an MS SQL Server

    Hi,
    I've connected SQL Developer to our MS SQL server in the hope we can dump some of the data it contains onto our Oracle 10g box.
    Problem is in the left hand connections pane we can only see one database on the sql server box at a time. If we want to see more than one database we have to make a new connection to each seperately.
    Is there any way of making SQL developer show and allow browsing of all the sql server databases for which the user has permissions in the same way it does for MySQL connections?
    Regards
    John

    No; it's even more restrictive (at least in Oracle DBs): 1 connection for each database AND schema (user).
    Regards,
    K.

  • Is SQL Developer 1.5.5 Compatible with SQL Server 2008

    We are trying to perform a database migration and we keep getting "Locating Source Plugin" failed, we have the jTDS Drivers from sourceforge, tried several versions, including 1.0, 1.2, 1.2.2, 1.2.4, 1.2.5, 1.2.7, and 1.2.8... and i came across a thread Sql Dev Third party migration issue
    and i was wondering if SQL Developer 1.5.5 is compatible with Microsoft SQL Server 2008?

    Those versions are ancient, older than SS2008 even.
    Go get version 4.0.3 and a jTDS 3.1 driver.
    Details here

  • Adding in Current date via SQL insert

    If i am doing a process to update each line in a table, and i want to put in the current date into a column, is there a global variable that i can use.
    FOR i in 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    UPDATE GFMIS.AUTOBAHNDIRECTACCOUNTS SET recert = '1', RECERTBY = :APP_USER, RECERT_ACTION = 'keep' , DATE = 'current date' WHERE ACCID = HTMLDB_APPLICATION.G_F01(i);
    END LOOP;
    So DATE would hold something like 10/18/2005 14:45

    SYSDATE<br><BR>
    FOR i in 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
      UPDATE GFMIS.AUTOBAHNDIRECTACCOUNTS
        SET recert = '1',
               RECERTBY = :APP_USER,
               RECERT_ACTION = 'keep' ,
               DATE = SYSDATE
      WHERE ACCID = HTMLDB_APPLICATION.G_F01(i);
    END LOOP;<br>
    chet

  • Able to connect via Oracle SQL Developer, but not sql plus

    Using Oracle 10.2.0.
    I can connect using the TNS connection type in SQL Developer, but cannot do so in SQL PLUS. SQL Plus gives me the error -- could not resolve the connect identifier.
    When I do tnsping USPO_ADHOC, I get:
    C:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION =
    TNS-12533: TNS:illegal ADDRESS parameters
    So here is my tnsnames.ora file:
    INTL_ADHOC =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.239.162.108)(PORT = 1521))
    (CONNECT_DATA =
    (SID = intl1)
    USSYN_ADHOC =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.239.162.109)(PORT = 1521))
    (CONNECT_DATA =
    (SID = USSYN)
    USPO_ADHOC =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.239.162.107)(PORT = 1521))
    (CONNECT_DATA =
    (SID = uspo)
    Any assistance gratefully appreciated. Thanks.

    I actually did not have that environmental variable, so I added it, but nothing changed.
    I would note that if I do tnsping foo, I get: failed to resolve name.
    If I do tnsping USPO_ADHOC, I get: illegal address parameter.
    In both cases, the output correctly identified the path to my sqlnet.ora file, which is in the same directory as my tnsnames.
    So I would conclude from that, that the system was already able to find my tnsnames file.
    Anyway, here's my sqlnet.ora:
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    Thanks again for any ideas!

  • Data Miner Extension in SQL Developer 4.0 EA3 Release: EA3 Repository Migration Failure

    The Data Miner extension in the SQL Developer 4.0 EA3 release fails when attempting to migrate the repository to EA3. This posting contains instructions on how to recover from this failure as well as to successful migrate the repository from EA2 to EA3. There are no problems when just installing a fresh Data Miner repository.
    Sorry about the difficulty if this has caused you any problems.
    Mark
    Failure message displayed in log when migrating to EA3:
    Error report -
    ORA-06550: line 96, column 40:
    PLS-00382: expression is of wrong type
    ORA-06550: line 96, column 7:
    PL/SQL: Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Instructions on how to recover from failure and continue using original version of SQL Developer:
    1) Execute the following sql as SYS in order to allow the Data Miner repository to be open for use again:
    UPDATE ODMRSYS.ODMR$REPOSITORY_PROPERTIES
    SET PROPERTY_STR_VALUE = 'LOADED'
    WHERE PROPERTY_NAME = 'REPOSITORY_STATUS';
    COMMIT;
    2) During attempted migrationto EA3 failed, access priviliges to the Data Miner repository are revoked from users. In order to use Data Miner again, these grants must be reapplied. You can either use the UI guided process to accomplish this, which requires the SYS password, or you can run the usergrants.sql script, again as the SYS user. For instructions on how to run the usergrants.sql script, or any adminstrative script, review the instructions contained in the install_scripts_readme.html file. You can find this file in the SQL Developer directories created when you unzipped SQL Developer. It is located in the following relative directory: \<SQL Developer Install Directory>\sqldeveloper\dataminer\scripts.
    Instructions on how to successfully migrate to EA3.
    If you have already attempted to migrate to EA3 and failed, then you need to perform the recovery instructions noted above, after which you can continue with the instructions below.
    If you have not yet attempted to migrate to EA3, then just following the instructions below.
    1) Replace all contents the script file createxmlworkflowsbackup.sql with specification contained at the end of this posting. The file to edit can be found in the \<SQL Developer Install Directory>\sqldeveloper\dataminer\scripts directory.
    2) After completing the edit to createxmlworkflowsbackup.sql,  you can proceed with the UI guided migration or perform the migration using the appropriate migration script. Review the install_scripts_readme.html file in the /dataminer/scripts directory for instructions on how to perform the migration using the script. For the UI migration, simply open any user connection in your Data Miner navigator, and you will be prompted to perform the migration.
    WHENEVER SQLERROR EXIT SQL.SQLCODE;
    DEFINE MAX_VERSIONS = 30
    EXECUTE dbms_output.put_line('Start Backup Data Miner Workflows ' || systimestamp);
    DECLARE
      table_cnt NUMBER;
    BEGIN
      SELECT count(*) INTO table_cnt FROM all_tables WHERE owner='ODMRSYS' AND table_name='ODMR$WORKFLOWS_BACKUP';
      IF (table_cnt = 0) THEN
        EXECUTE IMMEDIATE '
          CREATE TABLE ODMRSYS.ODMR$WORKFLOWS_BACKUP
            USER_NAME VARCHAR2(30 CHAR) NOT NULL
          , PROJECT_ID NUMBER NOT NULL
          , PROJECT_NAME VARCHAR2(30 CHAR) NOT NULL
          , PJ_CREATION_TIME TIMESTAMP(6) NOT NULL
          , PJ_LAST_UPDATED_TIME TIMESTAMP(6)
          , PJ_COMMENTS VARCHAR2(4000 CHAR)
          , WORKFLOW_ID NUMBER NOT NULL
          , WORKFLOW_NAME VARCHAR2(30 CHAR) NOT NULL
          , WORKFLOW_DATA SYS.XMLTYPE
          , CHAIN_NAME VARCHAR2(30 CHAR)
          , RUN_MODE VARCHAR2(30 CHAR)
          , STATUS VARCHAR2(30 CHAR) NOT NULL
          , WF_CREATION_TIME TIMESTAMP(6) NOT NULL
          , WF_LAST_UPDATED_TIME TIMESTAMP(6)
          , BACKUP_TIME TIMESTAMP(6) NOT NULL
          , VERSION NUMBER NOT NULL
          , WF_COMMENTS VARCHAR2(4000 CHAR)
          , CONSTRAINT ODMR$WORKFLOWS_BACKUP_PK PRIMARY KEY
              PROJECT_ID
            , WORKFLOW_ID
            , VERSION
            ENABLE
          LOGGING
          PCTFREE 10
          INITRANS 1
          XMLTYPE COLUMN "WORKFLOW_DATA" STORE AS BASICFILE CLOB';
      END IF;
    END;
    DECLARE
      schema_old_ver VARCHAR2(30);
      schema_ver   VARCHAR2(30);
      patch        VARCHAR2(30);
      db_ver       VARCHAR2(30);
      v_storage    VARCHAR2(30);
      schema_data  CLOB;
      v_db_11_2_0_2 NUMBER; -- db is <= 11.2.0.2?
      row_cnt      NUMBER;
      ver_num      NUMBER := 1;
      maintaindom  NUMBER;
      workflow_rec ODMRSYS.ODMR$WORKFLOWS_BACKUP%ROWTYPE;
    BEGIN
      SELECT STORAGE_TYPE INTO v_storage FROM ALL_XML_TAB_COLS WHERE OWNER='ODMRSYS' AND TABLE_NAME='ODMR$WORKFLOWS' AND COLUMN_NAME='WORKFLOW_DATA';
      if (db is >= 11.2.0.3 AND SQL Dev > 3.0) OR (db is <= 11.2.0.2 AND MAINTAIN_DOM_PATCH_INSTALLED)
        back up all workflows
      end if  
      IF (v_storage != 'BINARY') THEN
        -- determine xml schema version
        SELECT XMLSerialize(CONTENT SCHEMA AS CLOB) INTO schema_data
        FROM DBA_XML_SCHEMAS WHERE schema_url = 'http://xmlns.oracle.com/odmr11/odmr.xsd' AND owner = 'ODMRSYS';
        maintaindom := INSTR(schema_data, 'xdb:maintainDOM="false"', 1, 1);
        -- determine database version
        SELECT version INTO db_ver FROM product_component_version WHERE product LIKE 'Oracle Database%';
        --- Check schema compatibility
        schema_old_ver := '11.2.0.1.9'; -- default value
        BEGIN
          SELECT property_str_value INTO schema_ver
          FROM "ODMRSYS"."ODMR$REPOSITORY_PROPERTIES" WHERE property_name = 'WF_VERSION';
          IF schema_old_ver = schema_ver  THEN
            IF NOT (db_ver = '11.2.0.1' OR db_ver = '11.2.0.2') THEN
              dbms_output.put_line('WARNING: The backup process can not be done, The workflows need to be migrated first');
            RETURN;
            END IF;
          END IF;
        EXCEPTION WHEN NO_DATA_FOUND THEN
          schema_ver  := schema_old_ver;
          dbms_output.put_line('No WF_VERSION found. Defaults to: '  || schema_old_ver);
        END;
        -- determine if MAINTAIN_DOM_PATCH_INSTALLED
        IF (INSTR(db_ver, '11.2.0.2') > 0 OR INSTR(db_ver, '11.2.0.1') > 0 OR INSTR(db_ver, '11.2.0.0') > 0) THEN
          v_db_11_2_0_2 := 1;
          BEGIN
            SELECT PROPERTY_STR_VALUE INTO patch FROM ODMRSYS.ODMR$REPOSITORY_PROPERTIES WHERE PROPERTY_NAME = 'MAINTAIN_DOM_PATCH_INSTALLED';
            patch := UPPER(patch);
          EXCEPTION WHEN NO_DATA_FOUND THEN
            patch := 'FALSE';
          END;
        ELSE
          v_db_11_2_0_2 := 0;
        END IF;
      END IF;
      IF (   v_storage = 'BINARY'
          OR (v_db_11_2_0_2 = 0) -- db is >= 11.2.0.3
          OR ((v_db_11_2_0_2 > 0) AND ((patch = 'TRUE') OR (maintaindom = 0))) ) THEN -- db is <= 11.2.0.2 AND (MAINTAIN_DOM_PATCH_INSTALLED OR maintaindom="true")
        SELECT count(*) INTO row_cnt FROM ODMRSYS.ODMR$WORKFLOWS_BACKUP;
        IF (row_cnt > 0) THEN
          SELECT NVL(MAX(VERSION)+1,1) INTO ver_num FROM ODMRSYS.ODMR$WORKFLOWS_BACKUP;
        END IF;
        FOR wf IN (
          SELECT
            p.USER_NAME "USER_NAME",
            p.PROJECT_ID "PROJECT_ID",
            p.PROJECT_NAME "PROJECT_NAME",
            p.CREATION_TIME "PJ_CREATION_TIME",
            p.LAST_UPDATED_TIME "PJ_LAST_UPDATED_TIME",
            p.COMMENTS "PJ_COMMENTS",
            x.WORKFLOW_ID "WORKFLOW_ID",
            x.WORKFLOW_NAME "WORKFLOW_NAME",
            xmlserialize(DOCUMENT x.WORKFLOW_DATA as CLOB indent size = 2) "WORKFLOW_DATA",
            x.CHAIN_NAME "CHAIN_NAME",
            x.RUN_MODE "RUN_MODE",
            x.STATUS "STATUS",
            x.CREATION_TIME "WF_CREATION_TIME",
            x.LAST_UPDATED_TIME "WF_LAST_UPDATED_TIME",
            x.COMMENTS "WF_COMMENTS"
          FROM ODMRSYS.ODMR$PROJECTS p, ODMRSYS.ODMR$WORKFLOWS x
          WHERE p.PROJECT_ID = x.PROJECT_ID
        LOOP
          workflow_rec.USER_NAME := wf.USER_NAME;
          workflow_rec.PROJECT_ID := wf.PROJECT_ID;
          workflow_rec.PROJECT_NAME := wf.PROJECT_NAME;
          workflow_rec.PJ_CREATION_TIME := wf.PJ_CREATION_TIME;
          workflow_rec.PJ_LAST_UPDATED_TIME := wf.PJ_LAST_UPDATED_TIME;
          workflow_rec.PJ_COMMENTS := wf.PJ_COMMENTS;
          workflow_rec.WORKFLOW_ID := wf.WORKFLOW_ID;
          workflow_rec.WORKFLOW_NAME := wf.WORKFLOW_NAME;
          workflow_rec.WORKFLOW_DATA := SYS.XMLTYPE(wf.WORKFLOW_DATA);
          workflow_rec.CHAIN_NAME := wf.CHAIN_NAME;
          workflow_rec.RUN_MODE := wf.RUN_MODE;
          workflow_rec.STATUS := wf.STATUS;
          workflow_rec.WF_CREATION_TIME := wf.WF_CREATION_TIME;
          workflow_rec.WF_LAST_UPDATED_TIME := wf.WF_LAST_UPDATED_TIME;
          workflow_rec.BACKUP_TIME := SYSTIMESTAMP;
          workflow_rec.VERSION := ver_num;
          workflow_rec.WF_COMMENTS := wf.WF_COMMENTS;
          BEGIN
            -- Output the ids (proj name, workflow name, proj id, workflow id)
            dbms_output.put_line('Backup workflow: ('||wf.PROJECT_NAME||', '||wf.WORKFLOW_NAME||', '||wf.PROJECT_ID||', '||wf.WORKFLOW_ID||')');
            INSERT INTO ODMRSYS.ODMR$WORKFLOWS_BACKUP VALUES workflow_rec;
            COMMIT;
          EXCEPTION WHEN OTHERS THEN
            dbms_output.put_line('Backup workflow failed: ('||wf.PROJECT_NAME||', '||wf.WORKFLOW_NAME||', '||wf.PROJECT_ID||', '||wf.WORKFLOW_ID||')');
          END;
        END LOOP;
      END IF;
      -- keep the latest 30 versions
      EXECUTE IMMEDIATE 'DELETE FROM ODMRSYS.ODMR$WORKFLOWS_BACKUP WHERE VERSION <= :1' USING (ver_num - &MAX_VERSIONS);
      COMMIT;
    EXCEPTION WHEN OTHERS THEN
      ROLLBACK;
      RAISE_APPLICATION_ERROR(-20000, 'Workflow backup failed. Review install log.');
    END;
    EXECUTE dbms_output.put_line('End Backup Data Miner Workflows. ' || systimestamp);

    823006 wrote:
    5.a. XLS export of big number columns looses precision, for example a number(38) column with all digits used.
    I believe excel only holds 15 digits of precision.
    Edited by: 823006 on Jan 18, 2011 8:14 AMThen it would be nice if you can define the "excel type" of each column. So you can make this number a "string" in the XLS.
    Edited by: user9361780 on Jan 18, 2011 9:12 AM

Maybe you are looking for

  • Time Series Line Chart - Monthly Sales - Make $0 or "No Sales" show up - not skipped

    Post Author: kevinday17 CA Forum: Charts and Graphs I have been messing with my chart for a while and I guess I'll just ask for help since I can't figure it out.  All I am trying to do is chart out monthly sales dollars by customer.  Simple enough...

  • Moving Home - at my wits end!

    I placed a moving home order on the 12th April for both phone and broadband with an installation date of the 29th April. I ONLY placed my order with BT because they had the quickest installation dates..hah!  We were moving from one rural location to

  • QuickTime Plug-in 7.6.4 upade in tiger

    There is no update to this in the mac software update built into the os or on the apple website. According to firefox and several articles there is a vulnerability in this version and it must be updated. Does apple have have 7.6.5 or .6 for this mac

  • What I-tunes versin do I need for an I-touch

    I just bought an I-touch, and someone said that I had to update my I-tunes application to 9.0 to allow it to work properly. SO without thinking this through, I updated I-tunes, and now I-tunes won't work unless I update Quicktime to ver 7.5.5 or high

  • Ironport S160 Access Policy URL Category not working

    I have created a custom URL category "Allowed Sites" and put some sites in there that I want the proxy not to block and ticked the "Allow" field in my Access Policy. Those sites also match the predefined URL category "Online Storage and Backup" which