Procedural Language/Structured Query Language is Oracle Corporation's procedural language extension for SQL. IBM supports PL/SQL for DB2 since version 9.7. Questions about PL/SQL should probably be tagged "oracle" or "db2" as well.

learn more… | top users | synonyms

0
votes
0answers
50 views

Procedure stuck at a bulk collect

Here's a procedure I'm working on. It's called from another procedure, which uses it in a nested BULK_COLLECT loop on every entry in another table. It gets stuck on "FETCH uniquephysicians BULK ...
3
votes
0answers
61 views

UTL_MATCH.JARO_WINKLER_SIMILARITY - how can I set the prefix scale?

I'm using UTL_MATCH's Jaro Winkler similarity function and it seems to be performing well. However, I would like to adjust the prefix scale according to the situation. Is this possible? Is it possible ...
0
votes
1answer
125 views

Execute immediate call causes 'variable not in select list' error

Execute immediate call causes 'variable not in select list' error hi there, i'm practicing with collections and execute immediate by combining them in plsql and have the following code: set ...
1
vote
2answers
38 views

Recreate all foreign keys in all tables as deferrable (batch)

I want to make all foreign keys in my database deferrable. But there is no possibility to alter an existing constraint. So I need to drop and add again each foreign key. How to do it automatically?
3
votes
2answers
314 views

Pass (comma separated) -yet single parameter to cursor

I have to get selection for a given string (with comma separated values) passed to the cursor. There can be multiple values that could be passed via single variable. My code is somewhat like: CURSOR ...
4
votes
1answer
65 views

Encrypt data with DES_CBC_PKCS5 in DB2

I am using encryption algo DES/CBC/PKCS5Padding. How do I encrypt data using this in DB2? In Pl/SQL I used DBMS_CRYPTO package with DES_CBC_PKCS5 from DBMS_CRYPTO Block Cipher Suites - https://docs....
2
votes
0answers
72 views

Help with query to find intersection between arbitary rows of a table under conditions [closed]

CREATE TABLE "SYSTEM"."SAMPLE" ("E1" VARCHAR2(20 BYTE), "E2" VARCHAR2(20 BYTE), "E3" VARCHAR2(20 BYTE), "E4" VARCHAR2(20 BYTE) ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 ...
0
votes
1answer
138 views

fastest way to generate permutations of a table with n columns and put in a new table added one more question to same how to remove duplicate rows

As i am from mathematics background and require to do some huge permutations to start in my work kind help. If i have a table by name sample1 with n columns what is fastest way to get all the ...
3
votes
2answers
1k views

How to get return value from pl sql procedure and assign it to variable?

Code: execute x.procedurename(row.accc_no, row.bill_no, 0, null, row.total_balance, 'A',assgn_scen_site_cv, :assgn_scen_site_cv); Its my procedure. How to get return value from this proc and ...
0
votes
1answer
68 views

How do I iterate over 1000 records in a particular order

I am writing a procedure to migrate two tables into different tables. This procedure will have two cursors. One to fetch the parent records and then second cursor to fetch the details for each parent ...
2
votes
1answer
93 views

Fill Database With Recursive Factorial Function

I want to calculate table's all of the rows's factorials value. And then i want to insert to each row's factorial value in table. so that i create table like as below: TABLE:FACTORIALS ---------------...
1
vote
2answers
105 views

Split varchar2 variable based on vertical line delimiter

I have following plsql code DECLARE v_personal_info VARCHAR2(100); v_name VARCHAR2(100); v_signature VARCHAR2(100); CURSOR c_personal_info IS select personal_info from users where ...
0
votes
2answers
92 views

PL/SQL block running without printing any output

I'm trying to exexcute a pl/sql block using dbms_output to obtain a console output but without reason the unique answer by SQL developer is 'Anonymous block finished'. declare v_count integer; ...
0
votes
1answer
33 views

Catching Errors in procedure

I have created procedure for orders table. The procedure checks if the order has shipped, then the customer can returns all/part of the shipped items. Once verified by the procedure and the order has ...
0
votes
1answer
34 views

How to pass parameters to delete statement?

While executing this PL/SQL block: CREATE OR REPLACE PROCEDURE procAuth_Title_Delete (auth_ID NUMBER, title_Nos IN NUMBER) IS BEGIN DELETE FROM ...
-1
votes
1answer
512 views

How To Declare Fixed Length String Value In PL/SQL

In PL/SQL strings are declared in two different ways. These ways are fixed-length strings declaration, variable-length strings declaration. If we need to declare a variable-length string, we must ...
1
vote
2answers
53 views

Sync data between 2 databases Oracle 10g

I have 2 databases DB_LIVE and DB_NEW, both have different credentials. I have a Data Read access on DB_LIVE and I am owner of DB_NEW which is a completely blank and raw db provided to me. I want to ...
2
votes
1answer
37 views

Could Not Be Accessed Value Of The For Loop Counter In PL/SQL

I try to learn PL/SQL for loops in tutorials. I learn flow of control in a for loops. (And i saw that it is same with most of the other programming languages) Here is the flow of control in a for ...
0
votes
1answer
587 views

How to call an oracle stored procedure in sql developer tool

I have written an Oracle procedure like below: create or replace procedure Sp_emp(cv_results out sys_refcursor) is begin open cv_results for select * from employee; end; / ...
0
votes
0answers
313 views

PL/SQL to find Special Characters in multiple columns and tables

I am trying to come up with a script that we can use to locate any special characters that may exist in a column of data except for period, dash or underscore, and using variables. My Data - ...
0
votes
2answers
72 views

ORA-01422 Error Occurred When I Call Procedure with Number Parameter

I want to write PL/SQL Procedure that updates salary which is less than 2000. I wrote this procedure.And when i call it with integer id 'ORA-01422: exact fetch returns more than requested number of ...
1
vote
4answers
8k views

grant all privileges of all tables in database to a user

I use oracle 12c. I try to grant all privileges of all tables to a user. And in future I don't need to add any privileges to that user. I need to do this. I don't want to grant system tables to that ...
4
votes
1answer
67 views

How do I set permissions for Package Body

Here's my situation (slightly envaguened to protect the innocent): I have a package on a Test system and a package on Prod system that need to have identical permissions to access exiting packages and ...
0
votes
1answer
715 views

how to call a stored procedure in Oracle Scheduler job

i want to call a stored procedure in Oracle Scheduler job, my procedure and job like below ----stored procedure create or replace PROCEDURE emp_test IS begin delete from emp; insert into emp(...
1
vote
1answer
27 views

What Oracle SQL syntax do I need to find transactions that occurred during time intervals of a day for a period of a year?

I am looking at a transactional-level table for which I need to extract all transactions which occurred between certain hours (between 15:00 and 23:59) of a day for the past year. How can I do this ...
0
votes
0answers
64 views

Oracle scheduler runs only once

I am Oracle 11g User and made a JOB with follow SQL. begin SYS.DBMS_SCHEDULER.create_job( job_name => 'sync_trx' , job_type => 'PLSQL_BLOCK' , job_action => 'begin mv_trx_data(); end;'...
0
votes
1answer
182 views

Getting PL/SQL: ORA-00942: table or view does not exist in plsql function but not from the command view

i have function with a cursor the read the dba_scheduler_jobs which is a view. How can i use a view in a cursor? create or replace function fn_gss_chk_scheduled_jobs(p_key IN varchar2) return ...
2
votes
1answer
62 views

I can't select directly from a table I created

My client created a user in his Oracle instance for me to install the objects I have created in my local instance. However, this strange behavior prevents me to deliver my project. I guess it's a ...
0
votes
1answer
63 views

Prompt user for input using substitution variable

DECLARE localvar char; BEGIN localvar := &ENUMBER; IF localvar ='A' then dbms_output.put_line('Please proceed to Level1'); ELSIF localvar='B' or localvar='C' then dbms_output.put_line('...
1
vote
1answer
198 views

How to write a procedure which is replacement of ON DELETE CASCADE?

I want to make write a procedure which will delete rows from parent table as well as child tables. How to achieve that.? In my case I can not to use on delete cascade (No data model changes). If ...
0
votes
0answers
44 views

PL/SQL follow a Item through a database

Hey I need some help creating a SQL statement for an Oracle DB. The situation: I want to follow a special item through two stations (UWA and KWA) with several steps where it may (!) get cut in up to ...
1
vote
0answers
789 views

How to drop invalid Java classes from Oracle?

I tried to load some jars into my database, but I think I messed up something, because I tried as DBA and then with some oracle user... This was my first command: call dbms_java.loadjava('-genmissing ...
1
vote
1answer
712 views

How to drop java source from Oracle properly?

I'm a little stuck here with my Java Source. First I want completly drop it from the database, because I want to recompile it, but I can't drop is, because if I execute this command: drop java ...
0
votes
1answer
101 views

need to get data from Global Temp Table from db1 to db2 and show the data in Oracle form

I need to get data from Global Temp Table from oracle db1 to db2 and show the data in an Oracle form. In db1, a stored procedure is populating data in the GTT and showing it on Oracle forms as this ...
2
votes
1answer
277 views

SQL query to identify missing hinted indexes

We have a fairly large number of queries using index hints in our 11.2.0.4 database. I recently uncovered some performance issues and found that some of the indexes referenced by the query hints were ...
1
vote
1answer
192 views

Batch for PostgreSQL query

1) The pgpass.conf (of PostgreSQL) is: localhost:5432:*:postgres:mypassword I have no experience with batch and I have spent the day searching in the net. I'm using Windows - if that matters. 2) I ...
1
vote
1answer
44 views

Parsing out date_entered field to capture TIME 'hh:mm:ss' based on time range

Based on the date_entered column, which is a data_type of 'DATE' how would I parse out the data to pull the time. Values in the DATE_ENTERED field (DATA_TYPE is DATE) looks like this 5/15/2015 8:43:...
1
vote
2answers
797 views

Oracle regexp_like square brackets inside character set

This questions is in regards to Oracle, pl/sql, and the regexp_like function. I am trying to build a character set that will match on all typical special characters. My character set currently looks ...
0
votes
0answers
155 views

How to generate a JSON file from stored procedure(SQL) result

I want to get the data from DB using stored procedures in the form of a JSON file. In simple words, my output should be a JSON file which should be the result of data in DB (collected by a stored ...
2
votes
1answer
1k views

Can I exchange partition between two table with partition with same name?

I am trying to restore one partition from a backup table. Both tables have partitions with the same name. My goal is to grab the data from the backup table partition x and put it in original table ...
0
votes
2answers
67 views

Determine if a resultset exists quickly

I want to determine if a resultset exists very quickly. At the moment, I'm doing a count - this is taking roughly 55ms, which is unfeasable.The table has ~100k records - I don't care if it has 2, 5, ...
2
votes
0answers
55 views

Procedure to update tables when the difference of values is less than 10% [closed]

I use Oracle database. I have 2 tables. Table1 with the following details: Table-1 emp.no | salary 1 | 2000 2 | 3000 3 ...
1
vote
0answers
92 views

Whitespace Trimming on Before Trigger in PL/SQL [closed]

I'm looking to create a simple trigger that trims the whitespace on a piece of data prior to it writing to the table. I'm using PL/SQL with Oracle 11g. I am receiving the following error: PLS-...
0
votes
1answer
189 views

Why is my PL/SQL procedure so slow?

I have this sub-procedure in a fairly large program, and it is taking hundreds of times longer than comparable sub-procedures. Is there any way I could improve efficiency here? None of this procedure'...
0
votes
0answers
152 views

Getting milliseconds elapsed during a stored PL/SQL procedure

I've been using sysdate to time procedures, but a lot of my procedures are very small procedures that get called thousands of times. Is there a way to get milliseconds elapsed instead of seconds? I ...
3
votes
2answers
166 views

Stored procedure using cursors [closed]

I am attempting to create a procedure using cursors to list the average salary of all employees on a per department basis. I am using three tables, defined as emp (eid, ename, age, salary) works (...
0
votes
1answer
40 views

PLSQL - getting real-time updates

I want a PL/SQL procedure to give me progress updates as it runs. However, DBMS_OUTPUT seems only to give me the output when the whole procedure is done. Is there a way to make it give me updates ...
0
votes
3answers
289 views

Will an update in my trigger trigger itself? Oracle PLSQL

Here's my PLSQL trigger: CREATE OR REPLACE TRIGGER ROOT_CHANGING_TRG BEFORE UPDATE OF ROOT_ID,PARENT_PHYS_ID ON UNIQUE_PHYSICIAN FOR EACH ROW DECLARE var_root number := :new.ROOT_ID; var_par number ...
0
votes
0answers
191 views

ORA-00933: SQL command not properly ended from function

I created a function but I keep getting the errors ORA-00933: SQL command not properly ended ORA-06512: at "FCUBSPROD.FN_GSS_UNPROCESSED_TXNS", line 110 ORA-06512: at line 11 when I try to run it. ...
0
votes
1answer
932 views

How to create scheduler for manually refresh Materialized View if the MV get need_compile stallness status

I've a problem to Automatically Refresh Materialized View, if the stallness condition is NEED_COMPILE / STALE / UNUSABLE OR NOT FRESH. I've MV with this PL/SQL : CREATE MATERIALIZED VIEW "...