What is the difference between executing query statements using 'execute' and directy in PL and SQL?
-
st :='SELECT USERNAME FROM LOGIN WHERE USERNAME =: a and PASSWORD =: b'; execute immediate st into un using username,pw; - or - SELECT USERNAME INTO un FROM LOGIN WHERE USERNAME = username and PASSWORD = pw; where username, un and pw are varchar2(50) variables
-
Answer:
You can dynamically build a statement string and execute it with EXECUTE statement. When you directly call SELECT .. INTO from PLSQL, such query must be valid at compile time. For example, you can dynamically create a table via EXECUTE, and select from it using EXECUTE again. SELECT .. INTO would fail in this case, as the dynamically created table does not exist yet.
Mustafa Kirac at Quora Visit the source
Other answers
Execute immediate uses late binding..All binding checks done at run time, syntatic n symentic aswell. Early binding otherwise.
Tushar Badyal
Related Q & A:
- What Is The Difference Between Magicjack And Magicjack Plus?Best solution by Yahoo! Answers
- what is the difference between sum of first n primes and prime(prime(n?Best solution by Mathematics
- What is the Hibernate or Criteria query for sql?Best solution by Stack Overflow
- What are the advantages and the disadvantages of using fossil fuels?Best solution by Yahoo! Answers
- What's the difference between Current (I) and Potential Difference (V?Best solution by diffen.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.