oracle

sql query question

hey guys, just having a bit of difficulty with a query, i'm trying to figure out how to show the most popular naturopath that has been visited in a centre. My tables look as follows; Patient(patientId, name, gender, DoB, address, state,postcode, homePhone, businessPhone, maritalStatus, occupation, duration,unit, race, registrationDate ...

Does Oracle 11g automatically index fields frequently used for full table scans?

I have an app using an Oracle 11g database. I have a fairly large table (~50k rows) which I query thus: SELECT omg, ponies FROM table WHERE x = 4 Field x was not indexed, I discovered. This query happens a lot, but the thing is that the performance wasn't too bad. Adding an index on x did make the queries approximately twice as fast, ...

How to insert rows in an Excel sheet into SQL Server 2005 or oracle

How to insert rows in an Excel sheet into SQL Server 2005 or oracle ? For example if I have 5000 rows in Excel sheet how can I insert these rows into a table in any database ...

Parsing pipe delimited string into columns?

Hello, I have a column with pipe separated values such as: '23|12.1| 450|30|9|78|82.5|92.1|120|185|52|11' I want to parse this column to fill a table with 12 corresponding columns: month1, month2, month3...month12. So month1 will have the value 23, month2 the value 12.1 etc... Is there a way to parse it by a loop or delimeter instea...

Which is faster for small web projects - MySQL or Oracle?

Hi Which is generally faster for small web projects - MySQL or Oracle? Please provide some proof (benchmarks or any other) of your opinion. ...

joining table of oracle

Hi friends i am having problem in joining two tables in oracle my two tables are shown bellow table1 looks like id Name Jan 7001 Deven 22 7002 Clause 55 7004 Monish 11 7010 Dipesh 55 7070 Dipika 100 table2 looks like id Name Feb 7001 Deven 12 7002 Clause 15 7003 ...

Running pl/sql in Korn Shell(AIX)

I have a file to execute in Ksh written by someone. It has a set of commands to execute in sqlplus. It starts with, sqlplus -s $UP <<- END followed by a set of ddl commands such as create,drop,etc., When I execute the file in the shell, I get the error in the starting line quoted above. I understand "-s" starts the sqlplus in silent...

How to authorize a user/application combination in Oracle?

I'd like to authorize the user/application combination, not only the user. The scenario is that we've built an app that guides the user to safe updates of some data. If the same user installs PL/SQL Dev, Toad, or any other Oracle management tool, she can edit the data in ways that the app prohibits. ...

Hibernate: how to call a stored function returning a varchar?

I am trying to call a legacy stored function in an Oracle9i DB from Java using Hibernate. The function is declared like this: create or replace FUNCTION Transferlocation_Fix (mnemonic_code IN VARCHAR2) RETURN VARCHAR2 After several failed tries and extensive googling, I found this thread on the Hibernate forums which suggested a ma...

Explain FOR in oracle

I am making a test. I have all tests in rows, so my rows looks like this; ID | TEST ---------------------------------- 1 | 'select sysdate from dual' 2 | 'select sysdatesss from dual' Now I read it row by row and I need to test it with EXPLAIN PLAN FOR so the for the first row it would be EXPLAIN PLAN FOR select sysdate fro...

Need help to build a PL/SQL Query

Hi, I'm having scenario to which a sql query need to be built. I tried to come up with a efficient query, but could not find a clear way of doing this. My scenario is as follows: I'm having TABLE_A and TABLE_B ,where FIELD_AB will definitely be a filed of TABLE_A, however, there can be exist FIELD_AB in TABLE_B. I need to retrieve val...

Does Oracle Apex 4 enable the following AJAX features? (ie without the dev writing the Javascript)

Check client side that any 2 out of three fields have been completed before allowing submision of a form Show/hide data capture fields based on the value of a check box (all client side)? ...

Spring Security - is Role and ACL security overkill?

I have a 3 tier application that requires security authorizations be placed on various domain objects. Whether I use Spring's ACL implementation or roll my own, it seems to me that ACL based security can only be used to authorize (service) methods and cannot be used to authorize URL or web service invocations. I think this because ho...

Oracle SQL Update query takes days to update

I am trying to update a record in the target table based on the record coming in from source. For instance, if the incoming record is present in the target table I would update them in the target else I would simply insert. I have over one million records in my source while my target has 46 million records. The target table is partitione...

Precision of Interval for PL/SQL Function value

Generally, when you specify a function the scale/precision/size of the return datatype is undefined. For example, you say FUNCTION show_price RETURN NUMBER or FUNCTION show_name RETURN VARCHAR2. You are not allowed to have FUNCTION show_price RETURN NUMBER(10,2) or FUNCTION show_name RETURN VARCHAR2(20), and the function return value ...

Multiple REPLACE function in Oracle

I am using the REPLACE function in oracle to replace values in my string like; SELECT REPLACE('THE NEW VALUE IS #VAL1#','#VAL1#','55') from dual So this is OK to replace one value, but what about 20+, should I use 20+ REPLACE function or is there a more practical solution. All ideas are welcome. ...

How can you tell which columns are unused in ALL_TAB_COLS?

When you query the ALL_TAB_COLS view on Oracle 9i, it lists columns marked as UNUSED as well as the 'active' table columns. There doesn't seem to be a field that explicitly says whether a column is UNUSED, or any view I can join to that lists the unused columns in a table. How can I easily find out which are the unused columns, so I can ...

Call Oracle package function using Odbc from C#

I have a function defined inside an Oracle package: CREATE OR REPLACE PACKAGE BODY TESTUSER.TESTPKG as FUNCTION testfunc(n IN NUMBER) RETURN NUMBER as begin return n + 1; end testfunc; end testpkg; / How can I call it from C# using Odbc? I tried the following: using System; using System.Data; using System.Data.Odbc; class ...

Oracle: Get list of functions for user

How do I get a list of all the functions for a particular user? EDIT for question clarification: When (as USER1) I run select * from all_objects where owner = 'USER2' and object_type = 'FUNCTION'; it doesn't return all the functions that I know USER2 owns. I suspect that it is only returning those functions that USER1 is allowed to...

How to combine 12 tables with some different and some same fields

Hi friends i am having problem in joining tables in oracle my tables are shown bellow table1 looks like id Name Jan 7001 Deven 22 7002 Clause 55 7004 Monish 11 7010 Dipesh 55 7070 Dipika 100 table2 looks like id Name Feb 7001 Deven 12 7002 Clause 15 7003 Nimesh ...