arc

The Automotive Adaptive Front Lighting Market is LED by Europe, as per Maximize Market Research.

(EMAILWIRE.COM, October 30, 2024 ) Growing vehicle manufacturing is driving the need for enhanced lighting systems worldwide. Increased visibility during nighttime decreases accidents, prompting more stringent regulations and greater consumer demand for these safety systems. Adaptive headlights are...




arc

The Rainwater Harvesting Market is dominated by Roof-based harvesting, as per Maximize Market Research.

(EMAILWIRE.COM, October 30, 2024 ) Due to growing water scarcity and environmental worries, the rainwater harvesting market offers a substantial potential for expansion. The increasing importance of alternative water sources is expected to lead to a rise in the use of rainwater harvesting systems...




arc

Butadiene Market was is expected to grow $50.93 Bn by 2030, as per Maximize Market Research.

(EMAILWIRE.COM, October 31, 2024 ) The Butadiene market is expected to reach US$ 50.93 Bn. in 2030, with a CAGR of 4.4% for the period 2024-2030, because of growing demand in the tire industry. The butadiene market, a key component in synthetic rubber and automotive parts, is navigating a complex...




arc

Automotive Adaptive Front Lighting Market was is expected to grow $6.55 Bn by 2030, as per Maximize Market Research.

(EMAILWIRE.COM, October 31, 2024 ) Automotive Adaptive Front Lighting Market is expected to grow at a CAGR of 27.8% throughout the forecast period, to reach US$ 6.55 Bn. by 2030 The global automotive adaptive front lighting market is on the rise, driven by increasing safety concerns and consumer...




arc

Digital Instrument Cluster Market Growth Accelerates with Rising Demand in Automotive Sector, as per Maximize Market Research.

(EMAILWIRE.COM, November 01, 2024 ) The global Digital Instrument Cluster market is witnessing rapid growth, fueled by increasing demand for advanced automotive displays and enhanced in-car experiences. Driven by advancements in digital interfaces, these clusters provide customizable, high-resolution...




arc

The Cloud High Performance Computing Market Set for Rapid Growth as Demand Surges, as per Maximize Market Research.

(EMAILWIRE.COM, November 01, 2024 ) The global Cloud High Performance Computing (HPC) market is poised for significant expansion, driven by growing demands in industries such as healthcare, finance, and automotive. Cloud HPC enables businesses to perform complex computations and simulations faster...




arc

Europe Wireless Headphones Market Expands as Demand for High-Quality Audio and Mobility Grows, as per Maximize Market Research.

(EMAILWIRE.COM, November 01, 2024 ) The Europe Wireless Headphones market is experiencing substantial growth, driven by rising consumer preference for high-quality audio and seamless mobility. With advancements in noise-canceling technology, battery life, and Bluetooth connectivity, wireless headphones...




arc

Artificial Intelligence (AI) Chipset Market is expected to grow at 40% CAGR from 2024 to 2030, as per Maximize Market Research

(EMAILWIRE.COM, November 01, 2024 ) Artificial Intelligence Chipset Market size was valued US$ 20.76 Bn in 2023 and the total revenue is expected to grow at 40% from 2024 to 2030, reaching US$ 218.85 Bn. by 2030. The AI chipset market is experiencing rapid growth, driven by increasing adoption...




arc

Automotive Microcontrollers Market is dominated by Asia Pacific as per Maximize Market Research

(EMAILWIRE.COM, November 01, 2024 ) Automotive Microcontrollers Market is expected to reach US$ 22.93 Bn. by 2030, at a CAGR of 8.2% during the forecast period. The automotive microcontroller market is experiencing significant growth, driven by the increasing integration of electronics in vehicles....




arc

Aliphatic Amines Market Expands Due to Demand in Agriculture and Chemical Manufacturing, as per Maximize Market Research

(EMAILWIRE.COM, November 03, 2024 ) Aliphatic Amines Market are substances created through displacement reaction within an ammonia molecule. Monovalent hydrocarbon radicals replaced the hydrogen atoms in ammonia in Aliphatic Amines. The analysis in the report examines how the COVID-19 pandemic...




arc

23 Butanediol Market Sees Expansion with Increased Demand in Chemical Manufacturing, as per Maximize Market Research

(EMAILWIRE.COM, November 03, 2024 ) The Global 23 Butanediol Market is experiencing growth due to its rising demand in the chemical and industrial sectors. Used widely as an intermediate in the production of plastics, textiles, and pharmaceuticals, 23 Butanediol is essential in high-performance material...




arc

Antimicrobial Susceptibility Testing Market Expands as Need for Effective Infection Control Rises, as per Maximize Market Research

(EMAILWIRE.COM, November 03, 2024 ) The Antimicrobial Susceptibility Testing Market is experiencing growth due to rising concerns over antibiotic resistance and infection control. AST systems help healthcare providers determine the most effective treatments for infections, improving patient outcomes....




arc

Aluminum Flat Rolled Products Market Sees Strong Growth with Demand from Automotive and Construction Sectors, as per Maximize Market Research

(EMAILWIRE.COM, November 04, 2024 ) The Aluminum Flat Rolled Products Market is set for expansion as demand rises in automotive, construction, and packaging industries. Aluminum’s lightweight and corrosion-resistant properties make it ideal for use in energy-efficient vehicles and sustainable buildings....




arc

Agricultural Tractors Market Expands with Demand for Precision Farming, as per Maximize Market Research

(EMAILWIRE.COM, November 04, 2024 ) The Global Agricultural Tractors Market is growing, fueled by a demand for precision farming and advanced agricultural machinery. Modern tractors equipped with GPS, AI, and automation technology are transforming farm efficiency, reducing labor, and increasing yield....




arc

Apron Bus Market Grows with Expanding Air Travel and Airport Operations, as per Maximize Market Research

(EMAILWIRE.COM, November 04, 2024 ) The Global Apron Bus Market is expanding, supported by the growth in air travel and the need for efficient airport ground operations. Apron buses transport passengers between terminals and aircraft, ensuring smooth and timely boarding. Key manufacturers are innovating...




arc

AI in Fashion Market Grows as Industry Embraces Digital Transformation, as per Maximize Market Research

(EMAILWIRE.COM, November 05, 2024 ) The Global AI in Fashion Market is expanding rapidly, with brands leveraging AI to enhance design, personalization, and inventory management. From predictive analytics to virtual try-ons, AI is revolutionizing consumer engagement and operational efficiency. Fashion...




arc

Aerostat Systems Market Gains Traction in Defense and Surveillance Applications, as per Maximize Market Research

(EMAILWIRE.COM, November 05, 2024 ) An Aerostat Systems Market is an aircraft lighter than air that achieves lift with the help of a buoyant gas. Aerostat systems consist of unpowered balloons as well as powered airships. A balloon can fly freely or be anchored. Request For Free Sample Report...




arc

Exoskeleton Market Poised for Growth with Demand in Healthcare and Industrial Sectors, as per Maximize Market Research

(EMAILWIRE.COM, November 05, 2024 ) The Exoskeleton Market is projected to grow rapidly, driven by applications in healthcare rehabilitation and industrial productivity. Exoskeletons enhance mobility for those with disabilities and improve worker efficiency and safety in industries such as manufacturing...




arc

Market Research Insight: India's Drone Market on a High-Flying Growth Trajectory

(EMAILWIRE.COM, November 12, 2024 ) The India Drone Market is witnessing a remarkable surge, with a projected growth from USD 654 million in 2024 to USD 1,437 million by 2029, driven by an impressive CAGR of 17.0%. This growth trajectory indicates a transformative shift in the adoption and application...




arc

***** Search - gov.uk (rank 30)

Headlamp, position lamps, stop lamps, direction indicators, rear registration plate lamp, rear reflector and direction indicator ‘tell-tale’ rules and inspection for motorcycle MOT tests. tag ...




arc

***** Parts search for HG2030AE44 (rank 25)

11 aviation suppliers for HG2030AE44: AeroNed BV, OZSAY.BULGARIA@GMAIL.COM | OZSAY BULGARIA MARINE, Executive Jet Support Ltd, Applied Aerospace Solutions, Setna iO, VC AEROSPACE, Kashyap International, Prime Air, Hawk Aviation Ltd, Fitech Co., Ltd. Home; Find Parts; Find MROs; Our Members; Join AVspares.com; Advertising; About Us; Sign In . Part Number: Search For Multiple Parts. Search ...




arc

***** Parts search for P109P41 (rank 23)

13 aviation suppliers for P109P41: Vision Aeronautics LLC, AeroTech Global, Aero Engine Services Ltd, Ansett Aircraft Spares & Services, Kashyap International, PDQ Airspares Ltd, Prime Air, Hawk Aviation Ltd, European Airline Support, Aile Aviation Services BV




arc

***** Locations Archive - Gama Aviation (rank 29)

25 Templer Avenue, Farnborough. 25 Templer Avenue, Farnborough is home to our Group headquarters and is the nerve centre for the European Air division. With excellent access to the facilities at the airport. Read more.




arc

Heart Attack (Myocardial Infarction)

Title: Heart Attack (Myocardial Infarction)
Category: Diseases and Conditions
Created: 12/31/1997 12:00:00 AM
Last Editorial Review: 5/12/2022 12:00:00 AM




arc

Marc Timmer: Günther muss diese verunglückte Reform sofort stoppen!




arc

Spybot Search and Destroy Update November 13, 2024

The Spybot Search and Destroy Update is intended for updating your detections without the need for the included WebUpdate. To update you need to download and double-click spybotsd_includes.exe, choose the folder that Spybot is installed to, click OK and close when completed. [License: Freeware | Requires: 11|10|8|7 | Size: 8 MB ]




arc

Google Enters Another Market (Custom Search)

Everyone on the Internet fears the day that Google will enter their market. Today the fear was tangible for Rollyo and Swicki. The Financial Times reported that Google will launch tomorrow (Tuesday) "...a customisable search engine that users can carry on their own blogs and other websites..." and compares the new service to Rollyo.

Matthew Ingram carries the photo of a shark on his post about this development. Ingram points out that when Google entered the calendar market, competitor Kiko gave up and sold themselves. He asks whether or not this was the right decision -- pointing to Paul Graham's post at the time "Google Does Not Render Resistance Futile."

I find myself agreeing with Paul and Rex Hammock puts his finger on it when he writes:

There’s a social networking aspect of Rollyo that probably won’t be a part of the Google product, however the Google product will likely offer publishers, including bloggers, an instant way to monetize narrow search in the Adsense program they’re already participating in.
For all of the things that Google has done right in technology, they have done very little well in the category of social. It isn't too late for them to learn but if history is any guide, they will miss the importance of the social network in search as well.

And frankly having a strong competitor forces you to do the two things which you most need to do in any case when you are a small business -- innovate constantly and be 500% better than your larger competition. Then Google can educate the market about why the market needs your product and then you can deliver on the market's expectations. That is what YouTube did.




arc

The Worst of Marcia Swampfelder




arc

La Chine adopte des politiques fiscales pour soutenir le march� de l'immobilier

La Chine a promulgu� mercredi des politiques fiscales pour soutenir le d�veloppement stable et sain du march� de l'immobilier. Le minist�re des Finances a d�clar� que le pays augmenterait les incitations en termes de taxe sur les actes pour...




arc

12C: IN DATABASE ARCHIVING

In this post, I will demonstrate a new feature introduced in 12c : In database archiving. It enables you to archive rows within a table by marking them as invisible. This is accomplshed  by means of a hidden column ORA_ARCHIVE_STATE. These invisible rows are not visible to the queries but if needed, can be viewed , by setting a session parameter ROW ARCHIVAL VISIBILITY.

Overview:

-- Create test user uilm, tablespace ilmtbs
-- Connect as user uilm
-- create and populate test table (5 rows) ilmtab with row archival clause
-- Note that the table has an additional column ORA_ARCHIVE_STATE automatically created   and has the default value of 0 (indicates that row is active)
-- Note that this column is not visible when we describe the table or simply issue select * from ...
-- We need to access data dictionary to view the column
-- Make two  rows in the table inactive by setting ORA_ARCHIVE_STATE column to a non zero value.
-- Check that inactive rows are not visible to query
-- Set the parameter ROW ARCHIVAL VISIBILITY  = all to see inactive rows also
-- Set the parameter ROW ARCHIVAL VISIBILITY  = active to hide inactive rows
-- Issue an insert into ... select * and check that only 3 visible rows are inserted
-- Set the parameter ROW ARCHIVAL VISIBILITY  = all to see inactive rows also
-- Issue an insert into ... select * and check that all the rows are inserted but ORA_ARCHIVE_STATE    is not propagated in inserted rows
-- Disable row archiving in the table and check that column ORA_ARCHIVE_STATE is automatically dropped
-- drop tablespace ilmtbs and user uilm

Implementation :

-- Create test user, tablespace and test table
SQL> conn sys/oracle@em12c:1523/pdb1 as sysdba
sho con_name

CON_NAME
------------------------------
PDB1

SQL> set sqlprompt PDB1>

PDB1>create tablespace ilmtbs datafile '/u02/app/oracle/oradata/cdb1/pdb1/ilmtbs01.dbf' size 1m;
grant connect, resource, dba  to uilm identified by oracle;
alter user uilm default tablespace ilmtbs;

conn uilm/oracle@em12c:1523/pdb1
sho con_name

CON_NAME
------------------------------
PDB1
-- create table with "row archival clause"
PDB1>drop table ilmtab purge;
create table ilmtab (id number, txt char(15)) row archival;
insert into ilmtab values (1, 'one');
insert into ilmtab values (2, 'two');
insert into ilmtab values (3, 'three');
insert into ilmtab values (4, 'four');
insert into ilmtab values (5, 'five');
commit;
-- Note that the table has an additional column ORA_ARCHIVE_STATE automatically created    and has the default value of 0 (indicates that row is active)
PDB1>col ora_archive_state for a20
select id, txt, ora_archive_state from ilmtab;

ID TXT             ORA_ARCHIVE_STATE
---------- --------------- --------------------
1 one             0
2 two             0
3 three           0
4 four            0
5 five            0
-- Note that this column is not visible when we describe the table or simply issue select * from ...
PDB1>desc ilmtab
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
ID                                                 NUMBER
TXT                                                CHAR(15)

PDB1>select * from ilmtab;

ID TXT
---------- ---------------
1 one
2 two
3 three
4 four
5 five
-- Since the column is invisible, let me try and make it visible
-- Note that Since the column is maintained by oracle itself, user can't modify its attributes
PDB1>alter table ilmtab modify (ora_archive_state visible);
alter table ilmtab modify (ora_archive_state visible)
*
ERROR at line 1:
ORA-38398: DDL not allowed on the system ILM column
-- We need to access data dictionary to view the column
-- Note that this column is shown as hidden and has not been generated by user
PDB1>col hidden for a7
col USER_GENERATED for 20
col USER_GENERATED for a20

select TABLE_NAME, COLUMN_NAME, HIDDEN_COLUMN, USER_GENERATED
from user_tab_cols where table_name='ILMTAB';

TABLE_NAME  COLUMN_NAME          HID USER_GENERATED
----------- -------------------- --- --------------------
ILMTAB      ORA_ARCHIVE_STATE    YES NO
ILMTAB      ID                   NO  YES
ILMTAB      TXT                  NO  YES
-- We can make selected rows in the table inactive by setting ORA_ARCHIVE_STATE column to a non zero value.
This can be accomplished using update table... set ORA_ACRHIVE_STATE =
. <non-zero value>
. dbms_ilm.archivestatename(1)

-- Let's update row with id =1 with ORA_ARCHIVE_STATE=2
     and update row with id =2 with dbms_ilm.archivestatename(2)
PDB1>update ilmtab set ora_archive_state=2 where id=1;

update ilmtab set ora_archive_state= dbms_ilm.archivestatename(2) where id=2;
-- Let's check whether updates have been successful and hidden rows are not visible
PDB1>select id, txt, ORA_ARCHIVE_STATE from ilmtab;

ID TXT             ORA_ARCHIVE_STATE
---------- --------------- --------------------
3 three           0
4 four            0
5 five            0
-- The updated rows are not visible!!
-- Quite logical since we have made the rows active and by default only active rows are visible

-- To see inactive rows also, we need to set the parameter ROW ARCHIVAL VISIBILITY  = all at session level
-- Note that the column ORA_ARCHIVE_STATE has been set to 1 for id =2 although we had set it to 2 using
dbms_ilm.archivestatename(2)
PDB1>alter session set ROW ARCHIVAL VISIBILITY  = all;
select id, txt, ORA_ARCHIVE_STATE from ilmtab;

ID TXT             ORA_ARCHIVE_STATE
---------- --------------- --------------------
1 one             2
2 two             1
3 three           0
4 four            0
5 five            0
-- Note that the column ORA_ARCHIVE_STATE has been set to 1 for id =2 although we had set it to 2 using    dbms_ilm.archivestatename(2)

-- Let's find out why
-- Note that The function dbms_ilm.archivestatename(n) returns only two values    0 for n=0 and 1 for  n <> 0
PDB1>col state0 for a8
col state1 for a8
col state2 for a8
col state3 for a8

select dbms_ilm.archivestatename(0) state0 ,dbms_ilm.archivestatename(1) state1,
dbms_ilm.archivestatename(2) state2,dbms_ilm.archivestatename(3) state3  from dual;

STATE0   STATE1   STATE2   STATE3
-------- -------- -------- --------
0        1        1        1
-- In order to make the inactive rows (id=1,2) hidden again, we need to set the parameter ROW ARCHIVAL VISIBILITY  = Active
PDB1>alter session set row archival visibility = active;
select id, txt, ORA_ARCHIVE_STATE from ilmtab;

ID TXT             ORA_ARCHIVE_STATE
---------- --------------- --------------------
3 three           0
4 four            0
5 five            0
-- Let's issue an insert into ... select *
-- Note that only 3 new rows are visible
PDB1>insert into ilmtab select * from ilmtab;

select id, txt, ora_archive_state from ilmtab;

ID TXT             ORA_ARCHIVE_STATE
---------- --------------- --------------------
3 three           0
4 four            0
5 five            0
3 three           0
4 four            0
5 five            0

6 rows selected.
-- I want to check if hidden rows were also inserted
-- Let's check by making  hidden rows visible again
-- Note that only visible rows(id=3,4,5) were inserted
PDB1>alter session set row archival visibility=all;
select id, txt, ora_archive_state from ilmtab;

ID TXT             ORA_ARCHIVE_STATE
---------- --------------- --------------------
1 one             2
2 two             1
3 three           0
4 four            0
5 five            0
3 three           0
4 four            0
5 five            0

8 rows selected.
-- Let's set row archival visibility = all and then again insert rows from ilmtab
-- Note that all the 8 rows are inserted but ORA_ARCHIVE_STATE ha not been copied    ORA_ARCHIVE_STATE <> 0 in only 2 records (id = 1,2) even now.
PDB1>alter session set row archival visibility=all;
insert into ilmtab select * from ilmtab;
select id, txt, ora_archive_state from ilmtab order by id;

ID TXT             ORA_ARCHIVE_STATE
---------- --------------- --------------------
1 one             0
1 one             2
2 two             0
2 two             1
3 three           0
3 three           0
3 three           0
3 three           0
4 four            0
4 four            0
4 four            0
4 four            0
5 five            0
5 five            0
5 five            0
5 five            0

16 rows selected.
-- Disable row level archiving for the table
-- Note that as soon as row archiving is disabled, pseudo column ora_archive_state is dropped automatically
PDB1>alter table ilmtab no row archival;
select id, txt, ORA_ARCHIVE_STATE from ilmtab;

ERROR at line 1:
ORA-00904: "ORA_ARCHIVE_STATE": invalid identifier

PDB1>col hidden for a7
col USER_GENERATED for 20
col USER_GENERATED for a20

select TABLE_NAME, COLUMN_NAME, HIDDEN_COLUMN, USER_GENERATED
from user_tab_cols where table_name='ILMTAB';

TABLE_NAME  COLUMN_NAME          HID USER_GENERATED
----------- -------------------- --- --------------------
ILMTAB      ID                   NO  YES
ILMTAB      TXT                  NO  YES
Note : Had we created this table using sys, we could not have disabled row archiving .

-- cleanup --
PDB1>conn sys/oracle@em12c:1523/pdb1 as sysdba
drop tablespace ilmtbs including contents and datafiles;
drop user uilm cascade;
References:

http://docs.oracle.com/cd/E16655_01/server.121/e17613/part_lifecycle.htm#VLDBG14154

----------------------------------------------------------------------------------------------------

Oracle 12c Index

----------------------------------------------------------------------------------------------

 




arc

Recursive WITH, part II: Hierarchical queries

articles: 

In my last post, I looked at using recursive WITH to implement simple recursive algorithms in SQL. One very common use of recursion is to traverse hierarchical data. I recently wrote a series of posts on hierarchical data, using Oracle’s CONNECT BY syntax and a fun example. In this post, I’ll be revisiting the same data using recursive WITH.

There are dozens of examples of hierarchical data, from the EMP table to the Windows Registry to binary trees, but I went with something more fun: the skeleton from the old song “Dem Dry Bones”.

Quote:
Toe bone connected to the foot bone
Foot bone connected to the heel bone
Heel bone connected to the ankle bone
Ankle bone connected to the shin bone
Shin bone connected to the knee bone
Knee bone connected to the thigh bone
Thigh bone connected to the hip bone
Hip bone connected to the back bone
Back bone connected to the shoulder bone
Shoulder bone connected to the neck bone
Neck bone connected to the head bone

Since every bone has only one ancestor, and there is a root bone with no ancestor, this is hierarchical data and we can stick it in a table and query it.

SELECT * FROM skeleton;
BONE                                     CONNECTED_TO_THE
---------------------------------------- ----------------------------------------
shoulder                                 neck
back                                     shoulder
hip                                      back
thigh                                    hip
knee                                     thigh
leg                                      knee
foot                                     heel
head
neck                                     head
toe                                      foot
arm                                      shoulder
wrist                                    arm
ankle                                    leg
heel                                     ankle
finger                                   wrist
a rib                                    back
b rib                                    back
c rib                                    back

You can see that I added some ribs and an arm to make the skeleton more complete!

Using Oracle’s CONNECT BY syntax:

SQL> col bone FOR a10
SQL> col connected_to_the FOR a9
SQL> col level FOR 99
SQL> col bone_tree FOR a27
SQL> col path FOR a65
 
SELECT bone, connected_to_the, level, 
lpad(' ',2*level, ' ') || bone AS bone_tree , 
ltrim(sys_connect_by_path(bone,'>'),'>') AS path
FROM skeleton
START WITH connected_to_the IS NULL
CONNECT BY prior bone=connected_to_the 
ORDER siblings BY 1

BONE       CONNECTED LEVEL BONE_TREE                   PATH
---------- --------- ----- --------------------------- -----------------------------------------------------------------
head                     1   head                      head
neck       head          2     neck                    head>neck
shoulder   neck          3       shoulder              head>neck>shoulder
arm        shoulder      4         arm                 head>neck>shoulder>arm
wrist      arm           5           wrist             head>neck>shoulder>arm>wrist
finger     wrist         6             finger          head>neck>shoulder>arm>wrist>finger
back       shoulder      4         back                head>neck>shoulder>back
a rib      back          5           a rib             head>neck>shoulder>back>a rib
b rib      back          5           b rib             head>neck>shoulder>back>b rib
c rib      back          5           c rib             head>neck>shoulder>back>c rib
hip        back          5           hip               head>neck>shoulder>back>hip
thigh      hip           6             thigh           head>neck>shoulder>back>hip>thigh
knee       thigh         7               knee          head>neck>shoulder>back>hip>thigh>knee
leg        knee          8                 leg         head>neck>shoulder>back>hip>thigh>knee>leg
ankle      leg           9                   ankle     head>neck>shoulder>back>hip>thigh>knee>leg>ankle
heel       ankle        10                     heel    head>neck>shoulder>back>hip>thigh>knee>leg>ankle>heel
foot       heel         11                       foot  head>neck>shoulder>back>hip>thigh>knee>leg>ankle>heel>foot
toe        foot         12                         toe head>neck>shoulder>back>hip>thigh>knee>leg>ankle>heel>foot>toe

The above CONNECT BY query uses the LEVEL pseudocolumn and the SYS_CONNECT_BY_PATH function. With recursive WITH, there’s no need for these built-ins because these values fall naturally out of the recursion.

Let’s start with the basic hierarchical query rewritten in recursive WITH.
The hierarchical relationship in our table is:
Parent(row.bone) = row.connected_to_the

WITH skellarchy (bone, parent) AS
 ( SELECT bone, connected_to_the FROM skeleton 
   WHERE bone = 'head'                         -- Start with the root
 UNION ALL
   SELECT s.bone, s.connected_to_the 
   FROM skeleton s, skellarchy r
   WHERE r.bone = s.connected_to_the           -- Parent(row.bone) = row.connected_to_the
 )
SELECT * FROM skellarchy;

BONE       PARENT
---------- ----------------------------------------
head
neck       head
shoulder   neck
back       shoulder
arm        shoulder
hip        back
wrist      arm
a rib      back
b rib      back
c rib      back
thigh      hip
finger     wrist
knee       thigh
leg        knee
ankle      leg
heel       ankle
foot       heel
toe        foot

Because we built up the SKELLARCHY table recursively, it’s easy to make an equivalent to the LEVEL pseudocolumn; it falls right out of the recursion:

WITH skellarchy (bone, parent, the_level) AS
 ( SELECT bone, connected_to_the, 0 FROM skeleton 
   WHERE bone = 'head'                         
 UNION ALL
   SELECT s.bone, s.connected_to_the , r.the_level + 1
   FROM skeleton s, skellarchy r
   WHERE r.bone = s.connected_to_the           
 )
SELECT * FROM skellarchy;

BONE       PARENT      THE_LEVEL
---------- ---------- ----------
head                           0
neck       head                1
shoulder   neck                2
back       shoulder            3
arm        shoulder            3
hip        back                4
wrist      arm                 4
a rib      back                4
b rib      back                4
c rib      back                4
thigh      hip                 5
finger     wrist               5
knee       thigh               6
leg        knee                7
ankle      leg                 8
heel       ankle               9
foot       heel               10
toe        foot               11

and it’s also easy to build up a path from root to the current node like the “SYS_CONNECT_BY_PATH” function does for CONNECT BY queries:

WITH skellarchy (bone, parent, the_level, the_path) AS
 ( SELECT bone, connected_to_the, 0, CAST(bone AS varchar2(4000)) FROM skeleton 
   WHERE bone = 'head'                         
 UNION ALL
   SELECT s.bone, s.connected_to_the , r.the_level + 1, r.the_path || '->' || s.bone
   FROM skeleton s, skellarchy r
   WHERE r.bone = s.connected_to_the           
 )
SELECT * FROM skellarchy;

BONE       PARENT     THE_LEVEL THE_PATH
---------- ---------- --------- --------------------------------------------------------------------------------
head                          0 head
neck       head               1 head->neck
shoulder   neck               2 head->neck->shoulder
back       shoulder           3 head->neck->shoulder->back
arm        shoulder           3 head->neck->shoulder->arm
hip        back               4 head->neck->shoulder->back->hip
wrist      arm                4 head->neck->shoulder->arm->wrist
a rib      back               4 head->neck->shoulder->back->a rib
b rib      back               4 head->neck->shoulder->back->b rib
c rib      back               4 head->neck->shoulder->back->c rib
thigh      hip                5 head->neck->shoulder->back->hip->thigh
finger     wrist              5 head->neck->shoulder->arm->wrist->finger
knee       thigh              6 head->neck->shoulder->back->hip->thigh->knee
leg        knee               7 head->neck->shoulder->back->hip->thigh->knee->leg
ankle      leg                8 head->neck->shoulder->back->hip->thigh->knee->leg->ankle
heel       ankle              9 head->neck->shoulder->back->hip->thigh->knee->leg->ankle->heel
foot       heel              10 head->neck->shoulder->back->hip->thigh->knee->leg->ankle->heel->foot
toe        foot              11 head->neck->shoulder->back->hip->thigh->knee->leg->ankle->heel->foot->toe

and we can use our generated the_level column to make a nice display just as we used the level pseudocolumn with CONNECT BY:

WITH skellarchy (bone, parent, the_level) AS
 ( SELECT bone, connected_to_the, 0  FROM skeleton 
   WHERE bone = 'head'                         
 UNION ALL
   SELECT s.bone, s.connected_to_the , r.the_level + 1
   FROM skeleton s, skellarchy r
   WHERE r.bone = s.connected_to_the           
 )
SELECT lpad(' ',2*the_level, ' ') || bone AS bone_tree FROM skellarchy;

BONE_TREE
---------------------------
head
  neck
    shoulder
      back
      arm
        hip
        wrist
        a rib
        b rib
        c rib
          thigh
          finger
            knee
              leg
                ankle
                  heel
                    foot
                      toe

Now, the bones are coming out in a bit of a funny order for a skeleton. Instead of this:

    shoulder
      back
      arm
        hip
        wrist
        a rib
        b rib
        c rib
          thigh
          finger

I want to see this:

    shoulder
      arm
        wrist
          finger
      back
        a rib
        b rib
        c rib
        hip
          thigh

The rows are coming out in BREADTH FIRST ordering – meaning all siblings of ‘shoulder’ are printed before any children of ‘shoulder’. But I want to see them in DEPTH FIRST: going from shoulder to finger before we start on the backbone.

WITH skellarchy (bone, parent, the_level) AS
 ( SELECT bone, connected_to_the, 0  FROM skeleton 
   WHERE bone = 'head'                         
 UNION ALL
   SELECT s.bone, s.connected_to_the , r.the_level + 1
   FROM skeleton s, skellarchy r
   WHERE r.bone = s.connected_to_the           
 )
SEARCH DEPTH FIRST BY bone SET bone_order
SELECT lpad(' ',2*the_level, ' ') || bone AS bone_tree FROM skellarchy
ORDER BY bone_order;

BONE_TREE
---------------------------
head
  neck
    shoulder
      arm
        wrist
          finger
      back
        a rib
        b rib
        c rib
        hip
          thigh
            knee
              leg
                ankle
                  heel
                    foot
                      toe

And now the result looks more like a proper skeleton.

Now on to cycles. A cycle is a loop in the hierarchical data: a row is its own ancestor. To put a cycle in the example data, I made the skeleton bend over and connect the head to the toe:

UPDATE skeleton SET connected_to_the='toe' WHERE bone='head';

And now if we try to run the query:

ERROR at line 2:
ORA-32044: cycle detected while executing recursive WITH query

With the CONNECT BY syntax, we can use CONNECT BY NOCYCLE to run a query even when cycles exist, and the pseudocolumn CONNECT_BY_IS_CYCLE to help detect cycles. For recursive WITH, Oracle provides a CYCLE clause, which is a bit more powerful as it allows us to name the column which is cycling.

WITH skellarchy (bone, parent, the_level) AS
 ( SELECT bone, connected_to_the, 0  FROM skeleton 
   WHERE bone = 'head'                         
 UNION ALL
   SELECT s.bone, s.connected_to_the , r.the_level + 1
   FROM skeleton s, skellarchy r
   WHERE r.bone = s.connected_to_the           
 )
SEARCH DEPTH FIRST BY bone SET bone_order
CYCLE bone SET is_a_cycle TO 'Y' DEFAULT 'N'
SELECT lpad(' ',2*the_level, ' ') || bone AS bone_tree, is_a_cycle FROM skellarchy
--where is_a_cycle='N'
ORDER BY bone_order;

BONE_TREE                                                    I
------------------------------------------------------------ -
head                                                         N
  neck                                                       N
    shoulder                                                 N
      arm                                                    N
        wrist                                                N
          finger                                             N
      back                                                   N
        a rib                                                N
        b rib                                                N
        c rib                                                N
        hip                                                  N
          thigh                                              N
            knee                                             N
              leg                                            N
                ankle                                        N
                  heel                                       N
                    foot                                     N
                      toe                                    N
                        head                                 Y

The query runs until the first cycle is detected, then stops.

The CONNECT BY syntax does provide a nice pseudocolumn, CONNECT_BY_ISLEAF, which is 1 when a row has no further children, 0 otherwise. In my next post, I’ll look at emulating this pseudocolumn with recursive WITH.


Republished with permission. Original URL: http://rdbms-insight.com/wp/?p=103




arc

vaste stok presto ignition a60 13 m gis larc

hengel preston ignition a 60 13 m. de eigenschappen van deze hengel is suncore fusion en magic steps. ook nog larc en gis systeem. 2 topsets van 5 delen. ook nog kokers bij geleverd. 3 keer mee gevist zo goed als nieuw dus.weg wegens niet meer vissen op het kanaal.advies prijs is 1799 euro.je mag bieden vanaf 750 euro vindt ik een goede prijs.




arc

Scouting The NBA DFS - Tuesday, March 22 (Premium)

A good-looking 4-game slate of NBA action tonight, and the Daily DFS Breakdown will help you cash on DraftKings and FanDuel




arc

Scouting The NBA DFS - Tuesday, March 22 (Free Preview)

Fantasy Basketball Expert Nate Weitzer will help you cash with your DFS NBA lineups. This is a free preview of his PREMIUM NBA DFS Rundown!




arc

Kickman's NHL DFS Picks (Tuesday, March 22)

FullTime Fantasy Sports continues to expand its Fantasy coverage and now with a PREMIUM membership, you earn access to Kickman's NHL DFS picks all season long!




arc

NBA DFS Projections - March 22 (Free Preview)

Check out a preview of our daily NBA DFS projections in the forums, part of a new DFS package exclusively created for #FullTimeArmy!




arc

The Fantasy Exec's NBA DFS Advice - March 22

Corey Parson aka The Fantasy Executive delivers two players to build your NBA DFS teams around tonight.




arc

Scouting The NBA DFS - Wednesday, March 23 (Premium)

One of the last big slates of the NBA season is on the docket this Wednesday, so cash in on DraftKings and FanDuel with our top DFS plays




arc

Scouting The NBA DFS - Wednesday, March 23 (Free Preview)

Fantasy Basketball Expert Nate Weitzer will help you cash with your DFS NBA lineups. This is a free preview of his PREMIUM NBA DFS Rundown!




arc

NBA DFS Projections - March 23 (Free Preview)

Check out a preview of our daily NBA DFS projections in the forums, part of a new DFS package exclusively created for #FullTimeArmy!




arc

Scouting The NBA DFS - Thursday, March 24 (Premium)

We look at this 5-game slate of NBA action and bring you the best options for your DFS lineups on DraftKings and FanDuel




arc

Kickman's NHL DFS Picks - Thursday, March 24 (Free Preview)

FullTime Fantasy Sports continues to expand its Fantasy coverage and now with a PREMIUM membership, you earn access to Kickman's NHL DFS picks all season long!




arc

Scouting The NBA DFS - Friday, March 25 (Free Preview)

Fantasy Basketball Expert Nate Weitzer will help you cash with your DFS NBA lineups. This is a free preview of his PREMIUM NBA DFS Rundown!




arc

Scouting The NBA DFS - Friday, March 25 (Premium)

There's a huge slate of NBA action tonight and we bring you the top values, plays, and games to target for your DraftKings and FanDuel lineups




arc

NBA DFS Projections - March 25 (Free Preview)

Check out a preview of our daily NBA DFS projections in the forums, part of a new DFS package exclusively created for #FullTimeArmy!




arc

Scouting The NBA DFS - Saturday, March 26 (Premium)

There is a 9-game slate of NBA action on Saturday night and there are tons of value plays to help you craft balanced DFS lineups on DraftKings and FanDuel




arc

Scouting The NBA DFS - Saturday, March 26 (Free Preview)

Fantasy Basketball Expert Nate Weitzer will help you cash with your DFS NBA lineups. This is a free preview of his PREMIUM NBA DFS Rundown!




arc

Kickman's NHL DFS Picks (Saturday, March 26)

FullTime Fantasy Sports continues to expand its Fantasy coverage and now with a PREMIUM membership, you earn access to Kickman's NHL DFS picks all season long!




arc

NBA DFS Projections - March 26 (Free Preview)

Check out a preview of our daily NBA DFS projections in the forums, part of a new DFS package exclusively created for #FullTimeArmy!




arc

Scouting The NBA DFS - Sunday, March 27 (Premium)

We break down this 4-game slate of NBA action with the top plays for your DFS lineups on DraftKings and FanDuel