oracle

Getting APEX session in external web page

Hello! I want to use APEX authentication in my web page. I have created some APEX application which has only 2 pages. First contains only login region, second page is redirected to another page (stored procedure in ORACLE - usage of embedded gateway) before it reaches the header (Apex Branch). How can I now check valid APEX session? I t...

How do I select all the columns from a table, plus additional columns like ROWNUM?

Hey guys, I'm sure this is an easy question, but I have looked around and haven't found a way to do it. In Oracle, I know it's possible to do a select statement that returns the row number as a column in your result set. Example: select rownum, column1, column2 from table Returns: rownum column1 column2 1 Joe...

Backing up SQL Plus environment during script

Some scripts I have inherited will blindly call SET FEEDBACK OFF or SET ECHO OFF at the beginning of the script, then set them to ON or OFF at the end of the script. I would like to modify these scripts to determine what value was set before the script was run, and set the environment back to that value when the script completes. How d...

Quoting identifiers for dynamic SQL in PL/SQL

Is there a PL/SQL function or general technique to quote unqualified identifiers (e.g., mytable) for use in a dynamically constructed SQL query? How about partially or fully qualified identifiers (a.b@c)? Consider this contrived example: CREATE PROCEDURE by_the_numbers(COL_NAME VARCHAR, INTVAL INTEGER) IS ... BEGIN -- COL_NAME is ...

How to share data across an organization

What are some good ways for an organization to share key data across many deparments and applications? To give an example, let's say there is one primary application and database to manage customer data. There are ten other applications and databases in the organization that read that data and relate it to their own data. Currently this...

Oracle Jobs executing Java

Is it possible to run a java jar file from within an Oracle (10g) database? More specifically, I am looking to schedule an oracle job using dbms_scheduler.create_job(...) When run, the job would call a Java Application that performs a process involving talking to another application via HTTP, some business logic, then executing a Sto...

Coordinates conversion

Hi, I am working over a small component for a web portal that show polygons over a map, using OpenLayers, Google Maps, and another proprietary source . The user has the points in PSAD56 (UTM) datum and I need to change it to WGS84 in order to use with Google Maps. I have at hand both Oracle 9i without spatial extensions and postgis....

how to return a dynamic result set in Oracle function

I found a string tokenizer query on the net and packaged it into the below function, which return the dynamic set of tokens. The function compiles successfully but somehow I get the error "ORA-00933: SQL command not properly ended". Can someone please help me debug this? Thank you. CREATE OR REPLACE TYPE KEY_VALUE_TYPE is object (k varc...

Flattening columns in a one-to-many relationship in Oracle 10g

I'm guessing this is a matter of figuring out what oracle command to use, but after a couple of hours of googling, I haven't found anything that can do what I need. So here's what I need to have happen in a nutshell: Table 1 Table 2 | PrjID | | PrjID | UserID | |----------| |----------|------...

How do I convert a "legacy" left outer join statement in Oracle?

I have two tables (A and G) in an Oracle database that can be joined together based off an account number. The one caveat to this is that one of the tables (G) has about 80 fewer records than the other. When I query the two tables together, I need to get all of the rows, so that we see NULL data in the columns for the missing 80 rows. I...

Loop through each record from a table and a calculated record into other table in Oracle

I am new to Oracle 10g. I have couple of tables as shown below: INCOME_MASTER INCOME_ID NUMBER(10) sEQ NUMBER, INCOME_TYPE VARCHAR2(10), INCOME_DATE DATE INCOME_DETAILS INCOME_DETAILS_SEQ_NO NUMBER(10) SEQUENCE, INCOME_ID NUMBER(10), ITEM_ID NUMBER(10), ITEM_VALUE NUMBER (10,...

Call Oracle stored procedure from C#

I Have a stored procedure: CREATE OR REPLACE PROCEDURE UpdateFileMapping(field in number, original_Field_Names in DBMS_SQL.varChar2_table, mapped_Field_Ids in DBMS_SQL.number_table) IS C NUMBER := DBMS_SQL.OPEN_CURSOR; N NUMBER; BEGIN DBMS_SQL.PARSE(C,'INSERT INTO input_file_mapping VALUES(input_file_mapping_id.NextVal, 3, field, :fiel...

Splitting comma separated string in a PL/SQL stored proc

Hi, I've CSV string 100.01,200.02,300.03 which I need to pass to a PL/SQL stored procedure in Oracle. Inside the proc,I need to insert these values in a Number column in the table. For this, I got a working approach from over here: http://stackoverflow.com/questions/1089508/how-to-best-split-csv-strings-in-oracle-9i [2) Using SQL's c...

Count distinct co-occurrences

I have a database with a listing of documents and the words within them. Each row represents a term. What I'm looking to do is to count how many documents a word occurs in. So, given the following: + doc + word + +-------+--------+ + a + foo + +-------+--------+ + a + foo + +-------+--------+ + a + bar + +-----...

persistent connection

I'm writing php web-app using unholy alliance of php+oracle+iis :) every time script being executed I create a new connection to db - and it takes time: class ORACLE_layer { public function __construct($usr, $pwd, $db) { $this->conn = oci_connect ("...") } function __destruct() { oci_close($this->conn); ...

List of database table types and security permissions?

I can't find any list for the various table types and if possible the basic default 'good practice' security permissions for tables types. I am referring to a complete list like this: http://www.databasejournal.com/features/oracle/article.php/3616476/Types-of-Tables-in-Oracle.htm The above list has few general but not in depth like Look...

How to check if all fields are unique in oracle?

Hi guys simple question, but can't find anything. Thanks ...

Microsoft Sync 2.1 : Oracle 11g -> SQL Server 2008 Sync : Cast not valid Exception

I am trying to sync tables in a Oracle 11g and Sql Sever 2008 databases using the Sync Framework. I used the Database Sync: Oracle and SQL Compact 2-Tier Sample as a base and was able to extend it to sync data between the Oracle 11g and Sql Server database using the same order and order_details tables. I used ODP.NET data access libra...

How to simple change node's attribute value of XMLTYPE in Oracle 11g r2?

Hi! I just wanna to change in this XML (contained in XMLTYPE variable) all nodes named "ChildNode" with "Name"="B" attribute values to "C": <RootNode> <ChildNodes> <ChildNode Name="A"/> <ChildNode Name="B"/> </ChildNodes> </RootNode> DECLARE FXML XMLTYPE; BEGIN FXML := ...; -- see text before -- what next? END; Than...

Test database to test performance tuning techniques in Oracle

Hello gurus, I want to test some performance tuning techniques on a realistic database with many database tables and a lot of data. I would like to do this in Oracle 11g Release 1 and would like to know how best to go about this or if there is a website I could get realistic datasets/database from. Many thanks for your audience. Cheer...