Skip to content

Tag: plsql

TO_NUMBER() Function In Oracle Behaves Differently

I have string variables and these variables differ in length. Let’s assume that I have the following strings: I want to convert my string variables to float. So, to do that, I call TO_NUMBER() function. The problem is when I call TO_NUMBER() function from my .NET web application instead of calling it di…

ORA-06502: PL/SQL: numeric or value error when concatenating

I am getting error as numeric or value error Answer The problem is with operator precedence: Oracle evaluates operators with equal precedence from left to right within an expression. … and as the table shows + and || have equal precedence. So in this statement: this is interpreted as ‘sum = &#8216…

Difference between Global temporary table (GTT) and collections

I wanted to know the difference between GTT and collections with scenarios where to use GTT and where to use collections. Answer Global Temporary Tables are permanent data structures. We can manipulate data in a GTT using SQL like any other table. What distinguishes them from regular heap tables is: Their dat…

PL/SQL procedure not compiling

I have a PL/SQL procedure that is not compiling. The errors are: Error(3,7): PLS-00103: Encountered the symbol “INTO” when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted deli…

Passing Multiple Values To PL/SQL Input

I have an Oracle package which contains a function. This function has 3 inputs. I need to pass multiple values to each input. I could automate a process which runs it multiple times with each combination of variables but I would like to only make one call to the database. Simplified Code Answer Pass it with q…