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


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

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.

Forgot Password?

Need An Account, Sign Up Here

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have permission to add post.

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
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
  • Wiki
    • SQL Tutorials
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials

Walaa Mohamed

Junior
Ask Walaa Mohamed
47 Visits
3 Followers
0 Questions
Home/ Walaa Mohamed/Followers Answers
  • About
  • Questions
  • Answers
  • Best Answers
  • Posts
  • Polls
  • Asked Questions
  • Followed
  • Favorites
  • Comments
  • Followers Questions
  • Followers Answers
  • Followers Posts
  • Followers Comments
  1. Asked: July 31, 2016In: PL/SQL

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

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

    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 :

    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);
    END;

    the output would be : ” ORA-20001: Your custom error message here ” .
    hope this help 🙂

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

    How to know number of rows updated by UPDATE statement ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | 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
  3. 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 ♠ | 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
  4. Asked: August 16, 2016In: Oracle SQL

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

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | 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
  5. Asked: August 14, 2016In: PL/SQL

    How can i convert CLOBS TO VARCHAR2 column ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on August 14, 2016 at 9:24 pm

    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

    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 characters :

    DECLARE
      var1   LONG;
    BEGIN
      FOR i IN (SELECT clob_col FROM tablename)
      LOOP
        var1 := dbms_lob.substr (i.clob_col, 32000, 1);
      END LOOP;
    END;

    hope this may help.
    you can refer to DBMS_LOB from oracle

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  6. Asked: August 13, 2016In: Oracle Forms

    Load image

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on August 13, 2016 at 9:09 pm
    This answer was edited.

    firstly, try to read more about the webutil library.second, find below a basic code snippet to do the job: --this code to open uploading dialog box V_CLIENT_PATH := CLIENT_GET_FILE_NAME(DIRECTORY_NAME => NULL ,FILE_NAME => NULL ,FILE_FILTER => 'ALL FILES (*.*)|*.*' ,MESSAGE => 'Open a fiRead more

    firstly, try to read more about the webutil library.
    second, find below a basic code snippet to do the job:

    --this code to open uploading dialog box
    
        V_CLIENT_PATH := CLIENT_GET_FILE_NAME(DIRECTORY_NAME => NULL
                                     ,FILE_NAME    => NULL
                                     ,FILE_FILTER  => 'ALL FILES (*.*)|*.*'
                                     ,MESSAGE      => 'Open a file'
                                     ,DIALOG_TYPE  => NULL
                                     ,SELECT_FILE  => NULL);
    
        -- create directory on local machine at client server
        HOST ( 'cmd /c mkdir'||' "'|| 'C:tempapplication' || '"',NO_SCREEN); 
    
    -- this code to show uploading progress to user
        V_SUCCESS := 
    WEBUTIL_FILE_TRANSFER.CLIENT_TO_AS_WITH_PROGRESS
        (CLIENTFILE       => V_CLIENT_PATH
        ,SERVERFILE       => V_SERVER_PATH
        ,PROGRESSTITLE    => 'Uploading file in progress'
        ,PROGRESSSUBTITLE => 'Please wait'
       ,ASYNCHRONOUS     => FALSE
       ,CALLBACKTRIGGER  => NULL);

    hope this may help 🙂

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  7. Asked: July 17, 2016In: Java

    How to add ' "single quotes" for string using Java?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 20, 2016 at 7:54 pm

    hello beter, basically if you want to add single code to any string you can use : /' "any string you want here" /' and if you want to use it inside sql statement hence you are building VO at run time (onthefly :)) so you can write : SELECT column1 FROM table WHERE column2 = + "'"+ Vstr+"'"; where VsRead more

    hello beter,
    basically if you want to add single code to any string you can use :

    /' "any string you want here" /'

    and if you want to use it inside sql statement hence you are building VO at run time (onthefly :)) so you can write :

    SELECT column1 FROM table WHERE column2 = + "'"+ Vstr+"'";

    where Vstr is your String variable in your example.
     
    hope this helpful 🙂
    share today to gain tomorrow.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  8. Asked: July 11, 2016In: Oracle Reports

    How to pass date parameter to oracle report builder ?

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 11, 2016 at 12:38 pm

    hello albert,  your code is correct can you write what is the error exactly to help you. in addition you can check your user parameter  in your report builder property specifically these properties mentioned in below image

    hello albert,
     your code is correct can you write what is the error exactly to help you.
    in addition you can check your user parameter  in your report builder property specifically these properties mentioned in below image
    pass date parameter to report builder

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

    how can I know reserved words in oracle ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 22, 2016 at 8:44 pm

    just execute this query to list all oracle reserved words select *from v$reserved_wordswhere reserved = 'Y' hope this helpful :) share with others to stretch our experiences

    just execute this query to list all oracle reserved words

    select *
    from v$reserved_words
    where reserved = 'Y'

    hope this helpful 🙂
    share with others to stretch our experiences

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: June 21, 2016In: PL/SQL

    How to Send e-mail from PL/SQL ?

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

    hi there,starting from oracle 8i we are eligible to send emails directly from PL/SQL by using either UTL_SMTP or UTL_TCP packages. However, oracle provides us valuable package called UTL_MAIL for sending emails in Oracle 10g.here is example of how to use UTL_MAIL to send emails from PL/SQL : BEGIN ERead more

    hi there,

    starting from oracle 8i we are eligible to send emails directly from PL/SQL by using either UTL_SMTP or UTL_TCP packages. However, oracle provides us valuable package called UTL_MAIL for sending emails in Oracle 10g.

    here is example of how to use UTL_MAIL to send emails from PL/SQL :

    BEGIN
      EXECUTE IMMEDIATE 'ALTER SESSION SET smtp_out_server = ''127.0.0.1''';
      UTL_MAIL.send(sender => 'me@address.com',
                recipients => 'you@address.com',
                   subject => 'Test Mail',
                   message => 'Hello World',
                 mime_type => 'text; charset=us-ascii');
    END;

    Note : for security purpose, UTL_MAIL is not enabled by default. so you should enable it by connecting to SYS user and executing the utlmail.sql and prvtmail.plb scripts in the $ORACLE_HOME/RDBMS/admin directory. In addition, you must configure an initialization parameter, SMTP_OUT_SERVER, to point to an outgoing SMTP server.
    in addition, you must give EXECUTE permission to PUBLIC by run below script :

    grant execute on UTL_MAIL to public

    hope this helpful 🙂
    share with others to stretch our experiences

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 … 13 14 15 16 17

Sidebar

Adv 250x250

Explore

  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
  • 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.