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 all different kind of databases
How 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 lessis there oracle function to remove spaces in the string ?
hi albert, try this : select replace('Oracle Forms 10G', chr(32), '') from dual; hope this help.
hi albert,
try this :
hope this help.
See lesshow to create dynamic tables ,columns, and datatype for each column in oracle ?
@Hassan AbdElrahman Can you please explain problem in detail?
@Hassan AbdElrahman Can you please explain problem in detail?
See lessHow to Raise User-Defined Exception and display Custom SQLERRM ?
you can do this by using : RAISE_APPLICATION_ERROR function and here simple example for you : DECLARE custom_ex EXCEPTION; PRAGMA EXCEPTION_INIT (custom_ex, -20001); BEGIN raise_application_error (-20001, 'Your custom error message here'); EXCEPTION WHEN custom_ex THEN dbms_output.put_line (sqlerrm)Read more
you can do this by using : RAISE_APPLICATION_ERROR function and here simple example for you :
the output would be : ” ORA-20001: Your custom error message here ” .
See lesshope this help 🙂
How 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 to Insert data include symbol '&' into a table ?
it's very simple just using this : set define off insert into table values ('& yourvalues'); and then press 'F5' to execute the above commands. also from sqlplus you can use this : set define off
it’s very simple just using this :
and then press ‘F5’ to execute the above commands.
See lessalso from sqlplus you can use this :
set define off