oracle

How do I do proximity search in Oracle right?

Oracle's NEAR operator for full text search returns a score based on the proximity of two or more query terms. For example: near((dog, bite), 6) matches if 'dog' and 'bite' occurs within 6 words. What if I'd like it to match if either 'dog' or 'cat' or any other type of animal occurs within 6 words of the word 'bite'? I tried: ...

TransFusion: Should I denormalize Loan, Purchase, Inventory and Sale tables into one Transaction table?

Based on the information I have provided below, can you give me your opinion on whether its a good idea to denormalize separate tables into one table which holds different types of transactions?.. What are the pro's/con's?.. Has anyone attempted this before?.. Banking systems use a CIF (Customer Information File) [master] where customers...

Upgrade Oracle database from 9.2.0.7 to 9.2.0.8

We are planning to upgrade from Oracle 9.2.0.7 to 9.2.0.8. Main reason of the proposed upgrade is to address the issue in relation to exception "terminated with error: ORA-00904: "T2"."SYS_DS_ALIAS_4": invalid identifier" when we try to execute DBMS_STATS.GATHER_SCHEMA_STATS. We are concerned that the proposed upgrade may have negative...

on sql basic question

Q. display all the salaries and display total sal at the end? Q. how many column are inserted in a single table? ...

Update multiple rows in oracle

Hi! Can you tell me how to update multiple rows in oracle as when I fired the update statement it gave me the following error UPDATE BI_BSELATEST_LATESTPRICESTEST SET PREVIOUS_DAY_CLOSE = (SELECT DISTINCT aa.DLYPRICE_CLOSE FROM DATAFEED_EQTY.FEED_DLYPRICE aa , ( SELECT a.sc_code , MAX(a.DLYPRICE_DAT...

Can an Oracle user get a list of its own running sessions without access to v$session?

I have an application that runs a process and I only want one process to run at a time. Some options are: Use an object lock to prevent subsequent processes running. This would be fine, but I want the calling session to return immediately and not wait for the running session to complete. Use a custom Y/N to set whether a process is ru...

Oracle join query

There are three tables in my db ITEM_MASTER, PRICE_MASTER, COMP_MASTER ITEM_MASTER STORE_CODE ITEM_CODE ITEM_DESC 011 914004 desccc PRICE_MASTER STORE_CODE ITEM_CODE COMP_CODE 011 914004 01 011 914004 02 011 914004 03 011 914004 04 COMP_MASTER COMP_CODE CO...

Table names, and loop to describe

Working in Oracle 10g. Easy way to list all tables names (select table_name from dba_tables where owner = 'me') But now that I have the table names, is there an easy way to loop through them and do a 'describe' on each one in sequence? ...

Integration transport choice (Oracle + SQL Server)

We have several systems with Oracle (A) and SQL Server (B) databases on backend. I have to consolidate data from those systems into the new SQL Server database. Something like that: (A) =>|---------------| | some software | => SQL Server (B) =>|---------------| where some software is: transport (A and B systems located in th...

Query a stored procedure for it's parameter names and types

Is there any easy way to query a stored procedure (Oracle - PL/SQL) for what parameters it expects? I know that I can query USER_SOURCE to get the whole procedure but I'd then have to parse the whole procedure, and if the parameter is of type [table].[column]%TYPE I'd then have to query the table schema as well. Either using just sql o...

Oracle/Toad Active Pane Setting

On TOAD for oracle, there is a bar at the bottom where your active windows (be it an sql editor, schema browser or SQL modeller window) are displayed. I have just moved office and it now only displays the active window and none of the other windows... any of you toad guru's know how to get it to display all the windows? Toad version 7....

Is it possible to expose data from Oracle using OData?

From my personal research, it appears that OData implementations depend extensively on MS Entity framework. It would seem possible to implement the OData producer protocol using an open ORM like NHibernate in C# or Hibernate in Java. In the best of all worlds, it would be cool to expose data using OData protocol from Oracle. I am ope...

How can I connect PHP 5.1 to Oracle 7?

I have been able to query newer Oracle databases using the PHP oci8 extension with the Oracle 10.2 Instant Client. Unfortunately, the Oracle Instant Client seems to be unable to connect to an Oracle 7 database (version 7.3.3 to be precise). Is there a way to query an older Oracle database from PHP? ...

how to know on which column,the sequence is applied?

I have to fetch all sequences with their table name along with the column name on which sequence is applied .Some how i managed to fetch table name corresponding to sequence because in my data base sequence is stored with first name as table name from data dictionary(all_sequences and all_tables) . Please let me know how to fetch corres...

Oracle: How can I set up the example tables?

Many Oracle discussions use the emp and related tables in the scott/tiger schema. How can I set up these example tables on my own? ...

Creating a [materialised]view from generic data in Oracle/Mysql

I have a generic datamodel with 3 tables CREATE TABLE Properties ( propertyId int(11) NOT NULL AUTO_INCREMENT, name varchar(80) NOT NULL ) CREATE TABLE Customers ( customerId int(11) NOT NULL AUTO_INCREMENT, customerName varchar(80) NOT NULL ) CREATE TABLE PropertyValues ( propertyId int(11) NOT NULL, customerId int(11) NOT...

Oracle aggregate function to return a random value for a group?

The standard SQL aggregate function max() will return the highest value in a group; min() will return the lowest. Is there an aggregate function in Oracle to return a random value from a group? Or some technique to achieve this? E.g., given the table foo: group_id value 1 1 1 5 1 9 2 2 2 4 2 8...

customer.pk_name joining transactions.fk_name vs. customer.pk_id [serial] joining transactions.fk_id [integer]

Pawnshop Application (any RDBMS): one-to-many relationship where each customer (master) can have many transactions (detail). customer( id serial, pk_name char(30), {PATERNAL-NAME MATERNAL-NAME, FIRST-NAME MIDDLE-NAME-INITIAL} [...] ); unique index on id; unique cluster index on pk_name; transaction( fk_name char(30), tran_type char(1...

Oracle query to select rows with unique code

I have a table like this C1 C2 C3 Code 1 2 3 33 1 2 3 34 2 4 1 14 1 2 3 14 i want to select only those record whose code is appearing only in single row. ie, in this case rows with code 33 and 34.. as they appear only once in this table. How can i write a query for that ...

Concatenation of CLOB datatypes in a LOOP in PL/SQL

Good Day Gurus, I am trying to concatenate clobs in a PL/SQL loop and it has been returning null whilst when using DBMS_OUTPUT prints out the loop values and when executing each result of the clobs gives an output as well. The system is meant to execute an already stored SQL in a table based on the report name passed into it. This part...