oracle

How do i get records from table in pl/sql?

Hi!!! I have one table : Questionmaster. it stores DisciplineId,QuestionId,QuestionText etc... Now My Question is: I need 10 records of particular DisciplineId, 20 records for another DisciplineId and 30 records for Someother DisciplineId.... What should I do for that? How can I club all statement and get just 60(10+20+30) rows select...

How to get next and previous record from cursor?

Hi... I have a table named testtransaction which stores pervQuestionId and NextQuestionId... How to insert records in this table through cursor? there is something cursoe.getnext()...how do i implement it? My code is shown below: create or replace function store_data(disciplineid in char, NoO...

Oracle - Need help with RMAN Active Duplication on Windows 32 bit to a 64 bit

I need to have an Oracle 11g R1 on a Windows 32-bit duplicated to a Windows 64-bit using RMAN Active Duplication. 32-bit setup: Windows Server 2003 R2 Standard Ed. SP2 Database - Oracle 11g 11.1.0.6.0 64-bit setup: Windows Server 2008 R2 Standard Ed. Startup Database - Oracle 11g 11.1.0.7.0 Although 11g R1 is not cert...

oracle date range

Hi, using a Oracle 10g db I have a table something like this: create table x( ID NUMBER(10) primary key, wedding DATE NOT NULL ); how can I select * from x where wedding is in june 2008??? I know it is probably an easy one but I couldn't find any satisfying answer so far. Help is very much appreciated. ...

pass in a numbers with a maximum size of 2^256 through a wsdl

We have currently a wsdl element that was defined as long since the number that was being passed could have a maximun value of 2^64.But now the client wants to pass in numbers with maximum values of 2^256 .In my view the only way to support this is to change the xsd type to String.Anybody has a better idea about dealing with it . Also t...

MS Access to Oracle easy Conversion / Migration

Are there any good easy to use softwares to export Access Database files to an Oracle 11g database? I know that this might not be the most usual case but applications grow, especially with old applications that uses old technologies such as Access in this case needs to be upgraded at some point. Tutorials and articles regarding Access ...

adding primary key to sql view

Reading that http://stackoverflow.com/questions/894610/how-to-do-hibernate-mapping-for-table-or-view-without-a-primary-key I am wondering how to add a primary key to my view as it is basically just a stored query...? PS: oracle 10g thx ...

A good reference for Oracle PL/SQL

What are the best references for Oracle PL/SQL? I have an excellent knowlege of SQL-92 and of MS-SQL extensions, but now I'm working with Oracle and I'm struggling to find good references for the PL/SQL language. I am looking for references for the following: Variable Loops Cursor Packages Trigger Stored Procedures Temporary Table...

Add comma-separated value of grouped rows to existing query

I've got a view for reports, that looks something like this: SELECT a.id, a.value1, a.value2, b.value1, /* (+50 more such columns)*/ FROM a JOIN b ON (b.id = a.b_id) JOIN c ON (c.id = b.c_id) LEFT JOIN d ON (d.id = b.d_id) LEFT JOIN e ON (e.id = d.e_id) /* (+10 more inner/left joins) */ It joins quite a few tables and return...

View in Oracle to display rows from last weekday

I need to make a view in Oracle that will display all rows from last weekday. So for Tuesday it should be like this cause I need all entries from Monday: select * from table_1 where to_char(Mydate,'yyyy-mm-dd') = to_char(sysdate-**1**,'yyyy-mm-dd'); But if it is Monday then I need all entries from Friday. select * from table_1 whe...

Query on Regular Expressions in Oracle

Hi, I'm trying my hand in learning Regular Expressions in Oracle ( rather, my first attempt in doing anything with RegEx). What does the character ^ signify at the start ? The documentation mentions Use the caret and dollar sign to define patterns that match the start or end of a string. ^ defines that start of a string or column 1 ...

Is it possible to specify columns that should not be loaded in ActiveRecord?

I've got a database table that is shared with another application. It has many columns that I will never use in my application. Is it possible to specify columns to be ignored in the ActiveRecord model? Usually it's not too big of a deal, but in this case I've got a table with two blobs that I'll never need joined with another table ...

How do I escape double quotes in oracle query?

I have some text fields in the oracle table, which have double quotes. How to escape them in a select query, so that I can use it in PHP? ...

Using an Oracle Table Type in IN-clause - compile fails

Simply trying to get a cursor back for the ids that I specify. CREATE OR REPLACE PACKAGE some_package AS TYPE t_cursor IS REF CURSOR; TYPE t_id_table IS TABLE OF NVARCHAR(38) INDEX BY PLS_INTEGER; PROCEDURE someentity_select( p_ids IN t_id_table, p_results OUT t_cursor); END; CREATE OR REPLACE PACKAGE BODY some_...

Would you send this simple SQL back for rework?

We have a web application in which the users perform ad-hoc queries based on parameters that have been entered. I might also mention that response time is of high importance to the users. The web page dynamically construct a SQL to execute based on the parameters entered. For example, if the user enters "1" for "Business Unit" we constr...

SQL Server: Can I Comma Delimit Multiple Rows Into One Column?

Creating Comma Separated Lists In SQL Hi All, I am attempting to merge something like this in my SQL Server database: [TicketID], [Person] T0001 Alice T0001 Bob T0002 Catherine T0002 Doug T0003 Elaine Into this: [TicketID], [People] T0001 Alice, Bob T0002 Catherine, Doug T0003 ...

Is there a way to enable procedure logging for an Oracle Scheduled Job?

I'm trying to enable logging on an Oracle Scheduled Job so that when I look at the run details of the job, I can discern what the procedure of the job worked on and what it did. Currently, the procedure is written to log out through dbms_output.put_line() since this is nice for procedures and SQL*Plus by just enabling set serveroutput on...

How to setup Oracle on Windows not to run as local system user

I need my Oracle database (single instance 10GR2) to be able to access certain files on the network. Running the service under the local system account prevents this. I will be using UNC paths so I won't run into any drive mapping issues. What account should I use? How do I setup such an account? Any expriences are welcome. ...

Can .bat file execute an sql query and return a value?

How can I call a query from a .bat file? (say my query is: select version from system). Can my .bat file save the output that this query returns? I wanna use this output in my NSIS script. ...

Oracle subquery does not see the variable from the outer block 2 levels up

I'd like to get in one query a post and the first comment associated with the post. Here is how I do it in PostgreSQL: SELECT p.post_id, (select * from (select comment_body from comments where post_id = p.post_id order by created_date asc) where rownum=1 ) the_first_comment FROM posts p and it works fine. However, in Oracle I'...