473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PL/SQL equivalent of Select 0, Select 1 etc

What is the equivalent of say...

select @somevariable or select 3 in pl/sql?

I am re-writing some existing sprocs in Oracle from SQL server and I need to return the value of a variable in a cursor

OPEN IO_CURSOR FOR
SELECT somevariable

But this is not correct. Does anyone know the correct syntax?

Thanks
May 9 '07 #1
4 7488
frozenmist
179 Expert 100+
Hi,

Try
Select 3 from dual
I hope I understood your problem
Cheers
May 9 '07 #2
I don't understand...essentially I am trying to write the following in PL?SQL

Declare @somevariable int

SET @somevariable = 1

SELECT @somevariable

This will return the value 1 as a recordset

How do you return the value of a variable in PL/SQL?

Thanks
May 9 '07 #3
debasisdas
8,127 Expert 4TB
Dear Shay

Do u want to return some value through a procedure using PL/SQL



Then write a procedure with out parameters.
May 9 '07 #4
The equivalent for DECLARE @somevariable int would be
somevariable number;

to initialize it
somevariable:=1;

and you can select its value as
SELECT somevariable FROM dual;

If you want to select some value which is in a table then you can use this
SELECT column_name
INTO somevariable
FROM table_name;
May 10 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Iain Hallam | last post by:
Hi. I've been using display:none on the style property of some <option> elements in my forms, which works fine with Mozilla - as expected it removes the option from my dropdown (although it...
4
by: stoppal | last post by:
I need some help. I am trying to write a query which does the following SELECT * from table1 where field1=(SELECT distinct field1 FROM table1 WHERE field2='2005' or field2='2010')
4
by: jas | last post by:
I am currently using subprocess to execute a command. Then I read from it's stdout...however, this is hanging on a read..waiting for more bytes. So what I would like is to timeout...and...
5
by: TS | last post by:
i used to do this in vb and haven't been able to in c# - any workaround?
3
by: bughunter | last post by:
IMHO, statements like this is mistake typically. May be more better made this construction - I said about empty WHERE - invalid? A lot of data will saved... :-) Andy
0
by: Shay1975 | last post by:
What I am trying to do is filter on some attributes and I could have a list of values, so instead of doing where attribute = value or attribute = value, I am wondering if there is something...
2
by: Shay1975 | last post by:
What I am trying to do is filter on some attributes and I could have a list of values, so instead of doing where attribute = value or attribute = value, I am wondering if there is something...
4
by: Andrew S | last post by:
Hello Mr. Expert: - I have 3 tables in mysql in MyISAM table format, I am using mysql4.0 on freebsd5.3 - producttbl, productdetailentbl, pricetblN - they all have "productid" as the Primary KEY....
3
by: Friedman, Jason | last post by:
I have lines that look like this: select column1, 'select' as type from table where column2 = 'foo' I want to return: SELECT column1, 'select' AS type FROM table WHERE column2 = 'foo'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.