tagged [plsql]

Get a list of all functions and procedures in an Oracle database

Get a list of all functions and procedures in an Oracle database I'm comparing three Oracle schemas. I want to get a list of all the functions and procedures used in each database. Is this possible vi...

19 Sep at 15:0

Oracle SQL: Use sequence in insert with Select Statement

Oracle SQL: Use sequence in insert with Select Statement Basically I want to run the following query: ``` INSERT INTO historical_car_stats (historical_car_stats_id, year, month, make, model, region, a...

2 Feb at 05:7

Sleep function in ORACLE

Sleep function in ORACLE I need execute an SQL query in ORACLE it takes a certain amount of time. So I wrote this function: and I call in this way ``` SELECT TEST_SLEEP(10.5

2 Mar at 21:21

Query performance difference pl/sql forall insert and plain SQL insert

Query performance difference pl/sql forall insert and plain SQL insert We have been using temporary table to store intermediate results in pl/sql Stored procedure. Could anyone tell if there is a perf...

20 Apr at 05:34

C#: Oracle Data Type Equivalence with OracleDbType

C#: Oracle Data Type Equivalence with OracleDbType --- ## Situation: I am creating an app in C# that uses Oracle.DataAccess.Client (11g) to do certain operations on a Oracle database with stored proce...

17 Oct at 21:45

Convert varchar2 to Date ('MM/DD/YYYY') in PL/SQL

Convert varchar2 to Date ('MM/DD/YYYY') in PL/SQL I need to convert string from varchar to Date in 'MM/DD/YYYY' format. My input string is '4/9/2013' and my expected output is '04/09/2013'. i.e. 2 dig...

2 May at 19:29

Default Values to Stored Procedure in Oracle

Default Values to Stored Procedure in Oracle I have a `stored procedure` as follows. When I execute the above procedure It will print `X--Y`. The input parameters are not defaulting to the speci

ORA-01438: value larger than specified precision allows for this column

ORA-01438: value larger than specified precision allows for this column We get sometimes the following error from our partner's database: The full response looks like the following: ``` ORA-01438: v...

21 Dec at 13:34

Splitting string into multiple rows in Oracle

Splitting string into multiple rows in Oracle I know this has been answered to some degree with PHP and MYSQL, but I was wondering if someone could teach me the simplest approach to splitting a string...

24 Dec at 10:17

Oracle Error ORA-06512

Oracle Error ORA-06512 Just can't figure out why it gives me ORA-06512 Error ``` PROCEDURE PX(pNum INT,pIdM INT,pCv VARCHAR2,pSup FLOAT) AS vSOME_EX EXCEPTION; BEGIN IF ((pNum 14)) THEN RAIS...

ORA-06508: PL/SQL: could not find program unit being called

ORA-06508: PL/SQL: could not find program unit being called I am using oracle 10g and toad 11.5. I am trying to call an api from an anonymous block. If I recompile the api after adding `dbms_output.pu...

7 Jan at 10:8

How to Run the Procedure?

How to Run the Procedure? Here the Package.. Let's consider the PROC.. ``` Create procedure gokul_proc( pId in number, pName in varchar2, OutCur OUT G_PKG_REFCUR.rcDataCursor ) is BEGIN Open O...

29 Oct at 11:31

Selecting Values from Oracle Table Variable / Array?

Selecting Values from Oracle Table Variable / Array? Following on from my last question ([Table Variables in Oracle PL/SQL?](https://stackoverflow.com/questions/1573326/table-variables-in-oracle-pl-sq...

23 May at 12:1

PL/SQL print out ref cursor returned by a stored procedure

PL/SQL print out ref cursor returned by a stored procedure How can I fetch from a ref cursor that is returned from a stored procedure (OUT variable) and print the resulting rows to STDOUT in SQL*PLUS?...

22 Dec at 22:34

Passing an array of data as an input parameter to an Oracle procedure

Passing an array of data as an input parameter to an Oracle procedure I'm trying to pass an array of (`varchar`) data into an Oracle procedure. The Oracle procedure would be either called from SQL*Plu...

21 May at 21:5

PL/SQL ORA-01422: exact fetch returns more than requested number of rows

PL/SQL ORA-01422: exact fetch returns more than requested number of rows I get keep getting this error I can't figure out what is wrong. > DECLARE * ERROR at line 1: ORA-01422: exact fetch returns ...

20 Aug at 18:11

collapsing NULL values in Oracle query

collapsing NULL values in Oracle query I often write queries wherein I pivot data and end up with NULL values that I want to collapse. E.g. data like the following: I then do an outer query like so: `...

18 Nov at 20:12

Running pl/sql in Korn Shell(AIX)

Running pl/sql in Korn Shell(AIX) I have a file to execute in Ksh written by someone. It has a set of commands to execute in sqlplus. It starts with, ``` sqlplus -s $UP

31 May at 09:31

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

ORA-06502: PL/SQL: numeric or value error: character string buffer too small I tried the following code different ways, like by taking out the while or the if, but when I put both together (if and whi...

Select * from Table and still perform some function on a single named column

Select * from Table and still perform some function on a single named column I'd like to be able to return all columns in a table or in the resulting table of a join and still be able to transform a d...

12 Mar at 16:9

Printing the value of a variable in SQL Developer

Printing the value of a variable in SQL Developer I wanted to print the value of a particular variable which is inside an anonymous block. I am using Oracle SQL Developer. I tried using `dbms_output.p...

25 Oct at 09:44

PL/SQL block problem: No data found error

PL/SQL block problem: No data found error ``` SET SERVEROUTPUT ON DECLARE v_student_id NUMBER := &sv_student_id; v_section_id NUMBER := 89; v_final_grade NUMBER; v_letter_grade CHAR(1); BEGIN ...

5 Sep at 13:46

How to select into a variable in PL/SQL when the result might be null?

How to select into a variable in PL/SQL when the result might be null? Is there a way in to just run a query once to select into a variable, considering that the query might return nothing, then in th...

23 Aug at 16:28

Create an Oracle function that returns a table

Create an Oracle function that returns a table I'm trying to create a function in package that returns a table. I hope to call the function once in the package, but be able to re-use its data mulitple...

13 May at 19:58

UTL_FILE.FOPEN() procedure not accepting path for directory?

UTL_FILE.FOPEN() procedure not accepting path for directory? I am trying to write in a file stored in c:\ drive named vin1.txt and getting this error .Please suggest! HERE is the code

2 May at 13:0