Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use binding variables in SQL Developer

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to use binding variables in SQL Developer. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Toad is a powerful tool, but now they all advocate copyright protection, so tearfully uninstall Toad. And installed an Oracle SQL Developer. At first glance, there is a big gap between SQL Developer and Toad, but it also has its own features, such as real-time SQL monitoring.

But when it comes to using bound variables, it's hard to use. For example, we need to do the following query:

SELECT * FROM T1 WHERE NAME =: NM

Typing the above statement in the SQL worksheet, and then executing it, pops up a dialog box for entering binding variables:

You can see that the input of the bound variable is very simple, and there is no choice of variable type, so enter the string 'Emma',' as usual, but the result is empty:

There is obviously this data. What's going on? Look at the font of the quotation marks in the input box is a little awkward, and then remove the quotation marks to try, oh, really OK. If it is really the problem of quotation marks, it seems that quotation marks are also used as data input. For variables of type DATE, as in SQL*Plus, the DATE type cannot be used directly:

Reported an error in ORA-01841, changed it to a string and executed normally:

So pay attention to the date format here (can be set in tools-preferences-Database-NLS)

This is the end of this article on "how to use binding variables in SQL Developer". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report