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

isouravghosh

Juniorisouravghosh
Ask isouravghosh
118 Visits
3 Followers
0 Questions
Home/ isouravghosh/Followers Answers
  • About
  • Questions
  • Answers
  • Best Answers
  • Posts
  • Polls
  • Asked Questions
  • Followed
  • Favorites
  • Comments
  • Followers Questions
  • Followers Answers
  • Followers Posts
  • Followers Comments
  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. Asked: June 13, 2016In: PL/SQL

    How to create array variable in oracle pl/sql ?

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

    Basically VARRAY is varying array type that is typically used when the number of instances to be stored is small that means if we have one customer and this customer have number of phone numbers in our case if we know exact how many phone number he has so we will use VARRAY otherwise we will go forRead more

    Basically VARRAY is varying array type that is typically used when the number of instances to be stored is small that means if we have one customer and this customer have number of phone numbers in our case if we know exact how many phone number he has so we will use VARRAY otherwise we will go for using nested tables.
    You can use VARRAY data type for:

    1. A column in a relational table
    2. A PL/SQL variable
    3. A PL/SQL parameter of procedure or function
    4. A PL/SQL function return type
    5. A data attribute of an object type

    Now We can use VARRAY for a fixed-size array

    declare
       type array_t is varray(3) of varchar2(10);
       array array_t := array_t('Matt', 'Joanne', 'Robert');
    begin
       for i in 1..array.count loop
           dbms_output.put_line(array(i));
       end loop;
    end;

    Or TABLE for an unbounded array like:

    type array_t is table of varchar2(10);

    for clarification we submit question and it’s answer to help others, please if you have any addition don’t hesitate to share with others here.

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

    Download MD50 document

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 12, 2016 at 9:59 pm

    hi you can download it from here Click here also you can find MD70 & MD120 with explanation for each document here   AIM Documents (MD50, MD70 and MD120) Templates – Download now

    hi you can download it from here Click here
    also you can find MD70 & MD120 with explanation for each document here
     
    AIM Documents (MD50, MD70 and MD120) Templates – Download now

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

    how to Order by string in SQL ?

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 12, 2016 at 11:26 am
    This answer was edited.

    In standard SQL, you need a case statement Select * From people ORDER BY (case when names = 'john' then 1 when names = 'steve' then 2 when names = 'bob' then 3 when names = 'bill' then 4 else 5 ); You can find this article helpful for you in case you are using Oracle database: Oracle Case StatementRead more

    In standard SQL, you need a case statement

    Select *
    From people
    ORDER BY (case when names = 'john' then 1
                   when names = 'steve' then 2
                   when names = 'bob' then 3
                   when names = 'bill' then 4
              else 5
             );
    

    You can find this article helpful for you in case you are using Oracle database:

    Oracle Case Statement : (Simple Case, Searched Case)

    Some SQL engines have shortcuts to this, but you don’t mention which database you are using.
    For instance, in MySQL you can do:

    order by field(names, 'john', 'steve', 'bob', 'bill');
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: June 11, 2016In: Oracle Forms

    How to remove blank line when you create list item in oracle forms 10g ?

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

    as per oracle forms online help: Forms maintains an additional NULL element in a list item List Items and Null Values ... Setting the Required property for a poplist or TList may affect the values the list will display: When selected, an instance of a poplist will display an extra null value if itsRead more

    as per oracle forms online help:
    Forms maintains an additional NULL element in a list item
    List Items and Null Values … Setting the Required property for a poplist or TList may affect the values the list will display: When selected, an instance of a poplist will display an extra null value if its current value is Null or if its effective Required property is false.
    CLEAR_LIST Built-in Clears all elements from a list item. After Oracle Forms clears the list, the list will contain only one element (the null element), regardless of the item’s Required property.

    See less
      • -1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 … 17 18 19

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.