Questions tagged [plsql]

PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural language extension for SQL. Questions about PL/SQL should probably be tagged "oracle" as well. Questions with regular DML or DDL statements should be tagged with "sql" and "oracle", NOT with "plsql".

Filter by
Sorted by
Tagged with
-1 votes
0 answers
12 views

I have these errors : PL/SQL: SQL Statement ignored, SQL command not properly ended [closed]

I am trying to realize this problem: Create stored procedure which will print the most purchased product (as raw material for pizzeria). From which it will print the name of that product, the purchase ...
-1 votes
1 answer
12 views

Getting error while executing Day Light script

select TO_TIMESTAMP_TZ('2023-03-26 02:00:00.000000000 EUROPE/BERLIN','YYYY-MM-DD HH24:MI:SS.FF TZR') from dual; getting error: ORA-01878: specified field not found in datetime or interval select ...
0 votes
2 answers
29 views

Invalid character in plsql

Here, when i execute this query it is showing me invalid character. how to solve is error. EXECUTE IMMEDIATE('SELECT COUNT(*) INTO' ||VAR_L_COUNT||'FROM'|| P_TABLE || ' WHERE ' ||...
0 votes
0 answers
25 views

Process csv file of 222008k lines inserted in an Oracle table using PLSQL

I have a zip file into table in blob column: I have created a procedure which performs the following steps: Get file corresponding to process in progress Get list of files inside zip file Loop to ...
-2 votes
0 answers
14 views

PLSQL Word Count [closed]

I have a table called spamham and it has a column labeled messages. I have been trying to sort through each message, and return a word count with the 10 most used words, and their respective count. I ...
-1 votes
0 answers
39 views

Facing issues while inserting a row in a table when joins with other tables

My main table: CREATE TABLE MONDB.RF_TBL ( RF_SK NUMBER, RF_TYPE VARCHAR2(25), RF_DESC VARCHAR2(25) ); INSERT INTO MONDB.RF_TBL VALUES (111, 'AAA', 'CAR'); INSERT INTO MONDB.RF_TBL ...
  • 9
0 votes
1 answer
30 views

CREATE VIEW inside a PROCEDURE in ORACLE

Basically I want create a view that depends on a input. This code compile without problems CREATE OR REPLACE PROCEDURE pr_photo_city (input COUNTRY.City%TYPE) IS command VARCHAR2(2000) := 'CREATE VIEW ...
0 votes
2 answers
30 views

Why is this code for Oracle Database not working?

In my case functions PROCESS_OPERATOR and PROCESS_WHERE calls each other, but this code is compiled with errors CREATE OR REPLACE FUNCTION PROCESS_OPERATOR ( p_operator IN VARCHAR2 ) RETURN VARCHAR2 ...
0 votes
1 answer
24 views

find session created a job in Oracle

Is there a way from a job running by dbms_schedulet to identify a sid of the session created this job? For instance, session A creates a job B. from B I need to find out sid of A. No params, no ...
  • 1,978
0 votes
0 answers
25 views

Oracle PL/SQL HTTP request response strange characters

I am using the Fedex API for rating and when I try to get the response of the json I get very strange characters in the response for exmaple. ¿ m¿QO¿0¿¿> :¿ ¿¿¿¿P¿@¿¿E]¿}w¿¿o¿¿¿~w¿¿¿I¿+¿...
  • 5
0 votes
2 answers
27 views

Specifying comma separated value in IN clause

I have written the following PL/SQL code in Oracle: declare l_today date := sysdate; company varchar2(30):='info'; howmany INTEGER; params varchar2(10000):= 'color-1,color-2'; ...
  • 1
0 votes
2 answers
26 views

Trim the data after special character

I want output as like below, Current Output: INDIA-001 UNIT1-RUNNING, AUSTRIA-002 UNIT2-RUNNING, CHINA-003 UNIT1-RUNNING , JAPAN-004 UNIT2-ONHOLD., Expected Output: INDIA,AUSTRIA,CHINA,JAPAN
0 votes
0 answers
29 views

How optimize For Each with Select statement to process millions of rows in Oracle PL/SQL

I have a CSV file with 2,000,000 records inserted into a table (blob column). I tried to create the following block: DECLARE v_doc BLOB; v_file_content CLOB; ...
1 vote
2 answers
41 views

Get date where RESULT is processed

I have the below table. In the above table I need the New Date populated based on the Comments, Date, RESULT columns. I need the dates populated only for the PROCESSED Result columns. So in the above ...
0 votes
2 answers
27 views

How to create Ref Cursor type which can be stored in Oracle DB

I want to create a ref cursor type in database, so that I can declare variables of this type in sql developer command window using following statement : variable PO_Ref_Csr_Out RefCursorTyp; In the ...
0 votes
0 answers
27 views

Removing a record from a bulk collection in plsql

I loop through a set of transactions and bulk collect the transaction ids to a variable. After that there is a part that I have to check for some conditions. If it fails for one transaction I want to ...
  • 351
1 vote
0 answers
33 views

How can I get the column names returned by a query? [duplicate]

I'm looking for some way to generically determine what column names will be returned from a query. I've Googled around a bit, and all the answers I find are for determining the names of columns ...
  • 439
0 votes
1 answer
19 views

Using a page item inside a PL/SQL function body that returns an SQL Query

I am trying to create source code for a list view region that will pick a different table based on the values of page items passed to that page in oracle apex. Whenever I hard code values for these ...
  • 1
0 votes
0 answers
33 views

Procedure fails within a job but works when called manually [closed]

There is a procedure that is called without any arguments, say IMPORT_XLSX. It reads xlsx files from the system (windows) and inserts them to the database, it contains some numeric values that can ...
1 vote
2 answers
32 views

configurable FETCH FIRST n ROWS ONLY (retrieve 1, n, or all rows)?

Is there a way to make a select statement retrieves ALL the rows when the clause FETCH FIRST n ROWS ONLY is used? say I have the function: function fill_ids_array(n in number default 1) is begin ...
0 votes
0 answers
35 views

Issues using PL/SQL function body to generate a sql script

I am currently trying to create a list view that pulls the records from a different table depending on different information. I figured the best way to do this would be to use a PL/SQL function body ...
  • 1
0 votes
2 answers
49 views

Accepting conditional input for PLSQL

Using Oracle SQL in SQL Developer: I am trying to package together a couple queries my team uses to lookup information to verify with. I have a query that returns a bunch of information on a given ...
  • 3
0 votes
1 answer
31 views

Loading data from csv file into oracle database

I want to load data from a csv file into a table in the oracle database using external tables or plsql. please considere that i connect remotly to the database using sql* plus. I have read that to use ...
0 votes
2 answers
46 views

SELECT isn't storing data in PL/SQL variables

Okay so once again I did a script in which I need to store some data into PL/SQL variables. Now for some reason I can't store said data. I tried the query by itself without INTO statement to prove if ...
-6 votes
0 answers
31 views

Why do i need to add the user name to query the table under the same user? [closed]

enter image description here I can only query if I add a username!
-1 votes
1 answer
19 views

Preparing script for updating different values through view and running it in server side

I have an update statement: Update xxbl_conducting_section_v set volatge=11000, drawing_id=123 where spid in (23, 11,22) I need to run this script in nohup(server side for different voltages and ...
1 vote
2 answers
56 views

Why is it that when filtering by two collections, the execution time increases significantly and the query takes a very long time?

Given: A table with 6 million records. We need to collect some statistics for the quarter. 650 thousand lines fall into the quarter. The data filtering parameters come into the procedure. Some of ...
  • 492
1 vote
1 answer
24 views

Parameter passing to a function which return Index By Table value

I have following an example in a pl/sql document (PL/SQL User's Guide and Reference) 1 DECLARE 2 TYPE sum_multiples IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER; 3 n PLS_INTEGER := 5; -- number ...
-1 votes
0 answers
30 views

"io error: an established connection was aborted by the software in your host machine" while running in sql developer

Im basically executing a procedure in sql developer using bompxinq.exploder_userexit api. where I'm retriving data from Bom_small_expl_temp to custom table. I tried to hard code for 1 Item id and it ...
0 votes
1 answer
19 views

Invalid number when the input is the right one and the table definition is also the right one?

So I'm doing this script and at some point it worked. But I had to do it with bind variables so some of it changed. Once I did the changes and applied the bind variables isn't working anymore and it ...
0 votes
1 answer
34 views

ORA-040901 - Table is mutating,trigger/function PLSQL

I execute "MERGE" to be able to insert all those values ​​that don't match my MST_PRO table but originally it has a trigger that when entering a new record takes the last value generated to ...
  • 101
-1 votes
0 answers
21 views

Need a procedure with bulk collect/forALL concept to receive bulk data/multiple values at a time from the Application

for example, here I wrote a small program to insert bulk data from employees table to EMP_temp table(which I created for testing): DECLARE TYPE emp_rec IS RECORD ( r_employee_id NUMBER(6),...
0 votes
1 answer
21 views

Oracle Error trying to Create Range Partitioned Table

I am trying to create a partitioned table in Oracle 19c. create table tab1 ( id number(10), sale_date date ) partition by range ( sale_date ) ( partition p1 values less than ( ...
  • 531
1 vote
1 answer
28 views

removing all special characters from an email address

I have an email column in the table, and I am trying to remove all special characters before "@". If there's a "+" sign I want to remove everything after the "+" sign ...
0 votes
1 answer
18 views

PL SQL procedure to print all materialized views giving error

I want to create a simple procedure that lists all the materialized views from the system and prints the status of those views in a tabular format. When I execute the below procedure, it gives me ...
0 votes
1 answer
27 views

Issue with running a DB2 Script from DataStage Job

I have a DB2 script as below - BEGIN DECLARE var1 INTEGER; DECLARE var2 INTEGER; SET var1=<<value1>>; SET var2=<<value2>>; BEGIN WHILE (var1 <= var2) ...
0 votes
0 answers
12 views

Get SAML claims in Oracle Apex

I'm using SAML sign in an Oracle apex application. Authentication is working, and username is getting set to my email ID. I'm trying to retrieve other claims from the SAML response like given name, ...
0 votes
0 answers
25 views

Call an oracle function from laravel controller

I have a function in my database that I want call from a Laravel controller (PHP) using PL/SQL. The problem is that I get an error that says: "the identifier 'COPY_USER' must be declared ORA-...
0 votes
2 answers
42 views

In oracle PLSQL how can I update every row based on a join to another table?

I've been fighting with this for hours. I essentially have a table, Cats, and I want to update every cat in the table to be called Mr <Name>. So insert Mr before. I can do that pretty easily. ...
  • 50.5k
0 votes
2 answers
39 views

Date in the PL/SQL

I have a procedure that takes two parameters (from and to dates - ie. 2022-03-01 - 2022-03-12). What I need to do is on the second insert if there is same date inserted twice, it should not be shown ...
  • 11
0 votes
3 answers
34 views

how to compare the data of two tables and fetch the unmatched records in plsql

table 1 col1 col2 col3 1 2 3 4 5 6 table 2 col1 col2 col3 1 2 3 4 5 7 how to fetch the table 2 second row record which is mismatch in plsql, how to write query in plsql if both tables have ...
  • 37
0 votes
1 answer
37 views

execute trigger conditionally user Oracle

I want to condition the execution of the trigger to the oracle user. If it is the Oracle user : X, then do not execute the trigger otherwise yes. I created a function CREATE OR REPLACE FUNCTION ...
  • 5
0 votes
1 answer
21 views

Create a trigger in SQL that doesn't allow (or deletes) certain special characters like: $, @, ?, #, & and etc

I've been trying to create a trigger that when receives an special character either doesn't allow the insert or delete the character, this being aplied to characters like (!, @, $, %, &, *, ?, <...
0 votes
1 answer
44 views

ORA-01001: invalid cursor error in Dev environment

I'm facing a strange issue in my oracle-cloud dev environment. When I try to execute the stored proc, it gives me ORA-01001: Invalid cursor error in the dev environment. However, the same block runs ...
0 votes
2 answers
44 views

Delete the duplicate order number query

I have a question about deleting 2 duplicate numbers in my system. The issue is when the user creates an order and doubles by clicking the "Submit" button. The system makes 2 orders with the ...
0 votes
3 answers
55 views

PL/SQL join Package functions results with another select statement results

I have a select statement which is as follows SELECT PLN.PLAN_NAME, HON.IVC_CODE, HON.FORENAME, HON.SURNAME, HON.SALUTATION FROM PLANS PLN INNER JOIN COMPANIES COMP ON ...
  • 157
0 votes
1 answer
31 views

How to refresh only updated records in Materialized View without Fast refresh method that oracle gives (Without MV log )?

I have to create Materialized View (MV) on few source tables. Since records count is huge, we want to refresh it in incremental way i.e. refresh only those records which are updated. But, source ...
  • 1
0 votes
1 answer
27 views

Compilation aborted when trying to create object type on Oracle live SQL

I am running the following code on Oracle live SQL but I am getting compilation aborted error and I can't figure out what's casing the issue. Any ideas? CREATE TYPE AppointmentType AS OBJECT ( ...
  • 11
-1 votes
1 answer
26 views

Execute package but [SQL Errm]ORA-20010/ETL Batch Process MYSCHEMA.FUND_PKG.LOAD_FUND failed. [Error Stack]ORA-20010: [ERROR] ETL Batch Process failed

I'm trying to execute a package which is source code so should have no errors since this runs consistently. I have made sure schema is correct and that data for parameters being passed are available ...
0 votes
2 answers
33 views

SQL Query, Create new column instead a new row SQL Oracle

i try create a query to get all products and your repectives dates and packs: SELECT p.id, d.date, pc.pack FROM Products p LEFT JOIN Dates d ON p.id = d.id LEFT JOIN Packs pc ON p.id = pc.id; Result:...

1
2 3 4 5
564