Creation of Schema in Oracle after checking

All,
My sincere apologies to post this here, but I did not find the answer anywhere.
I have a task to convert some SQL Server Scripts to Oracle.
The below is the sql server script to create the schema called HRMS after checking whether it is existing or not.
IF NOT EXISTS (SELECT [schema_id] FROM [sys].[schemas] WHERE [name] = N'HRMS')
BEGIN
EXECUTE ('CREATE SCHEMA [HRMS] AUTHORIZATION [dbo];');
END
GO
Can we have any similar kind of solution / statement in oracle. Please help me.
When I read in the Oracle Docs, CREATE SCHEMA statement is just to bundle multiple sql statements to a single transaction.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6014.htm
2)
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[HRMS].[TBL_PMapping]') AND type in (N'U'))
DROP TABLE [HRMS].[TBL_PMapping]
GO
This statement is to check whether the table called 'TBL_PMapping is exists or not and, if exists then drop it. Please suggest me a similar approach/ how to achieve the same with in Oracle.
First need to check whether the table exists or not, if exists then drop it other wise create it.
I would request for your kind help in this. Thank you very much in advance.
Thanks,

968217 wrote:
All,
My sincere apologies to post this here, but I did not find the answer anywhere.
I have a task to convert some SQL Server Scripts to Oracle.
The below is the sql server script to create the schema called HRMS after checking whether it is existing or not.
IF NOT EXISTS (SELECT [schema_id] FROM [sys].[schemas] WHERE [name] = N'HRMS')
BEGIN
EXECUTE ('CREATE SCHEMA [HRMS] AUTHORIZATION [dbo];');
END
GO
Can we have any similar kind of solution / statement in oracle. Please help me.
When I read in the Oracle Docs, CREATE SCHEMA statement is just to bundle multiple sql statements to a single transaction.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6014.htm
2)
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[HRMS].[TBL_PMapping]') AND type in (N'U'))
DROP TABLE [HRMS].[TBL_PMapping]
GO
This statement is to check whether the table called 'TBL_PMapping is exists or not and, if exists then drop it. Please suggest me a similar approach/ how to achieve the same with in Oracle.
First need to check whether the table exists or not, if exists then drop it other wise create it.Oracle is NOT SQL Server, and doesn't work like SQL Server. It may be acceptable in SQL Server to drop and create tables on-the-fly, but in Oracle it's considered poor database design. There shouldn't be any need to drop and recreate tables at run time, and it would likely drop dependencies from other database objects or triggers, constraints, indexes, grants etc.
If you need a "temporary table" in Oracle, you create a Global Temporary Table just once and use it for your session. This is a special kind of table where the data in it is only visible to the session that inserts it (multiple sessions only see their own data), and that data is automatically removed upon commit or when the session ends, depending on how you configure the table at the time of creation.

Similar Messages

  • PO creation where discount is given after taxes for few Vendors

    Hi pankaj,
    Need a pricing stucture in PO creation where discount is given after taxes for few Vendors.
    please give the solution with brief steps.
    Regards,
    Pandi

    Hi,
    Take a copy of RA01 in M/06 as YA01(as Discount) and keep it as following;
    Cond. class A Discount or surcharge
    Calculat.type A Percentage
    Cond.category Blank
    And Plus/minus - A (Positive)
    Use this in Pricing Procedure ( M/08 ) after Gross Price ad Discount conditions (before Subtotal) and assign Subtotal "6" against this condition type.
    In OBQ3 - Tax Procedure, assign AltCBV 363 to CST/VAT Condition Type (JIP1/JIP5)
    Now check the calculation will happen as following;
    Gross Price = 10000 INR
    Discount (as -ve/+ve) = 1000 INR
    BED 14% = 1400 INR
    ECS 2% = 28 INR
    SECess 1% = 14 INR
    CST 2% = 248.84 INR
    Also refer following thread for the same;
    [Calculation Procedure;

  • Compare two schemas in oracle 11g

    Hi All,
    Can any one please help me how to compare two schemas in oracle 11g.
    Thanks
    Edited by: 793914 on Oct 22, 2010 9:33 AM

    You can do it with gridcontrol. Look for dictionary comparisons and dictionary baselines.
    If you don't have gridcontrol, you can also use SQLDeveloper (free download on otn).
    There are two ways to do it with SQLDeveloper.
    1) Use Tools->Database Diff. However, you need a change management license to use this functionality. I've never used this.
    The free way is to...
    2) Use Tools->Database Export. Run it once for each schema and make sure the "Show Schema" option is NOT checked before exporting the schema. Also make sure you don't export data. You can choose which types of objects to export as well.
    Once you have the two export files for the two schemas then simply run a diff tool on your platform. Use the diff command line for linux or winDiff or something similar in windows.

  • SQL QUERY to create new schema in Oracle 10g Express

    Can anyone provide the SQL query to create a new schema in Oracle 10g Express edition.

    Can anyone provide a SQl query to create a
    schema/user named 'test' with username as 'system'
    and password as 'manager'system user is created during database creation, it's internal Oracle admin user that shouldn't be used as schema holder.
    In Oracle database, Oracle user is schema holder there's no seperate schema name to be defined other than username.

  • SAP Bundle Patches and Automatic Oracle parameter check script (note117165)

    After reading SAP note 1027012 on SAP Bundle Patches and SAP note 1171650 on the
    automatic Oracle parameter check script I have a simple question:
    Is it still necessary to manually check whether some patch is installed in order to determine
    exactly which event and fixcontrol to set?
    Or is the automatic Oracle parameter check script so sophisticated that it is fully
    sufficient to implement its recommendations, and you don't neet to manually
    check any more which SBP with which bugfixes has been installed?
    It would be great if SAP could confirm that the automatic parameter check is sufficient,
    but so far I haven't seen this statement explicitly. I believe this is mostly because it
    is so difficult (impossible?) to determine via SQL which patches have been applied.
    Regards,
    Mark

    >
    > Is it still necessary to manually check whether some patch is installed in order to determine
    > exactly which event and fixcontrol to set?
    Yes and No.
    until now, fixcontrol are dependent of CBO patches and those are "register" on the view v$system_fix_control. They can be "check" autmatically, so you get the "proper" recommendation for those.
    the parameter event depends on different situations, like some patches. But those patches are "normal" patches and it is not possible to check if they are installed from inside the DB with a simple script. For those, the check script will tell you to do it manually and will tell you which patch has to be check
    In addition, there are other parameters that have to be check "manually", like processes (where you get a "semiautomatic" check) or db_cache_size, where you should check if the size
    > It would be great if SAP could confirm that the automatic parameter check is sufficient,
    > but so far I haven't seen this statement explicitly. I believe this is mostly because it
    > is so difficult (impossible?) to determine via SQL which patches have been applied.
    The automatic parameter check is sufficient, meaning that you get all information, including the parameters that you have to check manually and some information for that check. Currently, it is not possible to automatize it 100%

  • Whether using Oracle after migrating from MySQL be easy or not?

    Though oracle is tough secured one, I don't know exactly the complexity of using Oracle database. Using MySQL 4.1.22 in my website https://www.puntercalls.com/ . Though the site is based on providing share market tips, it deals with a huge amount of stock market data and in much more real time basis hand-to-hand with NSE and BSE info which means a tough security is the utmost demand of the time.
    My question is whether using Oracle after migrating from MySQL be easy or not. You can check my site at https://www.puntercalls.com/ for different real time data updation parts.
    Kind suggestions are greatly appreciated in advance!
    Edited by: 968684 on Oct 31, 2012 7:04 AM

    Hi,
    As you are really asking about how to setup and use securioty features in an Oracle database it woul db ebetter to raise the question in this forum -
    Forum: Database Security - General
    Database Security - General
    They will have more knowledge about Oracle security features and which it would be best for you to use.
    Regards,
    Mike

  • Issue with installation of Common schema of Oracle BI Sample

    Hi, I am trying to install the Common schema of Oracle Business Intelligence that provides all the sample data used by the Discoverer tutorials. I have an Oracle 10g XE installed on a Windows XP box. There is no "SH" schema shipped with the XE so I created the database schema.
    Once I followed the steps and ran the script install_rel.bat, I kept getting error "ORA-01031: insufficient privileges". I think the script aborted at the command "%ORACLE_HOME%\BIN\sqlplus -L -S "/ as sysdba" @user_exists.sql SH" inside the script. Any ideas?
    Mike.

    Hello Yatan,
    To start the nodemanager, you need to browse to C:\Oracle\MiddlewarePS4\wlserver_10.3\server\bin and execute "startNodeManager.cmd" (there is no such file like startNodeManager.bat).
    "nodemanager.properties" will get created under ""C:\Oracle\MiddlewarePS4\wlserver_10.3\common\nodemanager\" once you start the nodemanager.
    You can also check the status of nodemanager from weblogic console.
    a) Login to weblogic console.
    b) Browse to Environment -> Machines in the Domain Structure panel (located left side)
    c) Click on "LocalMachine".
    c) Click on "Monitoring" tab to know the status of nodemanager.
    Thanks,
    -Pavan

  • How do I move a table from one schema to another schema on Oracle XE?

    How do I move a table from one schema to another schema on Oracle XE?

    Hi,
    I tried to use the insert/select statement that you had given, it did not work.
    The error is ORA-00913: too many values.
    But finally what I did was, I went into the system schema where the table was and generated the DDL through the utilities and afterwards I imported them into the schema that I am currently working on. It solved the problem!
    However I am still curious to know why the insert/select statement did not work? Do you know any site/tutorial which gives a real time example?
    Thank you
    Skye

  • How to change the password of a schema using Oracle SQL Developer

    Hi need to change the password of a schema using Oracle SQL Developer how do i do it?

    Hi
    alter user username identified by password

  • I can't burn a cd of my own created music. I either get the error 4261, or after "Checking media" the process stops and nothing further happens. Have tried different burn speeds and cds. Have re-installed iTunes.Any suggestions please?

    I can't burn a cd of my own created music. I either get the error 4261, or after "Checking media" the process stops and nothing further happens. Have tried different burn speeds and cds. Have re-installed iTunes.Any suggestions please?
    wm0203

    Sounds like the CD drive died. Luckily they cost next to nothing to replace. Or get an external LaCie instead. I have a dual G4 1.25 and the CD drive was always so anemic I use a LaCie Porsche with it.

  • HT1386 without having changed anything, i can't now sun my iPad with my computer, as it says my computer is no more authorized....but it actually is even after checking this through "store" - "authorize this computer"....how to solve this?

    when syncing my ipad 2 with my macbook air, the system says that this computer is not authorized, but it actually is, even after checking, so how to do now?

    Reboot the computer and reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • How do i get my photos back on usb after editing in iphoto. i used export but after checking my photos were not back on usb?

    how do i get my photos back on usb after editing. i used export but after checking my photos were not back on usb?

    You're really going to need to explain that. What's "USB"? Do you mean a Disk, Drive or volume connected by USB? How is your iphoto set up? What version are you using?
    Regards
    TD

  • Getting error in DB02 after checking Consistency check Unknown objects in A

    Dear All,
    I have getting error in DB02 after checking Consistency check.
    Please find the details.
    I have queries.
    How to correct the Unknown objects in ABAP Dictionary and Optional index is also we have to create please suggest step by step process.    
    Missing in R/3 DDIC      1              11
    Consistency check of 07.04.2009 10:14:24                   
    -- Objects missing in the database          
    Primary indexes                  0
    Secondary indexes                0
    Tables                           0
    Views                            0
    -- Unknown objects in ABAP Dictionary       
      |   |-- DB tables                        1
          |-- DB indexes                      11
         |-- DB views                        12
    -- DB tables without unique index   1
    -- Optional indexes                         
    Too many indexes created         0
    -- Indexes not created            145
    Regards,

    Hi
    Check this may help you
    http://help.sap.com/saphelp_nwmobile71/helpdata/en/45/e4ff3e65b66976e10000000a1553f6/content.htm
    Regards
    Uday

  • When i open itunes the warning itunes Library.itl appears with the following message. ..."it cannot be read because it was created by a newer version of itunes. after checking software updates we have the lastest version.  What to do?

    when i open itunes the warning itunes Library.itl appears with the following message. ..."it cannot be read because it was created by a newer version of itunes. after checking software updates we have the lastest version.  What to do?

    Perhaps check to see if you're accidentally running two different versions of iTunes. There's some information on troubleshooting that in the Opening iTunes section of the following document:
    Troubleshooting iTunes installation on Mac OS X

  • Help In XML schema using  oracle 10g

    i want to give seminar in XML schema using oracle 10g. n i m very new in this topic. so help me out which topic i include & any document regarding this

    XML Schema has various aspects.
    1. Creating an XML Schema, which may be done in JDeveloper.
    2. Initializing an XML document from an XML Schema, which may also be done in JDeveloper.
    For creating and initializing an XML Schema please refer
    http://www.regdeveloper.co.uk/2007/10/01/build_xml_schema_jdeveloper/
    3. Validating an XML document with an XML Schema.
    http://www.oracle.com/technology/pub/articles/vohra_xmlschema.html

Maybe you are looking for

  • Svrcfg show Job Server not running

    Hi, I am currently running Data Services 12.1.1.0 on Linux RH AS 4.6. I have noticed an issue and wondering whether there is something I am doing wrong. I installed DS and configured the JS. I have successfully started, stopped and started this again

  • Selecting data in forms from site column fields

    We are seeing some unusual actions when selecting data from site columns on the new item form.  Here's the context. 2 lists are maintained at the Intranet level and designated as a site column. 4 lists are maintained at a subsite level and are also d

  • HT1338 Safari Quits Unexpectedly OSX 10.9.2 Mavericks

    Safari quits working, and the computer locks

  • Authorization as per planner group

    Dear experts,                 i want to give authorization to change F loc and equipment as per planner groups..... What till now i have done I had assigned planner groups (Departments) to equipments and f.locs.....now my requirement is that only per

  • Cannot receive workitems after workflow has triggered

    Hi experts, I've met a problem that after a workflow has triggered, no one can receive the workitem. I check workflow log via SWIA and it shows that for example Paul has received it. But when Paul goes to SBWP the workitem doesn't exist. The same thi