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
get number of days between two dates column in oracle sql?
Hi, Like this we can use: SELECT pol_fm_dt, pol_to_dt, ROUND(pol_to_dt - pol_fm_dt) FROM pgit_policy;
Hi, Like this we can use:
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 lessHow 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 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 create dynamic tables ,columns, and datatype for each column in oracle ?
hello @Tiwari Sandeep what i meant is i want create table at run time like create table tablename (col1 varchar2(50), col2 number); actually we can do this by dynamic SQL but it's unfortunately not recommended by oracle because this will open a loophole for hackers by (SQL INJECTION) if you have anyRead more
hello @Tiwari Sandeep what i meant is i want create table at run time like
actually we can do this by dynamic SQL but it’s unfortunately not recommended by oracle because this will open a loophole for hackers by (SQL INJECTION) if you have any idea to avoid this will be very appreciated
thank you for your reply.
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 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 :
set define off insert into table values ('& yourvalues');and then press ‘F5’ to execute the above commands.
See lessalso from sqlplus you can use this :
set define off