oracle

How to set minvalue of sequence to result of a select query?

Hello all, I am trying to create a sequence in oracle sql, using the "minvalue" as the result of a select query. The select query I'm trying to run is: SELECT MAX(customer_id) + 1 FROM customer I know it's easy with an anonymous pl/sql, but I'd like to find a way which doesn't use pl/sql. Some ideas I've had include the ...

How can I pass a list of pairs to an Oracle stored procedure?

I want to write an Oracle PL/SQL stored procedure that takes as a parameter a list of pairs of some other type, say varchar2(32). Is this possible? What's the best way to do it? ...

Trouble understanding SQL (Oracle) create table code

I am aware of Oracle's create table syntax CREATE TABLE MyTable( id int primary key, ... ); This will create a table called MyTable with an int primary key. So, nothing new here. but I am having difficulties understanding the following query: CREATE TABLE departament ( cod_dept INTEGER CONSTRAINT dept_key PRIMARY KEY, ...

Update Apex Tabular form with PLSQL

Hi All: How can I update an Apex Tabular Form with pl/sql instead of using a multi-row update(MRU), is it even possible? Thanks in advance. ...

Does SQL Server have a feature similar to Oracle Streams Advanced Queuing?

Oracle Streams AQ (Advanced Queuing) provides highly scalable database-backed queuing functionality. Does an equivalent feature exist in SQL Server (any version)? Note: I do not mean simply using a table as a queue, but a specific vendor-provided enhancement to the database platform. ...

a really basic implementation for hibernate calls plsql function

hi, i really need a basic hibernate implementation calls oracle plsql function. it must include configurations, dao and test class. is there any example for that? ...

Change varchar data type to Number in Oracle

I have data like this in oracle database -> 20123,45 ,data type is varchar. and I want to migrate it to column with NUMBER data type, change comma (,) to dot (.). so expected result is 20123.45 and data type is NUMBER, how can I do that ? thanks before :D ...

How can I write a procedure to find a set of rows like this?

Sorry about the rubbish question title. I have a table SET_DEFINITIONS like this: SETKEY NOT NULL NUMBER(38) SETENTRY NOT NULL NUMBER(38) where the idea is that the rows define sets of numbers. For example the table could contain rows: 1 2 1 4 2 1 2 2 which would mean set 1 is {2,4} and set 2 is {1,2}. I want to wr...

Solaris ufs forcedirectio

Hello! I have oracle database on the Solaris 9 box Oracle datafiles stored on the ufs filesystem mounted with forcedirectio . So I'm using now only Oracle Buffer Cache question: is it good idea to remove forcedirectio option to improve IO performance? ...

Oracle VPD how to reference the table

I'm struggling with the following problem. I want to restrict access to a table using Oracle VPD. In the where clause that the select policy function returns I need a reference to the table in a subquery as follows: select * from Table t1 where not exists (select 1 from Table t2 where t2.name=t1.name and t2.date=t1.date) (The example ...

column alias oracle 10g

This seems so simple but I can't understand how do I do this query: I have a table users like this: user_id | name | role 1 | abc | a 2 | lol | b 3 | f | c and a table usersprojects (with user and project PKs) projectid | userid 1 | 1 1 | 2 2 | 2 2 | 3 How could I select all us...

PL/SQL - How to create a conditional cursor?

Hi, I need to have a conditional cursor, like: If a row exists (using WHEN EXISTS or something like this), then my cursor is: CURSOR varCursor IS SELECT 1 a FROM DUAL; Else CURSOR varCursor IS SELECT 2 a FROM DUAL; But look, I don't want to change a column result, I want to change the entire cursor. Bellow I put a bigger examp...

Oracle RAC One Node

In the latest version of Oracle Database (11g Release 2), there's a new option called Real Application Clusters (RAC) One Node. What is "One Node", and how does it differ from regular RAC? ...

Java OR PHP Server Side Web App and Why?

I am creating a web app that involves a lot of DB access and parsing and analysing data , Java is the language i am most comfortable with but recently have been told that I should consider to use PHP as it makes DB access protocols a lot simpler. I dont have any great knowledge of PHP but would be willing to learn for use if it was goin...

Match groups in Oracle 10g2 regular expressions

I need to extract some data from malformed XML stored in an Oracle database. The XPath expressions would look like this: //image/type/text(). One take at a regular expression which would work in a similar fashion would be <image>.*?<type>(.+?)<\/type> (with appropriate flags for multiline matching). Since Oracle does not support match g...

grant privilege to another user.

I am logging into oracle as a simple user.I want other user who are logged in to the same database as i am ,be able to see and manipulate tabels and stored procedure. I used grant privilege to achieve this. grant all on tablename to user; but it is not working ie on querying the table it is showing no such table or view exist...

ORACLE PL/SQL: Functions and Optional Parameters, How?

I'm looking for the optimal way to create a function that can accept no parameters and return all results, but also accepts parameters and return those results. The standard I've been dealing with at my job is this: FUNCTION get_records ( i_code IN records.code%type := NULL, i_type ...

Ensuring that column follows a sequence in Oracle

Is there any way of constraining a column (say "ID") to follow a created sequence (say "ID_SEQ")? Without an automatic constraint, manual inserts might throw the entire sequence out-of-whack. What can be done to fix this? Just call NextVal twice? ...

Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle'

Well, As I read and try every topic similar without success, I decided to post my own question. My solution has a console app and a class library for dataaccess. The Nhibernate configuration is inside the appconfig in the console app (which I'm currently using for debug, as I will after make a Web App and migrate all configuration to we...

get list of numbers in between two columns

I have a table1(startnumber, endnumber) in oracle; Now I need to select all the numbers lies in between startnumber and endnumber from table1 data eg. table1 startnumber endnumber 10 15 18 22 34 50 Now I need the result set as: 10,11,12,13,14,15,18,19,20,21,22,...