Generate Script to Project doesn't  generate CREATE OR REPLACE objects

Hi,
I am using VS2008 SP1 with ODT. If I go to ServerExplorer to connected database and run Generate Script to Project the object (Package, package body , function ...) is always
created to the project as CREATE function myfunction.
I need to have it in this way CREATE OR REPLACE ... to run it against database.
Is there any way to configure it somehow ?
Thanks in advance
Jörg

Hi there is currently no way to automatically generate CREATE or REPLACE instead of just CREATE. You'll need to manually modify the file to add the "or REPLACE" to the stmt or add a DROP line just before the CREATE stmt.

Similar Messages

  • When i generate abap sproxy, it doesn't generate the abap class.

    hi all :
    When i generate abap sproxy, it doesn't generate the abap class. can you tell me the reason and how to work out this issue? thanks
    Monson

    Monson,
    Check this weblog and see the steps whether you are doing right or not:
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    Regards,
    ---Satish

  • Create or replace object

    I'm new to Oracle so forgive me if this is a stupid question, but why can't I reference table columns when creating my object?
    CREATE OR REPLACE TYPE oRS3_obj_CmpdLotSampleID AS object (hts_sample.alternate_id%TYPE, hts_compound_lot.lot_id%TYPE, hts_sample.sample_id%TYPE);

    Look at it this way.
    The prime benefit of using my_tab.col1%TYPE in PL/SQL is that it prevents us having to change our programs every time a table definition changes. Unfortunately the same flexibility does not exist in Objects: if the Object signature needs to change we have to drop and recreate the object. So there would be no benefit from using the %TYPE declaration anyway.
    Cheers, APC

  • Unable to generate new Unification Project due to an error

    Hello,
    I am trying to generate a Unification project but at the "Creating project infrastructure" I receive this error:
    "Could not open a registry key. Verify read permissions in the registry of the target machine or contact your administrator".
    The machine I am trying to connect is an SQL Server located locally on my machine.
    Ant ideas why this happen?

    Hi Roy,
    First of all as Ori mentioned it would be best to go to the new Java unification(last released version is SP10) but...
    In case you would like to use the integration solution between portal 6.0 SP2 and unification 5.0 the start point should be having the following installed:
    1. SP4 Patch 3 (Full Installation)
    2. Patch 6 for Unification server SP4 which is known also as Patch 3 for SAP Unifiers SP5.
    3. Hotfix  for 'Unification Server SP4 Patch 6/ SAP Unifiers SP5 Patch 3'
    The last 3 steps will bring you to the most updated solution of the 5.0 unification solution.
    All 3 (full installation,patch,hotfix) can be found on the SMP.
    In the new Java solution the only needed component to be installed is the portal.
    The error should be gone once you have the correct version installed and administrative permissions to the machine on which the unification is installed and the same goes to the SQL user.
    Thanks
    Yair

  • Generated Script fails when attempting to drop Foreign Key Constraint

    I made some changes to my database.  I used the generate script process to generate a drop and create script to these tables.  The generated script first ran Alter Table Drop Constraints to drop the Foreign Key constraints and then did Drop tables
    and then did create table to construct the script with the proper changes.
    However, when we attempted to run the script, all of the Drop constraint statements failed reporting that there was no such constraint.  Then the drop table scripts failed because of the existence of the very foreign key constraints  that SQL Server
    had just stated did not exist.
    BOL states that the statement "DROP { [ CONSTRAINT ] constraint_name | COLUMN column_name } " is  "Used in a CHECK, FOREIGN KEY, UNIQUE, or PRIMARY KEY constraint."  So why couldn't I drop those specified Foreign
    Key constraints in a script generated by SQL Server itself.
    Edward R. Joell MCSD MCDBA

    Are you sure there are no Constraints on other tables which are causing your issue?
    If a foreign key from table abc refences table def it will cause the drop to fail.
    If your script is already attempting to drop such constraints, have you checked that they are dropping from the correct table (and not the table that would be the target of the drop)?
    I discovered two things yesterday and one thing today about generated scripts.
    When you generated a script to drop and create a set of tables and you mark it to include foreign keys, the generated script will first create a set a scripts to drop the foreign keys , then will create a set of statements for each table that will,
    first, again drop the same foreign keys that it did earlier, then drop the table.  If there is no "if exists" statement for each statement, the drop constraint will fail.
    The script generated by the generate scripts wizard, even when you set the Drop and Create option in the advanced tab, unlike the scripts generated when you right click a table and select Drop and Create from the context menu, does not by default create
    an "If Exists" statement before the attempt to drop anything.
    You can make the generate Scripts wizard generate an "if exists" statement by changing the "Include if NOT EXISTS" option on the advanced tab to true. However, while the script generator will find all of the foreign keys that show that
    table as the parent_id, it will not show the FK constraints on tables which are not being dropped and created.  Nor can you find them by querying the sys.foreign_keys view using the standard type of Foreign Key "If Exists" statement because
    it would do a query like
    SELECT *
    FROM sys.foreign_keys
    WHERE object_id = OBJECT_ID(N'[dbo].[FK_prc_ContractSubLines_prc_PRSubLines]')
    AND parent_object_id = OBJECT_ID(N'[dbo].[prc_ContractSubLines]')
    And the script generator does not care even if you show an option like "Generate Scripts For Dependent Objects", it will not generate a drop script for the foreign constraints on other tables that reference your table.  I have not even found
    a way to get back the results of a query on the sys.foreign_keys view that will show those keys that reference your table. The only thing I been able to do is to open the table in design and check out the list of relationships in your table and see open each
    relationship and see which table is the "foreign key table" rather than the primary key table. This will make writing drop and create scripts very very long and tedious. As you would have to  create addional Alter tables scripts to do a drop
    and create foreign keys on each table referencing yours and manually place them into your scripts at correct locations. This is almost as bad as the Oracle SQL Developer's generate script results which (at least in 2010) so screws up the order of the generated
    script that it is trying to create foreign keys on tables it has not created yet.
    So Patrick I see that you thought about the foreign keys on other tables.  I wish I had read your post before spending the morning troubleshooting this issue based on this morning's script that ran and crashed embarrassingly. 
    I would like to know if someone has a query to reveal all of the foreign keys that reference your table from another table using the sys views.  As it is I have to open each table in design to get a list of FKs that reference it.
    Edward R. Joell MCSD MCDBA

  • PowerDesigner doesn't respect dependencies between objects when generating script

    Good afternoon,
    I'm getting very frustrated trying to do something that should be 'by default' or easy to configure within PowerDesigner 16.5 working with a SQL Server 2008 R2 database.
    I reverse-engineered a database into a physical model for modifications and I want to generate DDL from the physical model.   I've worked around some issues including how to support SQL Server filtered indexes and a few others things. 
    However a really stupid think that I have not been able to figure out is how to have the script respect dependencies between objects in the model.   When looking at the model at the Dependencies table the dependencies seem to be in place correctly.   But when I choose the 'Generate Database...' menu item to generate a single script to create all of the objects within a database it does create them all but in alphabetical order which does not work because there are dependencies between objects (views, in particular) that requires specific views to be created in a different order depending on their dependencies.
    Most tools understand the dependencies and create a script that will work.
    How can I generate a database script from PowerDesigner that respects the dependencies between the objects (in this case between different databse views) so they get scripted out in the correct order.
    Thanks much,
    Don

    I figured this out via the use of 'Traceability Links' within the View Properties.  
    Let me tell you... the only way to set these is to create a diagram and visually link things together because working through the grid on the property pages to select additional Linked Objects is just incredibly slow and painful.   You should be able to just free-text enter Linked Object names (with the model validating them) without having to traverse the model to individually select each object.   I had a lot of dependencies and it took several hours to incorporate them all.
    I'm also disappointed that the reverse-engineering of a SQL Server database into a physical model doesn't use the sysdepends data to create 'Traceability Links' to associate dependencies between views, stored procedures, etc.   That would have saved me a lot of work.
    I know that PowerDesigner is a 'generic' product that works with several databases... but being a person that only works with a particular database (in my case SQL Server) the lack of out of the box support (filtered index reverse engineering is an example that quickly comes to mind) is frustrating.

  • Generate-Script generates only create package not create or replace package

    Hello,
    I try do work with the Oracle Developer Tools for Visual Studio 2010 to include my PL/SQL-code in TFS. I have include all my PL/SQL-code in a Oracle-Projekt and check it in. Than I'm working with Visual Studio to update my packages. I open a package from the Server-Explorer, debug and compile it. When finished, I want to check in the new code. For this I call Generate Create-Script in the Server-Explorer and save the code my project. This code starts with CREATE PACKAGE ...
    If I start this script on our production-system I get the error ORA-00955: Es gibt bereits ein Objekt mit diesem Namen (There is a object with this name ...). So it would be better the Create-Script would start with CREATE OR REPLACE PACKAGE .... Is there a way to do this? When not, what is the recommended workflow for coding, debugging, compiling and checking in TFS?
    Thanks
    Peter

    Same remark here...

  • How to get feedback messages for schema creation script created by Tasks- Generate Script

    I am using sql server 2008 R2. I created a script file by using Tasks->Generate Scripts. I 
    selected option so only create statements are generated for all objects – tables, indexes, views, functions etc in the database.
    Then when I used this generated  script to create objects in another database in SSMS, it created the objects but did
     not give me any feed back, i.e., table created, view created etc. I thought my script did not run , but when I refreshed left panel 
    of SSMS and I can see all created objects.. So question is what  is needed to get 
    feedback when  sql statements are run..

    You need to add the PRINT statements yourself for that. The wizard will not do it for you.
    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

  • Question about DBCA generate script o create RAC database 2 node cluster

    Question about creating two node RAC database 11g after installing and configuration 11g clusterware. I've used DBCA to generate script to create a rac database. I've set
    environment variable ORACLE_SID=RAC and the creating script creates instance of RAC1 and RAC2. My understanding is that each node will represent a node, however there should only be one database with a name of 'RAC'. Please advise

    You are getting your terminology mixed up.
    You only have one database. Take a look, there are one set of datafiles on shared storage.
    You have 2 instances which are accessing one database.
    Database name is RAC. Instance names are RAC1, RAC2, etc, etc.
    Also, if you look at the listener configuration and if your tnsnames is setup properly then connecting to RAC will connect you to either one of the instances wheras connecting to RAC1 will connect you to that instance.

  • Error when generating Alter Record scripts with project PPLTLS84CUR

    I am trying to install HR89 + PT849 on REL5.4 + Oracle 10g manually under the guideline of official document: PeopleTools 8.49 Installation for Oracle.pdf
    After Database creation, need to upgrade Peopletools from the delivered version 8.46 to 8.49
    In page 570, Task B-15-6: Alter PeopleTools Tables, need to generate build scripts from project PPLTLS84CUR and then run the scripts from SQLPLUS side.
    Bu when generating the scripts with user PS/PS, the App Designer got error message as following:
    PS General Routines
    Out of available memory. -
    e:\pt849-903-R1-retail\peopletoos\SRC\pssys\rdmfld.app @ 998
    click OK, process can continue but the result can show: "Error: APPR_RULE_HDR - Alter process was unsuccessful. (76,42) "
    not only this record but also many others.
    In client PC which running app designer, the memory is enough for app designer, 1G free. Really hard to understand such error.
    Any reply will be much appreciated.
    Andy
    Edited by: Andy xu on 2012-5-14 上午2:22

    thank you for your reply.
    client pc is running on windows 7 and UAC is already disabled.
    current user running app designer is belong to Administrator group, hence, this may be a client security problem.
    I search on oracle website and found a page said this maybe a bug and be fixed from 8.49.11, this is why it is working on 8.49.13, and the wordaround solution is use non-vista pc, such as windows xp. :)
    https://support.oracle.com/CSP/ui/flash.html#tab=KBHome(page=KBHome&id=()),(page=KBNavigator&id=(from=BOOKMARK&viewingMode=1143&bmDocTitle=E-QR:%20When%20modifying%20Criteria%20for%20certain%20Queries,%202-tier/3-tier%20Query%20Manager%20tool%20is%20generating%20error,%20%22Out%20of%20available%20memory%20-%20e:pt84814b%20-%20retailpeopletoolsSRCpssysqdmsel.cpp@1381%22&bmDocType=PROBLEM&bmDocDsrc=KB&bmDocID=659150.1))

  • Runtime-Error after deploying a mapping with the generated script

    For example a very easy scenario:
    1. Create a table and a view in a DB-schema, witch ist registered as WB-target-schema with the following scripts:
    create view v1(c1) as select 'a' c1 from dual;
    create table t1(c1 varchar2(1));
    2. Import the table and the view into a OWB-module
    3. Create a mapping ‘m1’
    4. Drag and drop view and table into the mapping
    5. Draw an arrow from the view-column to the table-column
    6. Save and close the mapping
    7. Mark the mapping in the ‘Design Center’ and klick the ‘Generate’-Button
    8. Save the generated script ‘M1.pls’ to file
    9. Run the script in SQL*Plus, connected with the target-schema (without using the Control Center Manager)
    => very easy right now ;-)
    10. Start the mapping with the following script will produce the following error
    SQL> declare
    2 v_status varchar2(100);
    3 begin
    4 m1.main(v_status);
    5 end;
    6 /
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "OWB_OWN.WB_RT_MAPAUDIT_UTIL", line 1027
    ORA-06512: at "SCOTT.M1", line 2048
    ORA-06512: at line 4
    If i delete or comment the four WB_RT_MAPAUDIT_UTIL-calls - it work´s fine!
    But is this a good advise?
    What exactly does the wrapped package ‘WB_RT_MAPAUDIT_UTIL do?
    Thanks
    jwehner

    I just ran into the same problem myself. I used the same technique of saving the generated OWB script to file and then compiling it through sqlplus. When I used the "Deploy" option for the mapping, then the problem went away. So when OWB is deploying the code it seems to be setting something internally that doesn't get set when you simple compile the PL/SQL. I don't know of any workaround to this. I will need it eventually, since I don't want to use the UI to deploy to various test environments and production. Maybe the built-in scripting language is the way to go.

  • Jcomgen doesn't generate classes for FineReader 7 engine

    Hi,
    currently I'm using njawin 1.1.34 to control FineReader 6 Scripting Edition which works quite well :-)
    Recently we tried to upgrade to FineReader 7 engine which offers several additional features we'd like to use. Unfortunately jcomgen.exe doesn't generate all the necessary classes; only a few are created although there are lots of entries in the ProgID combobox, the TypeLib GUID seems to be corrent, and the typelib module is selected correctly.
    Example:
    The FineReader engine exports an object called "Block" and one called "BlocksCollection"; the latter is - as the name suggests - a collection of objects of type "Block ". jcomgen only generates a class for the collection.
    Do you have any idea why jcomgen doesn't want to generate all the available classes?
    Regards
    Thorsten

    Do you ever figure this out?
    I'm trying to use FineReader engine too.
    I've tried with 7 to no avail.
    Am stuck at the 2nd step with 6, too, though. How do you create the Engine? I'm creating a FuncPtr, but can't figure out how to invoke things and get the created engine back.
    Would REALLY appreciate your help!
    thanks,
    David

  • WCF 4.5 doesn't generate log file

    Hi,
    Recently, I am using WCF 4.5 windows 7 for my testing of WCF appliation. When enable tracing, the WCF servce works fine, however, the WCF application doesn't generate the log file(
    web_messages.svclog or web_tracelog.svclog).
    Here are the configuration of the web.confi
    g file:
    <system.diagnostics>
    <sources>
    <source name="System.ServiceModel.MessageLogging" switchValue="警告,ActivityTracing">
    <listeners>
    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
    <filter type="" />
    </add>
    <add name="ServiceModelMessageLoggingListener">
    <filter type="" />
    </add>
    </listeners>
    </source>
    <source propagateActivity="true" name="System.ServiceModel" switchValue="详细,ActivityTracing">
    <listeners>
    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
    <filter type="" />
    </add>
    <add name="ServiceModelTraceListener">
    <filter type="" />
    </add>
    </listeners>
    </source>
    </sources>
    <sharedListeners>
    <add initializeData="e:\project\test\wcf_tutorial\webapp_consume_wcf\webapp_consume_wcf\web_messages.svclog"
    type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
    <filter type="" />
    </add>
    <add initializeData="e:\project\test\wcf_tutorial\webapp_consume_wcf\webapp_consume_wcf\web_tracelog.svclog"
    type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
    <filter type="" />
    </add>
    </sharedListeners>
    <trace autoflush="true" />
    </system.diagnostics>
    <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"></serviceHostingEnvironment>
    <diagnostics wmiProviderEnabled="true" performanceCounters="All">
    <messageLogging logEntireMessage="true" logMalformedMessages="true"
    logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
    </diagnostics>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"></serviceHostingEnvironment>
    <diagnostics wmiProviderEnabled="true" performanceCounters="All">
    <messageLogging logEntireMessage="true" logMalformedMessages="true"
    logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
    </diagnostics>
    </system.serviceModel>
    Regards

    Hi Paul_PMA,
    Based on this
    MSDN document, trace files are not created without initially creating the log directory. Make sure that the directory for
    web_messages.svclog or web_tracelog.svclog exists, or specify an alternate logging directory in the listener configuration. Please also mark sure that IIS has write permissions to the log file path.
    For more information, please try to refer to the following articles:
    #Configuring Message Logging:
    https://msdn.microsoft.com/en-us/library/ms730064(v=vs.110).aspx .
    #Simple Steps to Enable Tracing in WCF:
    http://www.codeproject.com/Articles/420538/Simple-Steps-to-Enable-Tracing-in-WCF .
    #How to enable wcf tracing and wcf message logging:
    http://dotnetmentors.com/how-to-enable-wcf-tracing-and-wcf-message-loging.aspx .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Migration Workbench generates scripts that won't run

    If the source db contains objects with names approaching 30 characters, the migration workbench will generate scripts with name clashes for tables, sequences and triggers, e.g
    e.g. In source db, table name = task_deliverables_reviews_data , has one auto-inc field. SQL Developer tries to create a table , sequence and trigger all of the same name. I think this happens because to generate the relevant seq and trg, it appends SEQ and TRG to the object name, but then truncates it back to 30 chars!
    Unfortunately renaming the objects in the 'converted model' section of the workbench has no impact as renaming the objects does not alter the generated code. e.g. rename the sequence, but the trigger will still refer to the original name.

    Okay, I think I found my problem.
    I was trying to run the script created by Oracle Explorer directly from a Database project I added to my Solution in Visual Studio. Visual Studio is probably using some SQL Server specific tool when I select the Run or Run On option on the script.
    When running the same script directly in the Oracle 10g Home Page (Home > SQL > SQL Scripts), I had no problem. Everything executes correctly.
    Is anyone aware of another way to run Oracle scripts directly from Visual Studio? Do I have my project setup incorrectly? This is the first project I've used .NET and Oracle together, so if anyone has any suggestions, I'd really appreciate the help.
    Thanks,
    Mycole

  • Generate Scripts in SQL Server 2008 R2 producing Error "Item has already been added.:

    I am trying to run a Generate Scripts Task on a Database to generate a script for every object in the DB including tables, SPs, UDFs, FKs, PKs, with the settings for Schema Only, Script Drop and Create, Script "if not Exists", use database,
    and Object level permissions. 
    I have used generate scripts before to generate this database about 5 months ago and every thing worked fine. 
    Today I first tried to generate it out on a server where I only have "db_Owner" for several databases.  This failed with the error.
    Microsoft.SqlServer.Management.Smo.FailedOperationException: Discover dependencies failed. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'Server[@Name='DLINHD007557\SQL_2008R2_64']/Database[@Name='VFS_ProcurementTracking']/UnresolvedEntity[@Name='prc_ContractFatInfo']' Key being added: 'Server[@Name='DLINHD007557\SQL_2008R2_64']/Database[@Name='VFS_ProcurementTracking']/UnresolvedEntity[@Name='prc_ContractFatInfo']' at System.Collections.SortedList.Add(Object key, Object value) at Microsoft.SqlServer.Management.Smo.DependencyTree..ctor(Urn[] urns, DependencyChainCollection dependencies, Boolean fParents, Server server)
    So I tried tto do this on a local version of the database where I have sa rights.  Same error.
    Can someone advise me on what is going on here and how do I fix it?
    Edward R. Joell MCSD MCDBA

    How do you generate the script via SMO?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • How do I keep my library settings the same after importing?

    Hi. I have organized my whole itunes library down to the gritty upper/lowercase characters of the song names (due to my compulsive nature), and want to keep all my settings for later on when i backup my information as well as import it in the future.

  • Can i get a free os lion if i have bought my mac book pro 2 weeks after the launch of the os lion

    hi .  i bought a mac book pro from the US . it came witht the older os . offcourse assuming that this would have been packed in china before the launch of os lion . would i have to buy the os lion or is there any way of getting an upgrade without pay

  • Mail not send my e-mail.  Error inside!

    "Error This message could not be delivered and will remain in your Outbox until it can be delivered. The connection to the server "smtp.mac.com" on port 25 timed out." Thats what happens, how do I fix it. Right now I'm on trial membership if that has

  • Unable to open EIS console after install...

    I get the error "olapbldr has encountered a problem and needs to close. We are sorry for the inconvenience.", This displays in the typcial Microsoft Send Error Report window. THis occurs immediately after I try to open the EIS console by clicking on

  • How to format a number ?

    Hi I have some numbers: 0,3,24,118 And I want to print them with a 3-digit format: 000,003,024,118 How do I do this ? Thanks