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

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

Hassan AbdElrahman

MasterOracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
Ask Hassan AbdElrahman
1k Visits
29 Followers
0 Questions
Home/ Hassan AbdElrahman/Answers
  • About
  • Questions
  • Answers
  • Best Answers
  • Posts
  • Polls
  • Asked Questions
  • Comments
  1. Asked: June 21, 2016In: Oracle SQL

    how can I know reserved words in oracle ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | 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
  2. Asked: June 21, 2016In: PL/SQL

    How to Send e-mail from PL/SQL ?

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

    How to read excel file from oracle pl/sql ?

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 19, 2016 at 9:03 am

    first thing data must be saved as extension .CSV not .xls second we need to create directory and give (EXECUTE, READ, WRITE) privilege to appropriate user which will use this directory later into procedure we will create create directory syntax CREATE OR REPLACE DIRECTORY TEMP_DIR AS 'C:temp'; GRANTRead more

    first thing data must be saved as extension .CSV not .xls
    second we need to create directory and give (EXECUTE, READ, WRITE) privilege to appropriate user which will use this directory later into procedure we will create
    create directory syntax

    CREATE OR REPLACE DIRECTORY 
    TEMP_DIR AS 
    'C:temp';
    GRANT EXECUTE, READ, WRITE ON DIRECTORY TEMP_DIR TO USER WITH GRANT OPTION;

    Note : “C:temp” this statement to create directory on windows server it will be little deference from Linux server.
    third thing you need to create stage table which we will insert data into it by mapping excel column to be the same with columns name :

    CREATE TABLE DOCARCH.TEST
    (
      TYPE_ID       NUMBER
    )

    and now it’s time to read the data inside csv file and inserted to stage table by this procedure

    create or replace procedure imp_proc_test
    is
      file_handle   utl_file.file_type := UTL_FILE.FOPEN('TEMP_DIR','imptestdata.csv','R',5000);
      var1          test.TYPE_ID%type;
      v_string      varchar2 (1000);
    begin
        loop
            begin
            UTL_FILE.get_line(file_handle,v_string);
            var1 := substr(v_string,1,instr(v_string,',',1,1)-1);
            insert into test (TYPE_ID) values (var1);
            exception
              when no_data_found then
                  UTL_FILE.fclose (file_handle);
                  exit;
               WHEN OTHERS THEN
                 DBMS_OUTPUT.PUT_LINE(sqlcode||sqlerrm);
            end;
        end loop;
        commit;
    end;

    so now after created this procedure just call it by :

    exec imp_proc_test

    at the final there is too many ways to achieve this requirement but we pick easiest one for you so please if you have any addition just share with others here.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  4. Asked: June 12, 2016In: Oracle E-Business Suite

    what is FNDLOAD commands to download and upload forms personalization ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 19, 2016 at 7:15 am

    FNDLOAD command for downloading personalization in form : FNDLOAD user/pass 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct PO_POXSCERQ_PERSONALIZ.ldt FND_FORM_CUSTOM_RULES function_name="PO_POXSCERQ" user : this your instance user name pass : this your instance password PO_POXSCERQ_PERSONALIZ.lRead more

    FNDLOAD command for downloading personalization in form :

    FNDLOAD user/pass 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct PO_POXSCERQ_PERSONALIZ.ldt FND_FORM_CUSTOM_RULES function_name="PO_POXSCERQ"

    user : this your instance user name
    pass : this your instance password
    PO_POXSCERQ_PERSONALIZ.ldt : this generated file after download rename appropriate name
    PO_POXSCERQ : this function name which you want to download all personalization from.

    just after you run above command LDT file will generated in home directory just take this LDT file and copy it to another home instance then

    FNDLOAD command for uploading personalization in form :

    FNDLOAD user/pass 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct PO_POXSCERQ_PERSONALIZ.ldt

    hope this helpful 🙂

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

    How can i Update a table by data in another table ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 18, 2016 at 11:06 am

    This called correlated update you can find examples below UPDATE TABLE(<SELECT STATEMENT>) <alias1> SET <column_1> = (   SELECT <column_1>   FROM <table_2> <alias2>   WHERE <alias2.table_name> = <alias1.table_name>); in you sample : UPDATE table1 t1   Read more

    This called correlated update you can find examples below

    UPDATE TABLE(<SELECT STATEMENT>) <alias1>
    SET <column_1> = (
      SELECT <column_1>
      FROM <table_2> <alias2>
      WHERE <alias2.table_name> = <alias1.table_name>);

    in you sample :

    UPDATE table1 t1
       SET (name, desc) = (SELECT t2.name, t2.desc
                             FROM table2 t2
                            WHERE t1.id = t2.id)
     WHERE EXISTS (
        SELECT 1
          FROM table2 t2
         WHERE t1.id = t2.id )

    alternative way you can do this

    UPDATE (SELECT t1.id, 
                   t1.name name1,
                   t1.desc desc1,
                   t2.name name2,
                   t2.desc desc2
              FROM table1 t1,
                   table2 t2
             WHERE t1.id = t2.id)
       SET name1 = name2,
           desc1 = desc2
    
    

    and now the final example is

    UPDATE Table1 T1 SET
    T1.name = (SELECT T2.name FROM Table2 T2 WHERE T2.id = T1.id),
    T1.desc = (SELECT T2.desc FROM Table2 T2 WHERE T2.id = T1.id)
    WHERE T1.id IN (SELECT T2.id FROM Table2 T2 WHERE T2.id = T1.id);
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  6. Asked: June 14, 2016In: Oracle SQL

    How to combine “LIKE” and “IN” condition in sql ?

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

    There is no combination of LIKE & IN in SQL, but you can use REGEXP_LIKE condition it's similar LIKE condition, except REGEXP_LIKE performs regular expression matching instead of the simple pattern matching performed by LIKE. Also this condition evaluates strings using characters as defined by iRead more

    There is no combination of LIKE & IN in SQL, but you can use REGEXP_LIKE condition it’s similar LIKE condition, except REGEXP_LIKE performs regular expression matching instead of the simple pattern matching performed by LIKE. Also this condition evaluates strings using characters as defined by input character set.
    Example 1 :

    select first_name from employees where regexp_like (first_name,'^Walker|Ken|^Mr')

    First Name

    Walker, Mr. Kenneth (Ken)

    Example 2 :

    SELECT first_name
    FROM employees
    WHERE REGEXP_LIKE (first_name, '^Ste(v|ph)en$');

    FIRST_NAME

    Steven

    Stephen

    Example 3 :

    SELECT last_name
    FROM employees
    WHERE REGEXP_LIKE (last_name, '([aeiou])1', 'i');

    LAST_NAME

    De Haan

    Greene

    Bloom

    Feeney

     

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

    how can i use one cursor inside two or more procedure in oracle pl/sql?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 17, 2016 at 6:55 pm

    The only way to achieve this is trying to declare that cursor in the package level then you can use it in any procedure or function in that package and the logic behind that is any cursor delcared in any function or procedure the scope for this cursor is only in that function below you can find sampRead more

    The only way to achieve this is trying to declare that cursor in the package level then you can use it in any procedure or function in that package and the logic behind that is any cursor delcared in any function or procedure the scope for this cursor is only in that function below you can find sample example :

    package body my_pkg is

       cursor test_cur is select * from table;

       procedure proc1 is
       begin
          open test_cur;
          ...
          close test_cur;
       end proc1;

       procedure proc2 is
       begin
          open test_cur;
          ...
          close test_cur;
       end proc2;
    end;


    Note: keep in mind in that example below if you open declared cursor in procedure 1 and you didn’t close it if you trying to open the same cursor in the procedure 2 you will get an exception raising

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

    What is the difference between varchar and varchar2 data type?

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

    Currently VARCHAR behaves exactly the same as VARCHAR2. However, this type should not be used as it is reserved for future usage VARCHAR is reserved by Oracle to support distinction between NULL and empty string in future, as ANSI standard prescribes. VARCHAR2 does not distinguish between a NULL andRead more

    Currently VARCHAR behaves exactly the same as VARCHAR2. However, this type should not be used as it is reserved for future usage
    VARCHAR is reserved by Oracle to support distinction between NULL and empty string in future, as ANSI standard prescribes.
    VARCHAR2 does not distinguish between a NULL and empty string, and never will.
    If you rely on empty string and NULL being the same thing, you should use VARCHAR2

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

    How to check whether partitioning enabled or not in my database ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 15, 2016 at 8:19 am

    we need to execute this select statement to check select * from v$option where parameter = 'Partitioning'; PARAMETER VALUE Partitioning TRUE

    we need to execute this select statement to check

    select * from v$option where parameter = 'Partitioning';
    PARAMETER VALUE
    Partitioning TRUE
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: June 14, 2016In: Oracle SQL

    how to concatenate two string or two values in oracle sql ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 14, 2016 at 11:40 pm

    It is ||, for example: select 'Mr ' || emp_name from employees; or concatenate two column values by : select first_name || '-' || last_namefrom employees;

    It is ||, for example:

    select 'Mr ' || emp_name from employees;

    or concatenate two column values by :

    select first_name || '-' || last_name
    from employees;
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 … 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
    • 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.