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: June 19, 2016In: PL/SQL

    ORA-29280: utl_file.fopen invalid directory path with directory

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 13, 2017 at 6:49 pm

    utl_file.fopen takes the name of a directory, not the path. For example: (you may need to login as SYS to execute these) [code]Windows: CREATE DIRECTORY CUST_DIR AS 'C:'; Linux CREATE DIRECTORY CUST_DIR AS '/usr/tmp'; GRANT READ ON DIRECTORY CUST_DIR TO SCOTT;[/code] Then, you can refer to it in theRead more

    utl_file.fopen takes the name of a directory, not the path. For example:

    (you may need to login as SYS to execute these)

    [code]Windows:
    CREATE DIRECTORY CUST_DIR AS ‘C:’;

    Linux
    CREATE DIRECTORY CUST_DIR AS ‘/usr/tmp’;

    GRANT READ ON DIRECTORY CUST_DIR TO SCOTT;[/code]

    Then, you can refer to it in the call to fopen:

    [code]
    UTL_FILE.FOPEN(‘CUST_DIR’, ‘oraask_test.txt’, ‘W’);
    [/code]

     

    hope this help.

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

    Error: PLS-00103: Encountered the symbol when trying to compile

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 13, 2017 at 4:21 pm

    You need to change ELSEIF to ELSIF . your code would be like this : [code]declare CURSOR abc IS select * from all_Objects; begin for rec in abc loop if rec.object_id is null then null; elsif rec.owner is null then null; end if; end loop; end;[/code]

    You need to change ELSEIF to ELSIF .

    your code would be like this :

    [code]declare
    CURSOR abc IS select * from all_Objects;
    begin
    for rec in abc
    loop
    if rec.object_id is null then
    null;
    elsif rec.owner is null then
    null;
    end if;
    end loop;
    end;[/code]

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

    What is the difference between procedure and function in PL/SQL?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 13, 2017 at 9:53 am

    1. Procedure may or may not return value where as function should return one value. 2. Function can be called from SQL statement where as procedure can't be called from the SQL statement. 3. Function are normally used for computation where as procedure are normally used for executing business logic.Read more

    1. Procedure may or may not return value where as function should return one value.

    2. Function can be called from SQL statement where as procedure can’t be called from the SQL statement.

    3. Function are normally used for computation where as procedure are normally used for executing business logic.

    4. Stored procedure is pre-compiled execution plan where as function are not.

    5. We can call function within procedure but we can not call procedure within function.

    6. A FUNCTION must be part of an executable statement, as it cannot be executed independently, whereas procedure represents an independent executable statement.

    and for example of both syntax of function and procedure :

    [code]CREATE OR REPLACE PROCEDURE test_proc
    (p_id IN VARCHAR2) as begin … end

    CREATE OR REPLACE FUNCTION test_func
    (p_id IN VARCHAR2) return varchar2 as begin … end[/code]

     

    hope this help.

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

    how to check if the column value is number or character

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 12, 2017 at 9:16 pm

    one example to create a function to return 'Y' if parameter value is number otherwise which is exception in this case to return ('N') ex: [code]CREATE OR REPLACE FUNCTION is_number (p_string IN VARCHAR2) RETURN VARCHAR2 DETERMINISTIC PARALLEL_ENABLE IS l_num NUMBER; BEGIN l_num := TO_NUMBER (p_strinRead more

    one example to create a function to return ‘Y’ if parameter value is number otherwise which is exception in this case to return (‘N’)

    ex:

    [code]CREATE OR REPLACE FUNCTION is_number (p_string IN VARCHAR2)
    RETURN VARCHAR2
    DETERMINISTIC
    PARALLEL_ENABLE
    IS
    l_num NUMBER;
    BEGIN
    l_num := TO_NUMBER (p_string);
    RETURN ‘Y’;
    EXCEPTION
    WHEN VALUE_ERROR
    THEN
    RETURN ‘N’;
    END is_number;[/code]

    and here you can call the function created above to identify the value passed is number or not like :

    [code]SELECT (CASE
    WHEN (is_number (mycolumn) = ‘Y’)
    THEN
    ‘your column value is number’
    ELSE
    ‘your column value is not number’
    END)
    FROM myTable;[/code]

    hope this help you.

    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 to count specific values from table ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 12, 2017 at 9:05 pm

    Hi, try this query : [code]SELECT SUM ( CASE WHEN Col1 = 2 THEN 1 ELSE 0 END + CASE WHEN Col2 = 2 THEN 1 ELSE 0 END + CASE WHEN Col3 = 2 THEN 1 ELSE 0 END) FROM table_name WHERE Col1 = 2 OR Col2 = 2 OR Col3 = 2;[/code]

    Hi,

    try this query :

    [code]SELECT SUM (
    CASE WHEN Col1 = 2 THEN 1 ELSE 0 END
    + CASE WHEN Col2 = 2 THEN 1 ELSE 0 END
    + CASE WHEN Col3 = 2 THEN 1 ELSE 0 END)
    FROM table_name
    WHERE Col1 = 2 OR Col2 = 2 OR Col3 = 2;[/code]

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  6. Asked: March 25, 2017In: JavaScript

    How do i redirect user from page to another in JavaScript ?

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

    Hi Saly, Actually you can achieve this by simulate HTTP redirect by using one of the following : // similar behavior as an HTTP redirect [code]window.location.replace("http://www.oraask.com");[/code] or // similar behavior as clicking on a link [code]window.location.href("http://www.oraask.com");[/cRead more

    Hi Saly,

    Actually you can achieve this by simulate HTTP redirect by using one of the following :

    // similar behavior as an HTTP redirect

    [code]window.location.replace(“http://www.oraask.com”);[/code]

    or

    // similar behavior as clicking on a link

    [code]window.location.href(“http://www.oraask.com”);[/code]

    at the end this your choice but for my suggestion i prefer using  (window.location.replace) because this doesn’t keep originate page in the session history.

    hope this help.

     

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  7. Asked: March 24, 2017In: Oracle SQL

    How to add a new column to a table only if not exist?

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

    You can find the following view to access all metadata about the columns :user_tab_cols; -- For all tables owned by the userall_tab_cols ; -- For all tables accessible to the userdba_tab_cols; -- For all tables in the Database.and lets consider you want to add new column only if doesn't exists you cRead more

    You can find the following view to access all metadata about the columns :

    user_tab_cols; — For all tables owned by the user

    all_tab_cols ; — For all tables accessible to the user

    dba_tab_cols; — For all tables in the Database.

    and lets consider you want to add new column only if doesn’t exists you can use this pl/sql to check and add new column

    [code]DECLARE
    v_column_exists number := 0;
    BEGIN
    Select count(*)
    into v_column_exists
    from user_tab_cols
    where column_name = ‘ADD_COLUMN’
    and table_name = ‘departments’;

    if (v_column_exists = 0) then
    execute immediate ‘alter table departments add (ADD_COLUMN NUMBER)’;
    end if;
    end;[/code]

    hope this help.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  8. Asked: April 3, 2017In: PL/SQL

    ORA-06550: line , column : PLS-00201: identifier must be declared

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 12, 2017 at 9:26 pm
    This answer was edited.

    ORA-06550: error causes are:  You tried to execute an invalid block of PLSQL code (like a stored procedure or function), but a compilation error occurred. in your example, you selected a value inside the variable (v_last) that is not declared in your block. So to correct your block of code, you canRead more

    ORA-06550: error causes are:  You tried to execute an invalid block of PLSQL code (like a stored procedure or function), but a compilation error occurred.

    in your example, you selected a value inside the variable (v_last) that is not declared in your block.

    So to correct your block of code, you can rewrite it like this:

    DECLARE
    V_LAST EMPLOYEES.LAST_NAME%TYPE;
    BEGIN
    SELECT LAST_NAME INTO V_LAST FROM EMPLOYEES; dbms_output.put_line(‘v_last is :’ || V_LAST );
    END;
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  9. Asked: March 24, 2017In: Oracle Ebs Api’s

    API to create and update Inventory Items in Oracle Apps R12

    Hassan AbdElrahman
    Best Answer
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on July 11, 2017 at 10:25 am
    This answer was edited.

    Hello @Jone,   you can create or update inventory item by using API (ego_item_pub.process_item) and this an example :   Note : before using both API's be aware that we are not committing the changes. You have to perform explicit commit manually from IDE or set parameter (p_commit = 'T') to commit yoRead more

    Hello Jone,   you can create or update inventory item by using API (ego_item_pub.process_item) and this an example :  

    Note : before using both API’s be aware that we are not committing the changes. You have to perform explicit commit manually from IDE or set parameter (p_commit = ‘T’) to commit your changes.

    1. Create new inventory item using this API example:
    DECLARE
      l_inventory_item_id   NUMBER;
      l_organization_id     NUMBER;
      l_return_status       VARCHAR2 (4000);
      l_msg_data            VARCHAR2 (4000);
      l_msg_count           NUMBER;
      x_message_list        error_handler.error_tbl_type;
    BEGIN
      fnd_global.apps_initialize (user_id => 1318, --> OPERATIONS
                                  resp_id => 50583, --> Inventory, Vision Operations (USA)
                                  resp_appl_id => 401); --> Inventory
    
      ego_item_pub.process_item (p_api_version                  => 1.0
                                ,p_init_msg_list                => 'T' -- (F:- False), (T:- True)
                                ,p_commit                       => 'F' -- (F:- False), (T:- True)
                                ,p_transaction_type             => 'CREATE' -- UPDATE FOR Updating item
                                ,p_segment1                     => 'Oraask_Item01' -- ITEM CODE
                                ,p_description                  => 'Oraask Test Item Description' -- ITEM DESCRIPTION
                                ,p_long_description             => 'Oraask Test Long Item Description' -- ITEM LONG DESCRIPTION
                                ,p_organization_id              => 204 -- Vision Operations
                                ,p_apply_template               => 'ALL'
                                ,p_template_id                  => 2 -- Purchased Item — select * from mtl_item_templates_vl
                                -- P_TEMPLATE_NAME => '@Purchased Item',
                                -- P_ITEM_TYPE => 'P',
                                ,p_inventory_item_status_code   => 'Active'
                                ,p_approval_status              => 'A'
                                ,x_inventory_item_id            => l_inventory_item_id
                                ,x_organization_id              => l_organization_id
                                ,x_return_status                => l_return_status
                                ,x_msg_count                    => l_msg_count
                                ,x_msg_data                     => l_msg_data);
    
      IF l_return_status = fnd_api.g_ret_sts_success THEN
        dbms_output.put_line ('Item is Created Successfully, Inventory Item ID : ' || l_inventory_item_id);
    
      ELSE
        dbms_output.put_line ('Item Creation is Failed');
        error_handler.get_message_list (x_message_list => x_message_list);
    
        FOR i IN 1 .. x_message_list.count
        LOOP
          dbms_output.put_line (x_message_list (i).message_text);
        END LOOP;
    
        ROLLBACK;
      END IF;
    --> EXCEPTIONS HANDLING PART
    EXCEPTION
      WHEN OTHERS THEN
        FOR i IN 1 .. l_msg_count
        LOOP
          dbms_output.put_line (substr (fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 255));
          dbms_output.put_line ('message is: ' || l_msg_data);
        END LOOP;
    END;

     

    • Update existing inventory item using this API example:
    DECLARE
      l_inventory_item_id   NUMBER;
      l_organization_id     NUMBER;
      l_return_status       VARCHAR2 (4000);
      l_msg_data            VARCHAR2 (4000);
      l_msg_count           NUMBER;
      x_message_list        error_handler.error_tbl_type;
    BEGIN
      fnd_global.apps_initialize (user_id => 1318, --> OPERATIONS
                                  resp_id => 50583, --> Inventory, Vision Operations (USA)
                                  resp_appl_id => 401); --> Inventory
     
      ego_item_pub.process_item (p_api_version                  => 1.0
                                ,p_init_msg_list                => 'T' -- (F:- False), (T:- True)
                                ,p_commit                       => 'F' -- (F:- False), (T:- True)
                                ,p_transaction_type             => 'UPDATE' -- UPDATE FOR Updating item
                                ,p_Inventory_Item_Id            => 53899
                                ,p_description                  => 'Oraask test description' -- ITEM DESCRIPTION
                                ,p_organization_id              => 204 -- Vision Operations
                                ,x_inventory_item_id            => l_inventory_item_id
                                ,x_organization_id              => l_organization_id
                                ,x_return_status                => l_return_status
                                ,x_msg_count                    => l_msg_count
                                ,x_msg_data                     => l_msg_data);
     
      IF l_return_status = fnd_api.g_ret_sts_success THEN
        dbms_output.put_line ('Inventory Item has been updated Successfully, Inventory Item ID : ' || l_inventory_item_id);
    
      ELSE
        dbms_output.put_line ('Update inventory item is Failed');
        error_handler.get_message_list (x_message_list => x_message_list);
     
        FOR i IN 1 .. x_message_list.count
        LOOP
          dbms_output.put_line (x_message_list (i).message_text);
        END LOOP;
     
        ROLLBACK;
      END IF;
    --> EXCEPTIONS HANDLING PART
    EXCEPTION
      WHEN OTHERS THEN
        FOR i IN 1 .. l_msg_count
        LOOP
          dbms_output.put_line (substr (fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 255));
          dbms_output.put_line ('message is: ' || l_msg_data);
        END LOOP;
    END;
    

    — By executing above code we have updated item description to be “Oraask test description” for inventory item id “53899”

    Hopefully, this code snippet helps you 🙂

    See less
      • 7
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: April 30, 2017In: Oracle E-Business Suite

    What is FNDLOAD command to move Value Sets from one instance to another ?

    Hassan AbdElrahman
    Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
    Added an answer on May 1, 2017 at 6:35 pm
    This answer was edited.

    Hello Matheo, You can use this command to download and upload value sets : FNDLOAD to Download Valueset: $FND_TOP/bin/FNDLOAD username/password 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUSTOM_VS.ldt VALUE_SET FLEX_VALUE_SET_NAME="XX Value Set Name" FNDLOAD to Upload Valueset: $FND_TOP/Read more

    Hello Matheo,

    You can use this command to download and upload value sets :

    FNDLOAD to Download Valueset:

    $FND_TOP/bin/FNDLOAD username/password 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUSTOM_VS.ldt VALUE_SET FLEX_VALUE_SET_NAME="XX Value Set Name"

    FNDLOAD to Upload Valueset:

    $FND_TOP/bin/FNDLOAD username/password 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUSTOM_VS.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 … 11 12 13 14 15 … 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.