Go How does I use the variables in Oracle SQL Developer?

Source: Internet
Author: User

This article transferred from: Http://stackoverflow.com/questions/5653423/how-do-i-use-variables-in-oracle-sql-developer

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

DECLARE @EmpIDVar INTSET @EmpIDVar = 1234SELECT *FROM EmployeesWHERE EmployeeID = @EmpIDVar

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

You can read up elsewhere on substitution variables;  They ' re quite handy in SQL Developer.  But I had fits trying to use bind variables in SQL Developer. What I do:

SET SERVEROUTPUT ONdeclare  v_testnum number;  v_teststring varchar2(1000);begin   v_testnum := 2;   DBMS_OUTPUT.put_line(‘v_testnum is now ‘ || v_testnum);   select 36,‘hello world‘   INTO v_testnum, v_teststring   from dual;   DBMS_OUTPUT.put_line(‘v_testnum is now ‘ || v_testnum);   DBMS_OUTPUT.put_line(‘v_teststring is ‘ || v_teststring);end;

SET SERVEROUTPUT ONMakes it so text can is printed to the script output console.

Go How does I use the variables in Oracle SQL Developer?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.