Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

Below is an example of using variables in SQL Server 2000.

DECLARE @EmpIDVar INT

SET @EmpIDVar = 1234

SELECT *

FROM Employees

WHERE EmployeeID = @EmpIDVar

I want to do the exact same thing in Oracle using SQL Developer without additional complexity. It seems like a very simple thing to do, but I can't find a simple solution. How can I do it?

1 Answer

0 votes
by (40.7k points)
edited by

If you are using the SQL-Developer in Version 3.2 then use the below code:

define value1 = 'sysdate'

SELECT &&value1 from dual;

Note: If you are omitting the "define"-part then you'll be prompted for that value.

If you wish to learn what is SQL then visit this best online SQL course.

Related questions

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...