Tag Info

Hot answers tagged

2

Assuming referential integrity and all columns to be NOT NULL, this should be simplest and fastest: SELECT * FROM Receipe r WHERE NOT EXISTS ( SELECT 1 FROM Ingredients i JOIN RecipeIngredients ON ri.IngredientsId = i.ID WHERE ri.RecipeID = r.Id AND ri.RequiredQuantity > i.AvailableQuantity ); Basically, use a NOT EXISTS ...


2

Instead of using so many JOINs to get the result, you might get better performance pivoting the data using an aggregate function with a CASE expression. Oracle 10g doesn't have a PIVOT function so you'd have to use this type of query (aggregate/CASE) if you aren't going to use multiple JOINs on your table. Since you have a limited number of questions ...


2

If you have a function that does an UPDATE and you try to call that from a SELECT statement, you should get an Oracle error saying that you cannot do DML inside a query. So your SELECT statement should be throwing an error. My first guess would be that you have an exception handler somewhere that, intentionally or not, is catching and discarding the error. ...


1

The actions you're performing on the data is technically different between the insert/update portions, but what about the business logic difference? IMO, your best bet is to contain a functional unit of work inside of a trigger, so that there is no discrepancy in what that trigger does. In my experience, Developers/Business Analysts often tend to think in ...


1

This was a problem with the hostname not getting set consistently on boot, and was not correctly available at that time but was later.


1

Without opening the standby for read-only, you won't be able to identify specific changes to specific physical objects, instead you'll have to verify that a specific set of changes have been applied to the remote standby. Views including v$standby_apply_snapshot, v$archived_log, v$archive_gap, v$dataguard_stats, v$managed_standby are all ones that I use on a ...


1

I've made a couple of assumptions here but one of these should work or be close: select inventory.Sku,inventory.SKU_DESCRIPTION,WAREHOUSEID from inventory join warehouse using (warehoueid) where manager = 'lucille smith' Or Select inventory.sku, inventory.sku_description, inventory.warehouseid from inventory, warehouse where inventory.warehouseid = ...


1

First, just to be certain we're covering our basis, this piece of code: EXP FILE = B.DMP OWNER(B) won't work. That's not a properly formatted EXP command. But assuming that you're using a properly formatted command, all that a user really needs is the EXP_FULL_DATABASE role, and they should be able to export any object in the database: SQL> create ...



Only top voted, non community-wiki answers of a minimum length are eligible