Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This Category lists all questions related to PL/SQL programming language
ORA-06550: line , column : PLS-00201: identifier must be declared
ORA-06550: error causes are: You tried to execute an invalid block of PLSQL code (like a stored procedure or function), but a compilation error occurred. in your example, you selected a value inside the variable (v_last) that is not declared in your block. So to correct your block of code, you canRead more
ORA-06550: error causes are: You tried to execute an invalid block of PLSQL code (like a stored procedure or function), but a compilation error occurred.
in your example, you selected a value inside the variable (v_last) that is not declared in your block.
So to correct your block of code, you can rewrite it like this:
How to check and test read/write permissions of Oracle directory?
Check the below query :SELECT * FROM all_tab_privs WHERE table_name = 'your_directory';
Check the below query :
SELECT * FROM all_tab_privs WHERE table_name = ‘your_directory’;
See lessHow to execute multiple procedures simultaneously ?
Hi, Its better you can create different jobs for each procedure and setting their time same to start execution.
Hi,
Its better you can create different jobs for each procedure and setting their time same to start execution.
See lessHow to use COMMIT or ROLLBACK inside database trigger ?
Hi, You can creater a procedure to insert into your test_table_log table with parameter of the columns of thie table. Then on your test_table table trigger call this procedure by passing the values. Commit will be in your calling procedure. So it will work.
Hi,
You can creater a procedure to insert into your test_table_log table with parameter of the columns of thie table.
Then on your test_table table trigger call this procedure by passing the values.
Commit will be in your calling procedure. So it will work.
See lessReturn more than one row from stored procedure in pl/sql
CREATE OR REPLACE PROCEDURE pr_return_multiple_out(p_row_number VARCHAR2) IS CURSOR c0 IS SELECT pol_no, pol_assr_name FROM pgit_policy WHERE ROWNUM <= p_row_number; BEGIN FOR i IN c0 LOOP dbms_output.put_line(i.pol_no||' : '||i.pol_assr_name); END LOOP; EXCEPTION WHEN OTHERS THEN dbms_output.putRead more
CREATE OR REPLACE PROCEDURE pr_return_multiple_out(p_row_number VARCHAR2) IS
CURSOR c0 IS
SELECT pol_no, pol_assr_name FROM pgit_policy WHERE ROWNUM <= p_row_number;
BEGIN
FOR i IN c0 LOOP
dbms_output.put_line(i.pol_no||’ : ‘||i.pol_assr_name);
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLERRM);
END pr_return_multiple_out;
/
—————-Calling by passing number of output we want
BEGIN
See lesspr_return_multiple_out(4);
END;
/
How to INSERT row when only doesn't exist ?
hello albert, as mr. sandeeptiwari mentioned on your question as comment you can use merge statement and here i will share with you sample example for merge and not exists with regular insert statement first we need to create dummy table to test our code on it : CREATE TABLE testtab ( id NUMBER PRIMRead more
hello albert,
as mr. sandeeptiwari mentioned on your question as comment you can use merge statement and here i will share with you sample example for merge and not exists with regular insert statement
first we need to create dummy table to test our code on it :
now we will using not exists clause with regular insert statement but with select like this :
now the result would be :
1 row created.
then trying to execute same statement again and check the result :
0 rows created.
that because the row is already exists before
now we will trying to do the same but in this time we will using merge statement :
now the result would be :
1 row merged.
then trying to execute same statement again and check the result :
0 row merged.
hope this help 🙂
See lessHow to Raise User-Defined Exception and display Custom SQLERRM ?
thanks so much to @Stephan Borsodi for this solution
thanks so much to @Stephan Borsodi for this solution
See lessHow to know number of rows updated by UPDATE statement ?
SQL%ROWCOUNT : return the number of rows fetched/processed by the last DML executed. If the DML fails after fetching 1 row, due to any reason, SQL%ROWCOUNT will return only 1, the number of rows fetched/processed so far basically you can use : BEGIN UPDATE xx_test_tab SET test_col = 777777 WHRead more
SQL%ROWCOUNT : return the number of rows fetched/processed by the last DML executed. If the DML fails after fetching 1 row, due to any reason, SQL%ROWCOUNT will return only 1, the number of rows fetched/processed so far
basically you can use :
hope this help 🙂
See lessCan i use select statement inside if statement ? (if (select) > 0 then) ?
hello Beter, you can't use SQL Statement directly in a PL/SQL expression instead you can use variable to store your count then use your variable into PL/SQL expression like this : DECLARE v_count NUMBER;BEGIN SELECT count (*) INTO v_count FROM dual; IF v_count >= 1 THEN dbms_output.put_liRead more
hello Beter,
you can’t use SQL Statement directly in a PL/SQL expression instead you can use variable to store your count then use your variable into PL/SQL expression like this :
or as you mentioned if you want to use it inside delete statement like this :
hope this helpful 🙂
See lessHow can i convert CLOBS TO VARCHAR2 column ?
hello Beter, you can use dbms_lob.substr( clob_column, for_how_many_bytes, from_which_byte ); and here basic two example : first by using SQL but note the max length is 4000 characters: select dbms_lob.substr( clob_col, 4000, 1 ) from Tablename; second by using PL/SQL max length is 32000 charactersRead more
hello Beter,
you can use
and here basic two example :
first by using SQL but note the max length is 4000 characters:
second by using PL/SQL max length is 32000 characters :
hope this may help.
See lessyou can refer to DBMS_LOB from oracle