Sign Up

Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In
Continue with Google
or use


Have an account? Sign In Now

Sign In

Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.

Sign Up Here
Continue with Google
or use

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Continue with Google
or use

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have permission to add post.

Continue with Google
or use

Forgot Password?

Need An Account, Sign Up Here

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.

Oraask Logo Oraask Logo
Sign InSign Up

Oraask

  • Write
    • Add A New Post
    • Ask A Question

Oraask Navigation

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
    • Oraask XML Formatter
    • Oraask JSON Formatter
  • Wiki
    • SQL Tutorials
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials

Database

This Category lists all questions related to all different kind of databases

Share
  • Facebook
0 Followers
0 Answers
150 Questions
Home/Database/Page 7
  • Recent Questions
  • Answers
  • No Answers
  1. Asked: June 14, 2016In: Oracle SQL

    get number of days between two dates column in oracle sql?

    ashishpandey
    ashishpandey Explorer
    Added an answer on March 27, 2017 at 7:06 am
    This answer was edited.

    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:

    SELECT pol_fm_dt, pol_to_dt, ROUND(pol_to_dt - pol_fm_dt) FROM pgit_policy;

     

    See less
      • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  2. Asked: March 4, 2017In: PL/SQL

    How to execute multiple procedures simultaneously ?

    ashishpandey
    ashishpandey Explorer
    Added an answer on March 27, 2017 at 6:39 am

    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 less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  3. Asked: March 6, 2017In: PL/SQL

    How to use COMMIT or ROLLBACK inside database trigger ?

    ashishpandey
    ashishpandey Explorer
    Added an answer on March 27, 2017 at 6:32 am

    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 less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  4. Asked: June 24, 2016In: PL/SQL

    How to INSERT row when only doesn't exist ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on September 11, 2016 at 2:19 pm

    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 :

    CREATE TABLE testtab
    (
     id NUMBER PRIMARY KEY
     ,last_name VARCHAR2 (200)
    );

    now we will using not exists clause with regular insert statement but with select like this :

    INSERT INTO testtab
      SELECT 1, 'albert'
      FROM   dual
      WHERE  NOT EXISTS
               (SELECT NULL
                FROM   testtab
                WHERE  last_name = 'albert');

    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 :

    MERGE INTO testtab a
    USING      (SELECT 2 id, 'jonny' last_name FROM dual) b
    ON         (a.last_name = b.last_name)
    WHEN NOT MATCHED THEN
      INSERT     (id, last_name)
      VALUES     (b.id, b.last_name);

    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 less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  5. Asked: July 3, 2016In: Oracle SQL

    is there oracle function to remove spaces in the string ?

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on September 11, 2016 at 12:09 am

    hi albert, try this : select replace('Oracle Forms 10G', chr(32), '') from dual; hope this help.

    hi albert,
    try this :

    select replace('Oracle Forms 10G', chr(32), '') from dual;

    hope this help.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  6. Asked: July 31, 2016In: PL/SQL

    How to Raise User-Defined Exception and display Custom SQLERRM ?

    Saly
    Saly Explorer
    Added an answer on September 9, 2016 at 8:21 pm

    thanks so much to @Stephan Borsodi for this solution

    thanks so much to @Stephan Borsodi for this solution

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  7. Asked: June 19, 2016In: Oracle SQL

    how to create dynamic tables ,columns, and datatype for each column in oracle ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on August 27, 2016 at 7:28 am

    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

    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 any idea to avoid this will be very appreciated

    thank you for your reply.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  8. Asked: July 31, 2016In: PL/SQL

    How to know number of rows updated by UPDATE statement ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on August 21, 2016 at 1:56 pm

    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 :

    BEGIN
      UPDATE xx_test_tab
      SET    test_col = 777777
      WHERE  col2 LIKE '2%';

      DBMS_OUTPUT.PUT_LINE(TO_Char(SQL%ROWCOUNT)||' rows affected.');
    END;

    hope this help 🙂

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  9. Asked: August 1, 2016In: PL/SQL

    Can i use select statement inside if statement ? (if (select) > 0 then) ?

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on August 19, 2016 at 10:34 pm

    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 :

    DECLARE
      v_count   NUMBER;
    BEGIN
      SELECT count (*) INTO v_count FROM dual;

      IF v_count >= 1 THEN
        dbms_output.put_line ('true');
      ELSE
        dbms_output.put_line ('false');
      END IF;
    END;

    or as you mentioned if you want to use it inside delete statement like this :

    DELETE FROM table_1
    WHERE       (SELECT count (*) FROM table_2) >= 1;

    hope this helpful 🙂

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: August 16, 2016In: Oracle SQL

    How to Insert data include symbol '&' into a table ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on August 16, 2016 at 10:07 pm

    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.
    also from sqlplus you can use this :
    set define off

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 … 5 6 7 8 9

Sidebar

Adv 250x250

Explore

  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
    • Oraask XML Formatter
    • Oraask JSON Formatter
  • Wiki
    • SQL Tutorials
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials

Footer

Oraask

About

Oraask is a website for developers and software engineers who want to learn new skills, share their knowledge, and solve their coding problems. Oraask provides free content on various programming languages and topics, such as Oracle, Python, Java, etc. Oraask also allows users to ask questions and get answers from other members of the community.

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy
  • Terms & Conditions

Follow

Oraask is licensed under CC BY-NC-SA 4.0Oraask CopyrightOraask CopyrightOraask CopyrightOraask Copyright

© 2019 Oraask. All Rights Reserved
With Love by Oraask.