Return Separate Result Set From Each Statement

Jul 19, 2008

I am simply trying to execute a couple of select statements in a single dynamic query. I also want it to return a seperate result set from each statement (something quite easy in T-SQL - but seemingly impossible in PL-SQL!)

This query is being run from C#, but i also get the same results from Sql Developer.This is what i'm trying to execute:

begin
select * from studies;
select * from studyprogressions;
end;

The error i get is "an INTO clause is expected in this SELECT statement" for each of the select lines - As you may already have worked out - I don't use Oracle very often and am starting to feel very stupid considering i have certifications in SQL Server/T-SQL!

I have searched online for a solution, but it seems that everyone with the same error is trying to do so much more.Why is nothing in Oracle simple? Give me SQL Server any day of the week.

View 14 Replies


ADVERTISEMENT

SQL & PL/SQL :: Return A Result Set From One Database To Another?

Sep 4, 2012

Is there any way to return a result set (using a Database Link) from one Database to another Database? Database A needs to call Database B and Database B needs to return a result set via a stored package/function. The stored procedure/function on Database B also accepts 1 input parameter. Something like "select test.test('some input parameter')@database_b from dual'.

View 39 Replies View Related

SQL & PL/SQL :: Query Result More Row Return In Oracle

Apr 3, 2013

I have a view base on this query returned more rows returned.

select *
From (
Select c_code ,
from_date,
c_range ,
[code].........

View 5 Replies View Related

Statement Separate In SQLPlus / It Successfully Returns Schema

Mar 28, 2008

I am running this statement in a Java DAO and it results in an SQLException. I'm trying to get the DB schema. If I run this statement separate in SQLPlus, it successfully returns the schema. Why this is failing in my Java program?

ResultSet r = s.executeQuery("SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM S_DUAL;");

View 5 Replies View Related

SQL & PL/SQL :: Insert Into Statement Doesn't Insert All Rows Return By Select Statement?

Jan 12, 2011

If i inserted the values in table it gets inserting very few rows only.I dont know y it is?

View 15 Replies View Related

Forms :: Incorrect Result On Assignment Statement?

Mar 3, 2011

When I run a menu (which was working fine yesterday and hasn't been changed in months) I click on an item and it runs the following

"
DECLARE
module_name VARCHAR2(125);
BEGIN
module_name := :GLOBAL.FORMS_PATH || 'covenants';
Open_Form(module_name);
END;
"

The module_name variable should be assigned the value 'covenants', because :GLOBAL.FORMS_PATH is '' (nothing). I stepped thru the code and in the debug system values window there is nothing in :GLOBAL.FORMS_PATH. But instead, it gives me: 'FORM_NAMEcovenants' where 'FORM_NAME' is the form the menu was called from.

View 5 Replies View Related

SQL & PL/SQL :: Call Function With Row Type Return In Oracle Select Statement

Jul 3, 2012

How to call a function with a row type return in an Oracle select statement.

For e.g. :

If I had this function with a rowtype return:
------------------------------
create function abc
return xyz%rowtype
is
rec xyz%rowtype;
begin
select * into rec from xyz where col1 = n;
return rec;
end;
--------------------------------
How could I use this in a select clause, as there is a multi column return by the function ?

View 5 Replies View Related

Application Express :: Get Nested Case Statement To Evaluate One Result / Instead Of Multiple?

Mar 26, 2013

OK, Now that the syntax has been corrected with "Chanchal Wankhade" I have an entirely new issue. I am sure this issue has to do with my case statement logic. I am getting multiple rows, when I am only looking for one. Here is my code:

SELECT
  CASE
    WHEN EP.PHYSICAL_DATE IS NULL
    THEN
      CASE
        WHEN EC.ORIGINAL_CONTRACT_START < ((SYSDATE) - 365)
        THEN 'NEEDS PHYSICAL'
 [code].....     

However, only one of these rows should be the output, which is "No". How do you get a nested case statement to evaluate to one result, instead of multiple? I'm quite sure it is in the logic. To spell it out, this is what I am trying to accomplish with the above code: If the "EP.PHYSICAL_DATE" is null, then use these sets of formula's to evaluate the output, BUT if the "EP.PHYSICAL_DATE" is not null, then use these set's of formula's to evaluate the output.

As it stands now, it appears as if my nested case statement is doing exactly what I told it to do, which is to evaluate both conditions, and output both.

View 0 Replies View Related

Application Express :: 4.2 Item - Validation Return Boolean And Return Error Text Are Switched

Oct 17, 2012

In Apex 4.2, the item validation of "Function Returning Boolean" and "Function Returning Error Text"; They seam to be backwards.

Is there a simple statement that can be used to fix this in the apex dictionary?

View 1 Replies View Related

SQL & PL/SQL :: How To Eliminate And Separate String

Apr 29, 2011

In my table i have a field called swistmsg, which contains value as

:201:0001OTT11000004|:23b1:CRED|:32a1:01-01-2011|:32a2:USD|:
32a3:1000.|:33b1:USD(similarly around 100 rows)

and my requirement is

201 0001OTT11000004 23b1 CRED 32a1 01-01-2011 32a2 USD 32a3 1000 33b1 USD

and i have eliminate '.',':'&'|' (only quoted chars)from the string separate string

View 17 Replies View Related

SQL & PL/SQL :: Separate String Using REGEXP_SUBSTR

Jan 25, 2011

I can separate numbers from string (info) and the first value of the string using REGEXP_SUBSTR (see below):

with dat as (select '35263304 Alcatel One Touch 806' info from dual)
select info, REGEXP_SUBSTR ( info, '[[:digit:]]+',1 ) tac,
REGEXP_SUBSTR ( info, '[[:alpha:]]+',1) brand
from dat

But how can I get rest of the values from that string (red color) ?

I just would like to get separately like:
35263304 Alcatel One Touch 806

View 5 Replies View Related

SQL & PL/SQL :: Separate CSV Values In A Field?

Nov 6, 2012

create table nov06(
f_name varchar2(20),
l_name varchar2(50),
m_name varchar2(10)
)

insert into nov06 (l_name) values (aaa,bbb);

insert into nov06 (l_name) values (ddd,nnn,jr);

insert into nov06 (l_name) values (fff,mmm);

here the values in the l_name are seperated by ','.
comma seperated values represents "f_name,l_name,m_name".

I've to seperate the strings and put in their respective fields.

Quote:
e.g in second insert statement value (ddd,nnn,jr), so the values will be
f_name -> ddd
l_name -> nnn
m_name -> jr

how can I do it???

View 2 Replies View Related

SQL & PL/SQL :: Separate Date And Time

Nov 1, 2012

I have a question with Oracle sql developer, i've installed oracle 11g express edition, and i want to insert values 'date' and 'time', but i only got the resultat like this:

Who can tell me how can i do to show just date info in 'date' and same for the 'time'?

View 7 Replies View Related

RAC For Separate Node's Physical Location

Mar 21, 2012

I would like to implement Oracle RAC with 2 nodes for SE Licence. I did a lot when both this nodes with 3 NICs each were plugged at the same switch. Now I have a need to construct a RAC when two nodes will be in separate locations, abot 4 miles from each one. What should I explain to our network administrator he needs to do to implement this solution? I've been told that they can do a FO channel to each location. But don't have exact clear explicaton.

View 3 Replies View Related

SQL & PL/SQL :: Separate Index And Tables In Two Different Tablespace

Apr 14, 2013

How to saperate inndexes and tables in two different tablespcae.......???

View 2 Replies View Related

Forms :: Opening New Form In Separate Tab

Dec 18, 2011

I have a multiple forms application and I use OPEN_FORM to call one form from another. However I want the new form to open in a separate tab ( the way it works in a tabbed canvas).

View 4 Replies View Related

SQL & PL/SQL :: Separate String Based On Comma?

Oct 28, 2013

This I want TO separate TO different COLUMNS based ON comma.

THE RULE IS LIKE out OF total five fields FIRST 3 comma will be FIRST 3 addresses AND rest will be address4 AND LAST NUMBER should appear IN pincode field IF found.

The trouble is for reading reverse to get the number.

WITH address AS (SELECT 'Avenue Supermarts Pvt Ltd,Anjaneya, Opp Hiranandani Foundation School, Powai, Mumbai,Pin Code 400076' addr1 FROM dual UNION ALL
SELECT 'Plot No. J-I, Block B-I, Mohan Co-operative Industrial Area, Mathura Road, New Delhi-110044' addr1 FROM dual UNION ALL
SELECT 'Padmashree Arcade, NH 5, Chinagantiyda Main Road, Gajuwaka, Vishakhapatnam' addr1 FROM dual UNION ALL
SELECT 'The Icon, 2nd 3rd Floor, #8, 80 Feet Road, HAL III Stage, Indiranagar, Banglore-560075' addr1 FROM dual UNION ALL
SELECT '13/1, International Airport Road, Bettahalasur Post, Bengaluru-562157' addr1 FROM dual)
SELECT addr1 FROM address;

View 10 Replies View Related

SQL & PL/SQL :: Separate Date Interval By Trimester

Jul 26, 2011

Let's say I have this table:

create table TEST
(
CF VARCHAR2(16),
START_DATE DATE,
END_DATE DATE
)

with

insert into test (CF, START_DATE, END_DATE)
values ('ME', to_date('01-01-2011', 'dd-mm-yyyy'), to_date('31-12-2010', 'dd-mm-yyyy'));

I need make a select where I get n rows, where n is the number of trimesters that compose the date interval in the table. Each of the returned rows must have as start_date/end_date the boundaries of that trimester.(ALL start dates are the first day of a month, and all end dates are the last day of a month)

In this case I need to get:

ME - 01/01/2010 - 31/03/2010
ME - 01/04/2010 - 30/06/2010
ME - 01/07/2010 - 30/09/2010
ME - 01/10/2010 - 31/12/2010

View 9 Replies View Related

PL/SQL :: Separate Different Arithmetic Operators In A Query?

May 14, 2013

I wrote an query and regarding one part, i have syntax problem, when should we seperate different arithmetic operators in a query?

for example

select  density_with_desert.popp  /  density_with_desert.arr  -  sum(darea)  from counytyi don't want to use variables.

View 8 Replies View Related

Forms :: Separate Frame Applet

Mar 17, 2011

We are using oracle forms 10g, in formsweb.cfg file i gave separeteFrame=true and it works fine also like IE & applet window is opening. But User wants to hide the IE in backegroud and they want only applet window, so using VBScript we are hiding the IE and now only applet window apears this also fine.

I am running the report and displaying the report using web.show_document, report is running fine and displaying in IE with PDF format. But the problem is if i press the run report button report is opening and displaying behind the applet window not infront of applet window and there is no focus on the report IE also. How to display the report output(IE with PDF format) infront of the applet window and current focus on the report window(IE with PDF).

Note: If i use separateFrame=false then report is displaying infront of the IE screen and focus is on the report IE.

View 1 Replies View Related

Forms :: Fmx Files Into Separate Folder

Apr 29, 2013

I have some .fmb files in 'F: ask" " ' location.and my question is can i store the .Fmx files in other location like 'D:" " '

that is if i create a .fmx file for the 'F: ask**.fmb'. i want That .fmx file will store into other location i.e 'D '

View 3 Replies View Related

SQL & PL/SQL :: Make Query Like Separate List Of Orders

Mar 1, 2010

I have table called Orders with lots of fields from Imports Fields are ConsigneeKey,Shipto,ProductCode. and another table called Product. Main fields are ProductCode,Price,Weight,StdCube. Now I have two list of Consineekey,One which is shipto X area and another is of Y area. I want to make query like separate list of Orders which is shipto X,Y and Common Products in Both X and Y. I will supply list of Consigneekey in where clause.

View 8 Replies View Related

Separate ASM Diskgroup For Online Redo Logs

Sep 25, 2013

Version: 11.2.0.3Platform : Solaris 10   

One of  the Hitachi support guy has suggested to create a separate disk group for Online redo logs. His rationale was that ORLs was write only files and it would be better to put in a separate disk group.

View 6 Replies View Related

SQL & PL/SQL :: Fetch All Emails Of Employees And Separate Them By Semicolon

Aug 17, 2010

Need pl/sql block to fetch all the emails of all the employees from the database and separate them by semicolon....

View 4 Replies View Related

Archivelog Location In Separate Date Format

Nov 10, 2013

archive logs to be stored in its own "date formatted" separate folders.I have already configured flashrecovery area and I dont want to change it as backups are stored there.How can I achieve this without changing the flash recovery area location ? db_recovery_file_dest is set to G:log archive dest is set to F

View 8 Replies View Related

Create A Separate Sort Order Column On Table

Oct 31, 2006

I have data that i am sorting, the data is mostly numeric (format of XXX-1234). is there any way to have my query sort xxx-1000 AFTER xxx-999? right now i am thinking i will have to create a separate sort order column on my table.

View 2 Replies View Related

Separate Date Format For Specific Columns In A Database

May 25, 2011

As we know that date datatype can store both date part and time part. If I specify the Date format for my database as 'DD-MM-YYYY HH@$:MI:SS' can i ensure i anyways for a particular columns in the database containing date values the format is 'DD-MM-YYYY' i.e without the time part.Can we specify seperate date formats for specific columsn in database during table creation?

View 1 Replies View Related

Forms :: How To Capture Date And Time In Separate Fields

May 8, 2012

I want to capture date and time in separate fields from user and save it in single column in table

example: user enters date and time
Date : 08/05/20212
Time : 18:50:00

At the time of save I want to save [08/05/2012 18:50:00].

View 1 Replies View Related

SQL & PL/SQL :: How To Display The Status And Record Count In Separate Rows

Mar 6, 2013

My problem is i need to display the status and the record count in separate rows.How can i do it

Example

SELECT 'A' STAT, COUNT(A) CNT,'B' STAT, COUNT(B) CNT,'C' STAT, COUNT(C) CNT
FROM TAB1;

OUTPUT SHUD BE LIKE

STAT COUNT
A A_cnt
B B_CNT
C C_CNT

View 13 Replies View Related

JDeveloper, Java & XML :: Two Separate Database - Transfer Data

Feb 15, 2011

I have two separate databases, I want to send XML file contains a query from one to the other , that read query and return results to a first via XML file.

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved