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

2
votes
1answer
46 views

How to compare dates on minute level in plsql?

If I'm correct, then date comparison on seconds level is as simple as SELECT 1 FROM sample_table WHERE sysdate <= sample_table_date_field; but haven't found any simple or stable solution for ...
-3
votes
1answer
70 views

Problem with procedure in plsql [on hold]

Create a stored procedure called UPD_JOBSAL to update the minimum and maximum salaries for a specific job ID in the JOBS table. The procedure should provide three parameters: the job ID, a new ...
1
vote
2answers
52 views

Serialize :new in trigger

I have a trigger that needs to create an Oracle Advanced queue message. The payload of that message should contain the new record that was created, that is accessible via :new. What I am looking for ...
-1
votes
1answer
37 views

function execution related question

Create or replace function funleap(a number) return varchar2 is b2 number(5); b3 number(5); b4 number(5); begin b2:=mod(a,4); b3:=mod(a,100); b4:=mod(a,400); if ((b2=0 and ...
-1
votes
2answers
29 views

In out parameter : how to execute [closed]

Create or replace procedure sma11( a in number ,b1 out varchar2) is begin b1:=mod(&a,2); if b1=0 then dbms_output.put_line('b1'||'is even'); else ...
0
votes
1answer
40 views

function return data type?

create or replace function Total_sal return varchar2 is Total number; begin select sum(salary)into total from employees; return total; end; / BEGIN DBMS_OUTPUT.PUT_LINE(TOTAL_SAL); END; ...
-1
votes
1answer
35 views

how to execute this basic parameter

how to execute this one in plsql.. create or replace procedure p11(a in number, b out number) is begin b:=a*a; dbms_output.put_line(b); end; variable a number; variable b number; what statement I ...
1
vote
1answer
38 views

/ Character in a stored procedure

I am trying to recompile/update a stored procedure in SQL Developer that uses a few division operations to populate tables. A sample section looks like this: Insert Into Production(A, B, C) ...
-2
votes
1answer
26 views

plsql block not executing

I am unable to execute this block. it just compiles. what statement I have togive to see output. where I am doing error ? I clicked on output button also
0
votes
1answer
16 views

OR-01422 ORA-06512

Can someone help to solve this error? I couldn't write pl/sql query of this .thanks. spool 150OMGIddl.sql declare c clob; begin SELECT ...
0
votes
0answers
29 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
26 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
39 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
25 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
75 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
41 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 - ...
3
votes
0answers
66 views

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

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 ...
2
votes
1answer
72 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
57 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
32 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
81 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
35 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
35 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
30 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
18 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
163 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
44 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
22 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
67 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
25 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
42 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
528 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
41 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
76 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 ...
1
vote
1answer
24 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
40 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(); ...
0
votes
1answer
57 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
55 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
41 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 ...
1
vote
1answer
141 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
42 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 ...
0
votes
0answers
302 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
208 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
53 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
148 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
95 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) ...
1
vote
1answer
38 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 ...
1
vote
2answers
323 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
101 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
503 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 ...