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

Gomaa Elmokhtar

Explorer
Ask Gomaa Elmokhtar
55 Visits
0 Followers
0 Questions
Home/ Gomaa Elmokhtar/Followers Answers
  • About
  • Questions
  • Answers
  • Best Answers
  • Posts
  • Polls
  • Asked Questions
  • Followed
  • Favorites
  • Comments
  • Followers Questions
  • Followers Answers
  • Followers Posts
  • Followers Comments
  1. Asked: September 8, 2021In: C#

    How to check if List empty or null in C#

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 16, 2022 at 8:18 am
    This answer was edited.

    Check if the list is empty in C# You can check whether the list is empty or not in many ways. The first approach is to check for null, and if the count is greater than zero   Example: if (strList != null && strList.Count > 0) { Console.WriteLine("The List has " + strList.Count + " reRead more

    Check if the list is empty in C#

    You can check whether the list is empty or not in many ways.

    • The first approach is to check for null, and if the count is greater than zero

     

    Example:

    if (strList != null && strList.Count > 0)
    {
    Console.WriteLine("The List has " + strList.Count + " records"); 
    }

    Output:

    The List has 10 records

     

    • The second approach is to use the LINQ method called “.any()”

     

    Example:

    if ((strList != null) && (!strList .Any()))
    {
    Console.WriteLine("The List has more than one record"); 
    }

    Output:

    The List has more than one record

    Do you find it helpful? Share to Spread Knowledge

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

    What is CTE in Oracle SQL

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 11, 2022 at 1:45 pm

    CTE stands for Common Table Expression. Another acronym is subquery factory; It's simply a query that you can define in another query. It starts with WITH clause that lets you assign a name to a subquery block. Then you can reference this subquery block in multiple places within your main query by gRead more

    CTE stands for Common Table Expression. Another acronym is subquery factory; It’s simply a query that you can define in another query. It starts with WITH clause that lets you assign a name to a subquery block. Then you can reference this subquery block in multiple places within your main query by giving that query a name.

    Oracle database traits that query name as either an inline view or as a temporary table that will be dropped automatically after the execution of your main query is finished.

    Let’s take a simple example to showcase the use of CTE in the Oracle database

    Let’s say we need to get the employees that are hired on the first day of each month in the current year.

    WITH hiring_periods (period)
    AS (SELECT to_date ('2006-01-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-02-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-03-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-04-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-05-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-06-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-07-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-08-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-09-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-10-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-11-01', 'yyyy-mm-dd') FROM dual
    UNION ALL
    SELECT to_date ('2006-12-01', 'yyyy-mm-dd') FROM dual)
    SELECT e.first_name, e.last_name, e.hire_date
    FROM employees e, hiring_periods hp
    WHERE e.hire_date = hp.period;

    Output:

    | FIREST_NAME | LAST_NAME | HIRE_DATE
    | ——————- | —————- | —————-|
    | Samuel                 | McCain           | 01/07/2006   |

     

    In the above query, we first start our query with a WITH clause to define a temporary table that has a date of the first day of each month and give that temp table or inline view a name which is “hiring_period” and then uses this name in the main query by joining it with the employee’s table using the hire date column.

    See less
      • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  3. Asked: July 7, 2022In: Oracle SQL

    Why do we use bulk collect in Oracle

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 8, 2022 at 8:51 pm

    BULK COLLECT in Oracle PL/SQL: BULK COLLECT in Oracle PL/SQL reduces the round trip between SQL engine and PL/SQL engine and allows SQL engine to fitch a bulk collection of data at once instead of the traditional LOOP statement. We are using the BULK COLLECT clause in the SELECT statement to fitch tRead more

    BULK COLLECT in Oracle PL/SQL:

    BULK COLLECT in Oracle PL/SQL reduces the round trip between SQL engine and PL/SQL engine and allows SQL engine to fitch a bulk collection of data at once instead of the traditional LOOP statement.

    We are using the BULK COLLECT clause in the SELECT statement to fitch the cursor result set in bulk or to populate the records in bulk.

    Since the BULK COLLECT fetches a result set or more than one record, the INTO clause must contain a collection variable like Oracle TYPE.

    Example:

    DECLARE
    CURSOR oraask_dept_details
    IS
    SELECT * FROM departments;

    TYPE l_dept_details_tbl IS TABLE OF departments%ROWTYPE;

    l_dept_details l_dept_details_tbl;
    BEGIN
    OPEN oraask_dept_details;

    LOOP
    FETCH oraask_dept_details BULK COLLECT INTO l_dept_details LIMIT 10;

    EXIT WHEN l_dept_details.count = 0;

    FOR dept_details_rec IN l_dept_details.first .. l_dept_details.last
    LOOP
    dbms_output.put_line ('DEPARTMENT ID:' || l_dept_details (dept_details_rec).department_id || ' - DEPARTMENT NAME:' || l_dept_details (dept_details_rec).department_name);
    END LOOP;
    END LOOP;

    CLOSE oraask_dept_details;
    END;
    /

    Output :

    DEPARTMENT ID:10 - DEPARTMENT NAME:Administration
    DEPARTMENT ID:20 - DEPARTMENT NAME:Marketing
    DEPARTMENT ID:30 - DEPARTMENT NAME:Purchasing
    DEPARTMENT ID:40 - DEPARTMENT NAME:Human Resources
    DEPARTMENT ID:50 - DEPARTMENT NAME:Shipping
    DEPARTMENT ID:60 - DEPARTMENT NAME:IT
    DEPARTMENT ID:70 - DEPARTMENT NAME:Public Relations
    DEPARTMENT ID:80 - DEPARTMENT NAME:Sales
    DEPARTMENT ID:90 - DEPARTMENT NAME:Executive
    DEPARTMENT ID:100 - DEPARTMENT NAME:Finance
    DEPARTMENT ID:110 - DEPARTMENT NAME:Accounting
    DEPARTMENT ID:120 - DEPARTMENT NAME:Treasury
    DEPARTMENT ID:130 - DEPARTMENT NAME:Corporate Tax
    DEPARTMENT ID:140 - DEPARTMENT NAME:Control And Credit
    DEPARTMENT ID:150 - DEPARTMENT NAME:Shareholder Services
    DEPARTMENT ID:160 - DEPARTMENT NAME:Benefits
    DEPARTMENT ID:170 - DEPARTMENT NAME:Manufacturing
    DEPARTMENT ID:180 - DEPARTMENT NAME:Construction
    DEPARTMENT ID:190 - DEPARTMENT NAME:Contracting
    DEPARTMENT ID:200 - DEPARTMENT NAME:Operations
    DEPARTMENT ID:210 - DEPARTMENT NAME:IT Support
    DEPARTMENT ID:220 - DEPARTMENT NAME:NOC
    DEPARTMENT ID:230 - DEPARTMENT NAME:IT Helpdesk
    DEPARTMENT ID:240 - DEPARTMENT NAME:Government Sales
    DEPARTMENT ID:250 - DEPARTMENT NAME:Retail Sales
    DEPARTMENT ID:260 - DEPARTMENT NAME:Recruiting
    DEPARTMENT ID:270 - DEPARTMENT NAME:Payroll

    In the above script, we used a LIMIT clause to limit fetching the bulk of records to 10 records at a time. This clause is very handful when dealing with a large number of records to avoid running out of memory because the collection type we use is expanding as more records are inserted into it.

    Do you find it helpful? Share to spread the knowledge

    See less
      • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  4. Asked: July 6, 2022In: Oracle SQL

    Search all columns of the database oracle SQL

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 7, 2022 at 12:14 am
    This answer was edited.

    To find The tables which contain a particular column name, you can use the following query: SELECT owner, table_name, column_name FROM all_tab_columns WHERE column_name LIKE '%TRANSACTION_QUANTITY%'; The output of this select statement would be: You can get the result from a specific owner schema liRead more

    To find The tables which contain a particular column name, you can use the following query:

    SELECT owner, table_name, column_name 
    FROM all_tab_columns
    WHERE column_name LIKE '%TRANSACTION_QUANTITY%';

    The output of this select statement would be:

    query result

    You can get the result from a specific owner schema like ‘INV’ and so on. 

    You may also be interested in checking my answer to other related questions from here Get Column Name from Table in Oracle

    See less
      • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  5. Asked: March 28, 2020In: Oracle SQL

    How to copy a table without data in oracle?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 25, 2022 at 2:43 pm

    To copy a table without copying its data, you can simply use this SQL statement: CREATE TABLE xx_oraask_tbl_bkp AS SELECT * FROM xx_oraask_tbl WHERE 1=0; But there is a limitation to using the above statement that you have to pay attention to: The following database objects are not copied to the newRead more

    To copy a table without copying its data, you can simply use this SQL statement:

    CREATE TABLE xx_oraask_tbl_bkp AS SELECT * FROM xx_oraask_tbl WHERE 1=0;

    But there is a limitation to using the above statement that you have to pay attention to:

    The following database objects are not copied to the new version of your table

    • Sequences
    • Triggers
    • Indexes
    • Identity column
    • Some constraints
    • Partitioning

    Or you can use another way to do this:

    SELECT dbms_metadata.get_ddl( 'TABLE', 'xx_oraask_tbl' ) FROM DUAL;

    In the above statement, you will get the DDL statement of a specified table, and then you can easily change the table name, the indexes, etc.

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

    HTTP request failed ORA-29270: too many open HTTP requests

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 25, 2022 at 2:09 am

    This error is thrown because there is a limit of 5 open HTTP connections per session in the Oracle database server. Usually, the application intends to open one connection at a time. However, this error might occur due to the application not closing the connection properly after being finished. So,Read more

    This error is thrown because there is a limit of 5 open HTTP connections per session in the Oracle database server.

    Usually, the application intends to open one connection at a time. However, this error might occur due to the application not closing the connection properly after being finished.

    So, it’s recommended to review your code and to make sure you are ending the response after you have finished as well as in the exception part also, ending the request like the below code.

    Catch too many requests exception to handle it by closing the request and response:

    EXCEPTION
    WHEN UTL_HTTP.TOO_MANY_REQUESTS THEN
    UTL_HTTP.END_REQUEST(req);
    UTL_HTTP.END_RESPONSE(resp);

    Ending the request at the end of your program

    UTL_HTTP.END_REQUEST(req);
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  7. Asked: June 11, 2022In: Oracle E-Business Suite

    Is it recommended to increase the length of a DFF attribute in standard table

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 25, 2022 at 1:46 am

    It's not as simple as changing the ATTRIBUTE column size because there are a lot of dependencies that you need to pay attention to e.g. Changes to other tables that may be related to your table, like (interface tables). Check the form that is used in this ATTRIBUTE. Check code that may require a chaRead more

    It’s not as simple as changing the ATTRIBUTE column size because there are a lot of dependencies that you need to pay attention to e.g.

    • Changes to other tables that may be related to your table, like (interface tables).
    • Check the form that is used in this ATTRIBUTE.
    • Check code that may require a change like increasing or decreasing the field length like API.
    • Check reports that use the same ATTRIBUTE.
    • Check the value sets if any of them queried the same DFF ATTRIBUTE

    That’s why it is not simple; moreover, DFF ATTRIBUTES default length of “150” characters is a coding standard used for most standard tables.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  8. Asked: June 18, 2022In: Java

    How can I define a global variable in java

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 21, 2022 at 12:59 am
    This answer was edited.

    There is no global variable in Java. However, we have a static keyword that we can use to define a global variable by doing something like the below: public class A { public static String var1 = "Oraask"; public static int var2 = 37; } A.var1; A.var2; But be careful because if this class gets unloadRead more

    There is no global variable in Java. However, we have a static keyword that we can use to define a global variable by doing something like the below:

    public class A {
    public static String var1 = "Oraask";
    public static int var2 = 37;
    }
    A.var1;
    
    A.var2;

    But be careful because if this class gets unloaded, you will end up with an undefined null error that is difficult to catch.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  9. Asked: September 18, 2021In: Oracle SQL

    ORA-01417: a table may be outer joined to at most one other table

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 17, 2022 at 3:20 am

    Before Oracle database release 12c, the error ORA-01417 is raised when you have more than one table on the left-hand side of an outer join. To overcome this limit, we can convert the join to an ANSI syntax, e.g.: SELECT * FROM EMPLOYEES E LEFT JOIN DEPARTMENTS D ON (D.DEPARTMENT_ID = E.DEPARTMENT_IDRead more

    Before Oracle database release 12c, the error ORA-01417 is raised when you have more than one table on the left-hand side of an outer join. To overcome this limit, we can convert the join to an ANSI syntax, e.g.:

    SELECT *
    FROM EMPLOYEES E
    LEFT JOIN DEPARTMENTS D ON (D.DEPARTMENT_ID = E.DEPARTMENT_ID)
    LEFT JOIN LOCATIONS L ON (L.LOCATION_ID = D.LOCATION_ID);

    From the 12c version, Oracle has supported having multiple tables on the left-hand side of the join.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: June 14, 2022In: Oracle Applications DBA

    Tablespace size

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on June 15, 2022 at 1:04 am

    Find below the query to find the free space of a tablespace: SELECT DFQ.TABLESPACE_NAME "Tablespace Name" ,DFQ.TOTALSPACE "Total Size MB" , (DFQ.TOTALSPACE - DSQ.TOTALUSEDSPACE) "Free Space MB" ,ROUND (100 * ( (DFQ.TOTALSPACE - DSQ.TOTALUSEDSPACE) / DFQ.TOTALSPACE)) || '%' "Free Space %" FROM (SELECRead more

    Find below the query to find the free space of a tablespace:

    SELECT DFQ.TABLESPACE_NAME "Tablespace Name"
    ,DFQ.TOTALSPACE "Total Size MB"
    , (DFQ.TOTALSPACE - DSQ.TOTALUSEDSPACE) "Free Space MB"
    ,ROUND (100 * ( (DFQ.TOTALSPACE - DSQ.TOTALUSEDSPACE) / DFQ.TOTALSPACE)) || '%' "Free Space %"
    FROM (SELECT TABLESPACE_NAME, ROUND (SUM (BYTES) / 1048576) TOTALSPACE
    FROM DBA_DATA_FILES
    GROUP BY TABLESPACE_NAME) DFQ
    ,(SELECT TABLESPACE_NAME, ROUND (SUM (BYTES) / (1024 * 1024)) TOTALUSEDSPACE
    FROM DBA_SEGMENTS
    GROUP BY TABLESPACE_NAME) DSQ
    WHERE DFQ.TABLESPACE_NAME = DSQ.TABLESPACE_NAME(+);

    Also, you can refer to this article to find a handful of detail about the tablespace:

    Check Tablespace Usage in Oracle

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 2 3 4 5 … 20

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.