All Questions
22 questions
-1
votes
2
answers
165
views
Create Fucntion returning Table in pl/sql
TEMP table:
Node
Curr_Cnt
Prev_Cnt
Diff
First
20
40
20
Second
30
70
40
CREATE OR REPLACE FUNCTION NEW_FUNCTION
RETURNS table
IS
c_rec TEMP%ROWTYPE;
TYPE c_tab IS TABLE OF c_rec%TYPE INDEX BY ...
0
votes
1
answer
199
views
Function to return a specific thing from a procedure that are in the same package [closed]
I have a procedure that calculates the minimum and the maximum number of 2 numbers and I need to write a function that will return the minimum number from the procedure and another function that will ...
1
vote
3
answers
2k
views
Return updated rows from a stored function
Im trying to select some rows from a Table in ORACLE and at the same time update the selected rows state. I found a way to do so with a stored function and Cursors but I cant manage to return the rows ...
3
votes
2
answers
928
views
Can I return a function in PL/SQL?
I am trying to return a function in PL/SQL. Can I do so?
FUNCTION my_func () RETURN VARCHAR2 AS
BEGIN
RETURN 'any other function'
END;
3
votes
2
answers
10k
views
Is having RefCursor as an OUT parameter of a Postgresql function, allowed?
I know the following is possible. i.e I can have a ref cursor as a return value in Postgresql.
CREATE FUNCTION employeefunc(int) RETURNS refcursor AS '
DECLARE ref refcursor;
BEGIN
OPEN ref FOR ...
1
vote
1
answer
2k
views
How to call a function in a cursor, which is a part of another procedure in oracle
I have a stored procedure like this
create or replace procedure A is
procedure a1 is
......
end;
procedure a2 is
cursor c1 as
select a,b,(select f1(x,y) var_temp from dual)data from ...
0
votes
1
answer
1k
views
ORACLE PL/SQL: Calling stored procedure function with multiple parameters (DML query)
New PL/SQL person here. I have a (successfully compiled) PL/SQL function block that manipulates a table in my database by adding a new term to it:
create or replace FUNCTION add_new_term
(...
0
votes
2
answers
139
views
Is there any way to keep a track of rows inserted by a oracle function in database
I have a procedure to update the balance from start date to end date and
also I want to keep a track of number of records being inserted . I am using dbms_output.put_line to get the number of ...
1
vote
1
answer
131
views
How to call a stored function from a stored procedure and store the return value
When I do this in my stored procedure:
create procedure Proc1(
startdate IN TIMESTAMP,
ENDDATE IN TIMESTAMP
)
declare test_result number --line 55
test_result:=...
1
vote
2
answers
3k
views
Oracle stored function - pass table name as parameter
I'm trying to create a stored function in Oracle that will count the table rows..i want to make the table name dynamic, so i passed it as a parameter, the stored function code looks like this
create ...
0
votes
1
answer
606
views
pl/sql stored function ora-01002 fetch out of sequence SIMPLE
Sorry if this has been asked before but I couldn't find it searching through the site.
I have written the following stored function for an oracle DB with the variable names changes to be easier to ...
0
votes
1
answer
246
views
PLSQL call procedure from function
I have a function which is called from a select query, below is the function which works perfect. I want to call the procedure below if boolean = 1 that inserts values into the login table:
create or ...
0
votes
1
answer
2k
views
Oracle PL/SQL > Stored Procedure Hanging Indefinitely [closed]
I'm in the business side of the house and do not have full DBA privileges to our Oracle 11g database. I have the privileges necessary to build and run stored procedures and I have one that is hanging ...
70
votes
7
answers
130k
views
Functions vs procedures in Oracle
What is the main difference between functions and procedures in Oracle?
Why must I use procedures if I can do everything with functions?
If I cannot call procedure in sql statement, ok, I'll write a ...
1
vote
2
answers
3k
views
ORACLE PL/SQL Variable Function Scope - Need Explanation
I just tripped over an answer to a problem I was having with a PL/SQL variable not being recognized by a function and I was hoping someone could explain to me why my solution worked and what is ...