https://m.youtube.com/watch?v=Q5JM8nWWfnI&list=PLc9GCtRxQqZgvbfREKjy1Vi9X7Rle0Nhs&index=1&t=9s
Pages
- Home
- SQL Fundamentals
- SQL Fundamentals II
- SQL PLUS
- PL/SQL
- Forms and Reports
- HTML5
- JavaScript
- PHP
- jQuery
- Java
- NLS_LANG
- SQL SERVER
- PL/SQL Collections and Records
- DBMS_OUTPUT built-in package
- Date and Time
- PL/SQL Transactions
- Ref Cursors
- Bulk Binds
- PL/SQL Analytic Functions
- Problems and solves
- Oracle Indexes
- Oracle Courses
- PHP
- Work Samples
- Record & Collection
- LOOP
- Conditional statements
- Triggers
- Object Oriented
- Contact Me
Sunday, May 30, 2021
Monday, September 21, 2020
Sunday, September 20, 2020
Thursday, September 17, 2020
Oracle Select all column and one in the begining
Oracle Select all column and one in the begining
example
select i.BONUS_ITEM_FLAG,i.*
from SAL_INVOICES_ITEMS i ;
Wednesday, September 16, 2020
Oracle Forms add_list_element
ADD_LIST_ELEMENT built-in
Description
Adds a single element to a list item.
Syntax
PROCEDURE ADD_LIST_ELEMENT (list_name VARCHAR2, list_index, NUMBER list_label VARCHAR2, list_value NUMBER);
PROCEDURE ADD_LIST_ELEMENT (list_id ITEM,
list_index VARCHAR2, list_label VARCHAR2, list_value NUMBER);
Built-in Type unrestricted procedure
Enter Query Mode yes
Parameters
list_id Specifies the unique ID that Form Builder assigns when it creates the list
item. Use the FIND_ITEM built-in to return the ID to an appropriately
typed variable. The data type of the ID is ITEM.
list_name The name you gave to the list item when you created it. The data type of
the name is VARCHAR2.
list_index (counter) Specifies the list index value. The list index is 1 based.
list_label Specifies the VARCHAR2 string that you want displayed as the label of the
list element.
list_value The actual list element value you intend to add to the list item.
------------------------
ADD_LIST_ELEMENT restrictions
For a base table list with the List Style property set to Poplist or T-list, Form Builder does not allow you to add another values element when the block contains queried or changed records. Doing so causes an error. This situation can occur if you have previously used DELETE_LIST_ELEMENT or CLEAR_LIST to remove the other values element that was specified at design time by the Mapping of Other Values list item property setting.
Note: The block status is QUERY when a block contains queried records. The block status is CHANGED when a block contains records that have been either inserted or updated.
ADD_LIST_ELEMENT Example:
------
PROCEDURE YLISTE IS
cursor c is
select CODES_ID,
USER_CODE ||' - '||
DECODE(GET_USER_LANG(:GLOBAL.LANGUAGE_ID), 'P', PRIMARY_NAME, SECONDARY_NAME) ITEM_NAME
from codes where code_types_id = 583007;
cnt number := 1;
it_id ITEM;
begin
it_id := Find_Item('SAL_INVOICES.DRIVER_ID');
clear_list(it_id);
for i in c loop
add_list_element(it_id,cnt,i.ITEM_NAME,i.CODES_ID);
cnt := cnt + 1;
end loop;
end;
-----------
Yasser
Tuesday, September 15, 2020
Oracle With Clause Syntax and Examples :
Oracle With Clause Syntax and Examples :
In this section i would like to explain the syntax as well as examples of With clause in oracle.Before checking the syntax and examples of With clause in oracle let us first check some important bullet points of With Clause :
With Clause in Oracle is released in Oracle 9i release 2 to improve the performance of complex sql queries.
The clause works like a global temporary tables of oracle which is used to improve the query speed of complex sql queries.
This technique is also called as sub-query factoring as it is used to De-factor the subqueries.
With clause in oracle is not supported by all oracle versions ,the oracle version 9i and beyond versions.
When sub-query needs to be executed multiple times at that time With clause is used.
The name which is assigned to the sub-query is treated as though it was an inline view or table.
The With Clause is useful in Recursive queries as well.
WITH
items_costs AS (
SELECT items_id, SUM(UNIT_COST) items_total
FROM STOCK_IN_DOCUMENTS_ITEMS e, STOCK_IN_DOCUMENTS d
WHERE e.document_id = d.document_id
and e.STORES_ID = d.STORES_ID
GROUP BY items_id),
avg_cost AS (
SELECT SUM(items_total)/COUNT(*) avg
FROM items_costs)
SELECT *
FROM items_costs
WHERE items_total > (SELECT avg FROM avg_cost)
ORDER BY items_id;


