Skip to content
Advertisement

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 directly within pl/sql block, it gives me an

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 = ‘|| a which gives you a string, then <result

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 data is transient, and only persists for the duration

PL/SQL No data found even there should be?

I’m currently learning PL/SQL atm and I have run into an issue with one of my homework questions. In the below code, I’m getting user input for a province and isolating select results using said province in the declaration of the cursor and trying to run the visitsandtotal procedure but all I’m getting is no data found, why? user prompt

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 delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback

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 quoted string (Q'<delimeter><your_actual_string><delimeter>’) as

Advertisement