SlideShare a Scribd company logo
1 of 32
1
12c
2
the focus ...
the day to day stuff
Feature
invisible columns
have been there "forever"
function based indexes
set column unused
SQL> create table T
2 ( x int,
3 y int);
Table created.
SQL> create index IX on T (x+0);
Index created.
SQL> alter table T set unused column Y;
Table altered.
SQL> select column_name, data_default
2 from USER_TAB_COLS
3 where table_name = 'T'
4 order by column_id;
COLUMN_NAME DATA_DEFAULT
------------------------------ ----------------
X
SYS_NC00003$ "X"+0
SYS_C00002_14020720:50:28$
now exposed to us
SQL> create table T ( c1 int, c2 int, c3 int );
SQL> desc T
Name Null? Type
---------------------------- -------- -------
C1 NUMBER(38)
C2 NUMBER(38)
C3 NUMBER(38)
SQL> alter table T modify c1 invisible;
SQL> desc T
Name Null? Type
---------------------------- -------- -------
C2 NUMBER(38)
C3 NUMBER(38)
so what's the appeal ?
rollout new code online
SQL> create table T ( c1 int, c2 int ) ;
Table created.
SQL> create or replace
2 procedure BAD_APP is
3 begin
4 insert into T
5 select object_id, data_object_id
6 from all_objects
7 where rownum < 10;
8 end;
9 /
Procedure created.
SQL> exec BAD_APP;
PL/SQL procedure successfully completed.
new application
SQL> alter table T add c3 int;
Table altered.
SQL> create or replace
2 procedure NEW_APP is
3 begin
4 for i in ( select c1,c2,c3 from T )
5 loop
6 dbms_output.put_line(i.c1);
7 dbms_output.put_line(i.c2);
8 dbms_output.put_line(i.c3);
9 end loop;
10 end;
11 /
Procedure created.
SQL> exec NEW_APP;
28
28
15
15
29
29
25
25
54
PL/SQL procedure successfully completed.
SQL> exec BAD_APP
BEGIN BAD_APP; END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SCOTT.BAD_APP is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL> alter table T modify c3 invisible;
Table altered.
SQL> exec NEW_APP;
28
28
15
15
29
29
25
25
54
PL/SQL procedure successfully completed.
SQL> exec BAD_APP;
PL/SQL procedure successfully completed.
and an idiosyncracy...
SQL> alter table T modify c1 visible;
SQL> desc T
Name Null? Type
---------------------------- -------- -------
C2 NUMBER(38)
C3 NUMBER(38)
C1 NUMBER(38)
requires code discipline
SQL> desc T
Name Null? Type
---------------------- -------- --------------------
C1 NUMBER(38)
C2 NUMBER(38)
C3 NUMBER(38)
SQL> create or replace
2 procedure P is
3 begin
4 insert into T values (1,10,100);
6 end;
SQL> exec P
SQL> select * from T;
C1 C2 C3
---------- ---------- ----------
1 10 100
SQL> alter table T modify c1 invisible;
Table altered.
SQL> alter table T modify c1 visible;
Table altered.
SQL> desc T
Name Null? Type
------------------- -------- --------------------
C2 NUMBER(38)
C3 NUMBER(38)
C1 NUMBER(38)
SQL> exec P
PL/SQL procedure successfully completed.
SQL> select c1,c2,c3 from t;
C1 C2 C3
---------- ---------- ----------
1 10 100
100 1 10
SQL> create or replace
2 procedure FIX_COLS(p_tab varchar2, p_col_list varchar2) is
3 l_col_list varchar2(1000) := p_col_list||',';
4 type clist is table of varchar2(30)
5 index by pls_integer;
6 c clist;
7
8 l_col varchar2(30);
9 l_id int;
10 begin
11 while instr(l_col_list,',') > 1 loop
12 c(c.count+1) := substr(l_col_list,1,instr(l_col_list,',')-1);
13 l_col_list := substr(l_col_list,instr(l_col_list,',')+1);
14 dbms_output.put_line(c(c.count));
15 end loop;
16
17 for i in 1 .. c.count loop
18 loop
19 select column_name
20 into l_col
21 from user_tab_columns
22 where table_name = p_tab
23 and column_id = i;
24
25 exit when l_col = c(i);
26
27 execute immediate 'alter table '||p_tab||' modify '||l_col||' invisible';
28 execute immediate 'alter table '||p_tab||' modify '||l_col||' visible';
29 end loop;
30 end loop;
31 end;
32 /
SQL> exec FIX_COLS('T','C1,C2,C3');
PL/SQL procedure successfully completed.
SQL> desc T
Name Null? Type
---------------------------- -------- -------
C1 NUMBER(38)
C2 NUMBER(38)
C3 NUMBER(38)
tools
SQL> create table T ( c1 int, c2 int invisible);
Table created.
SQL> desc T
Name Null? Type
------------------------- -------- ------------------
C1 NUMBER(38)
SQL> set colinvisible ON
SQL> desc T
Name Null? Type
------------------------- -------- -----------
C1 NUMBER(38)
C2 (INVISIBLE) NUMBER(38)
SQL> alter table T add "C3 (INVISIBLE)" int;
Table altered.
SQL> desc T
Name Null? Type
------------------------- -------- ------------
C1 NUMBER(38)
C3 (INVISIBLE) NUMBER(38)
C2 (INVISIBLE) NUMBER(38)

More Related Content

What's hot (20)

Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011
 
Les10
Les10Les10
Les10
 
Lecture 4 sql {basics keys and constraints}
Lecture 4 sql {basics  keys and constraints}Lecture 4 sql {basics  keys and constraints}
Lecture 4 sql {basics keys and constraints}
 
Lecture 3 sql {basics ddl commands}
Lecture 3 sql {basics  ddl commands}Lecture 3 sql {basics  ddl commands}
Lecture 3 sql {basics ddl commands}
 
Taller
TallerTaller
Taller
 
Les09
Les09Les09
Les09
 
Les11
Les11Les11
Les11
 
Les09 Manipulating Data
Les09 Manipulating DataLes09 Manipulating Data
Les09 Manipulating Data
 
Sql
SqlSql
Sql
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?
 
MERGE SQL Statement: Lesser Known Facets
MERGE SQL Statement: Lesser Known FacetsMERGE SQL Statement: Lesser Known Facets
MERGE SQL Statement: Lesser Known Facets
 
Oracle 9i notes(kamal.love@gmail.com)
Oracle 9i  notes(kamal.love@gmail.com)Oracle 9i  notes(kamal.love@gmail.com)
Oracle 9i notes(kamal.love@gmail.com)
 
Les01
Les01Les01
Les01
 
Les03
Les03Les03
Les03
 
Programming the SQL Way with Common Table Expressions
Programming the SQL Way with Common Table ExpressionsProgramming the SQL Way with Common Table Expressions
Programming the SQL Way with Common Table Expressions
 
The Magic of Window Functions in Postgres
The Magic of Window Functions in PostgresThe Magic of Window Functions in Postgres
The Magic of Window Functions in Postgres
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
Les01 Writing Basic Sql Statements
Les01 Writing Basic Sql StatementsLes01 Writing Basic Sql Statements
Les01 Writing Basic Sql Statements
 
Proyecto 2er Parcial
Proyecto 2er ParcialProyecto 2er Parcial
Proyecto 2er Parcial
 

Similar to 12c Mini Lesson - Invisible Columns

12c Mini Lesson - Better Defaults
12c Mini Lesson - Better Defaults12c Mini Lesson - Better Defaults
12c Mini Lesson - Better DefaultsConnor McDonald
 
Database management system file
Database management system fileDatabase management system file
Database management system fileAnkit Dixit
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersConnor McDonald
 
Chasing the optimizer
Chasing the optimizerChasing the optimizer
Chasing the optimizerMauro Pagano
 
Mysql alter-command
Mysql alter-commandMysql alter-command
Mysql alter-commandbeben benzy
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQLOracle SQL AND PL/SQL
Oracle SQL AND PL/SQLsuriyae1
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatFranck Pachot
 
SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10Umair Amjad
 
SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9Umair Amjad
 
Les09[1]Manipulating Data
Les09[1]Manipulating DataLes09[1]Manipulating Data
Les09[1]Manipulating Datasiavosh kaviani
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 
SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所Hiroshi Sekiguchi
 
Les10[1]Creating and Managing Tables
Les10[1]Creating and Managing TablesLes10[1]Creating and Managing Tables
Les10[1]Creating and Managing Tablessiavosh kaviani
 

Similar to 12c Mini Lesson - Invisible Columns (20)

12c Mini Lesson - Better Defaults
12c Mini Lesson - Better Defaults12c Mini Lesson - Better Defaults
12c Mini Lesson - Better Defaults
 
Database management system file
Database management system fileDatabase management system file
Database management system file
 
Assignment#02
Assignment#02Assignment#02
Assignment#02
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
Chasing the optimizer
Chasing the optimizerChasing the optimizer
Chasing the optimizer
 
Les01
Les01Les01
Les01
 
Mysql alter-command
Mysql alter-commandMysql alter-command
Mysql alter-command
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQLOracle SQL AND PL/SQL
Oracle SQL AND PL/SQL
 
Dbmsmanual
DbmsmanualDbmsmanual
Dbmsmanual
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor format
 
Sql queries
Sql queriesSql queries
Sql queries
 
SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10SQL WORKSHOP::Lecture 10
SQL WORKSHOP::Lecture 10
 
SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9SQL WORKSHOP::Lecture 9
SQL WORKSHOP::Lecture 9
 
SQLQueries
SQLQueriesSQLQueries
SQLQueries
 
Dbms lab Manual
Dbms lab ManualDbms lab Manual
Dbms lab Manual
 
4sem dbms(1)
4sem dbms(1)4sem dbms(1)
4sem dbms(1)
 
Les09[1]Manipulating Data
Les09[1]Manipulating DataLes09[1]Manipulating Data
Les09[1]Manipulating Data
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所
 
Les10[1]Creating and Managing Tables
Les10[1]Creating and Managing TablesLes10[1]Creating and Managing Tables
Les10[1]Creating and Managing Tables
 

More from Connor McDonald

Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestConnor McDonald
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQLConnor McDonald
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsConnor McDonald
 
Sangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousSangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousConnor McDonald
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesConnor McDonald
 
UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresConnor McDonald
 
APEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomousAPEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomousConnor McDonald
 
APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne Connor McDonald
 
OOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAsOOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAsConnor McDonald
 
OOW19 - Read consistency
OOW19 - Read consistencyOOW19 - Read consistency
OOW19 - Read consistencyConnor McDonald
 
OOW19 - Slower and less secure applications
OOW19 - Slower and less secure applicationsOOW19 - Slower and less secure applications
OOW19 - Slower and less secure applicationsConnor McDonald
 
OOW19 - Killing database sessions
OOW19 - Killing database sessionsOOW19 - Killing database sessions
OOW19 - Killing database sessionsConnor McDonald
 
OOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL featuresOOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL featuresConnor McDonald
 
Latin America Tour 2019 - 18c and 19c featues
Latin America Tour 2019   - 18c and 19c featuesLatin America Tour 2019   - 18c and 19c featues
Latin America Tour 2019 - 18c and 19c featuesConnor McDonald
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - FlashbackConnor McDonald
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql featuresConnor McDonald
 
Latin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingLatin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingConnor McDonald
 
Latin America Tour 2019 - slow data and sql processing
Latin America Tour 2019  - slow data and sql processingLatin America Tour 2019  - slow data and sql processing
Latin America Tour 2019 - slow data and sql processingConnor McDonald
 

More from Connor McDonald (20)

Flashback ITOUG
Flashback ITOUGFlashback ITOUG
Flashback ITOUG
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolest
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQL
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tips
 
Sangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousSangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on Autonomous
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest Features
 
UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL features
 
APEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomousAPEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomous
 
APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne
 
OOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAsOOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAs
 
OOW19 - Read consistency
OOW19 - Read consistencyOOW19 - Read consistency
OOW19 - Read consistency
 
OOW19 - Slower and less secure applications
OOW19 - Slower and less secure applicationsOOW19 - Slower and less secure applications
OOW19 - Slower and less secure applications
 
OOW19 - Killing database sessions
OOW19 - Killing database sessionsOOW19 - Killing database sessions
OOW19 - Killing database sessions
 
OOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL featuresOOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL features
 
Latin America Tour 2019 - 18c and 19c featues
Latin America Tour 2019   - 18c and 19c featuesLatin America Tour 2019   - 18c and 19c featues
Latin America Tour 2019 - 18c and 19c featues
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - Flashback
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql features
 
Latin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingLatin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matching
 
Latin America Tour 2019 - slow data and sql processing
Latin America Tour 2019  - slow data and sql processingLatin America Tour 2019  - slow data and sql processing
Latin America Tour 2019 - slow data and sql processing
 
ANSI vs Oracle language
ANSI vs Oracle languageANSI vs Oracle language
ANSI vs Oracle language
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

12c Mini Lesson - Invisible Columns

  • 2. 2 the focus ... the day to day stuff
  • 4. have been there "forever"
  • 7. SQL> create table T 2 ( x int, 3 y int); Table created. SQL> create index IX on T (x+0); Index created. SQL> alter table T set unused column Y; Table altered.
  • 8. SQL> select column_name, data_default 2 from USER_TAB_COLS 3 where table_name = 'T' 4 order by column_id; COLUMN_NAME DATA_DEFAULT ------------------------------ ---------------- X SYS_NC00003$ "X"+0 SYS_C00002_14020720:50:28$
  • 10. SQL> create table T ( c1 int, c2 int, c3 int ); SQL> desc T Name Null? Type ---------------------------- -------- ------- C1 NUMBER(38) C2 NUMBER(38) C3 NUMBER(38) SQL> alter table T modify c1 invisible; SQL> desc T Name Null? Type ---------------------------- -------- ------- C2 NUMBER(38) C3 NUMBER(38)
  • 11. so what's the appeal ?
  • 13. SQL> create table T ( c1 int, c2 int ) ; Table created. SQL> create or replace 2 procedure BAD_APP is 3 begin 4 insert into T 5 select object_id, data_object_id 6 from all_objects 7 where rownum < 10; 8 end; 9 / Procedure created. SQL> exec BAD_APP; PL/SQL procedure successfully completed.
  • 15. SQL> alter table T add c3 int; Table altered. SQL> create or replace 2 procedure NEW_APP is 3 begin 4 for i in ( select c1,c2,c3 from T ) 5 loop 6 dbms_output.put_line(i.c1); 7 dbms_output.put_line(i.c2); 8 dbms_output.put_line(i.c3); 9 end loop; 10 end; 11 / Procedure created.
  • 16. SQL> exec NEW_APP; 28 28 15 15 29 29 25 25 54 PL/SQL procedure successfully completed.
  • 17.
  • 18.
  • 19. SQL> exec BAD_APP BEGIN BAD_APP; END; * ERROR at line 1: ORA-06550: line 1, column 7: PLS-00905: object SCOTT.BAD_APP is invalid ORA-06550: line 1, column 7: PL/SQL: Statement ignored
  • 20. SQL> alter table T modify c3 invisible; Table altered. SQL> exec NEW_APP; 28 28 15 15 29 29 25 25 54 PL/SQL procedure successfully completed. SQL> exec BAD_APP; PL/SQL procedure successfully completed.
  • 22. SQL> alter table T modify c1 visible; SQL> desc T Name Null? Type ---------------------------- -------- ------- C2 NUMBER(38) C3 NUMBER(38) C1 NUMBER(38)
  • 24. SQL> desc T Name Null? Type ---------------------- -------- -------------------- C1 NUMBER(38) C2 NUMBER(38) C3 NUMBER(38) SQL> create or replace 2 procedure P is 3 begin 4 insert into T values (1,10,100); 6 end; SQL> exec P SQL> select * from T; C1 C2 C3 ---------- ---------- ---------- 1 10 100
  • 25. SQL> alter table T modify c1 invisible; Table altered. SQL> alter table T modify c1 visible; Table altered. SQL> desc T Name Null? Type ------------------- -------- -------------------- C2 NUMBER(38) C3 NUMBER(38) C1 NUMBER(38)
  • 26. SQL> exec P PL/SQL procedure successfully completed. SQL> select c1,c2,c3 from t; C1 C2 C3 ---------- ---------- ---------- 1 10 100 100 1 10
  • 27. SQL> create or replace 2 procedure FIX_COLS(p_tab varchar2, p_col_list varchar2) is 3 l_col_list varchar2(1000) := p_col_list||','; 4 type clist is table of varchar2(30) 5 index by pls_integer; 6 c clist; 7 8 l_col varchar2(30); 9 l_id int; 10 begin 11 while instr(l_col_list,',') > 1 loop 12 c(c.count+1) := substr(l_col_list,1,instr(l_col_list,',')-1); 13 l_col_list := substr(l_col_list,instr(l_col_list,',')+1); 14 dbms_output.put_line(c(c.count)); 15 end loop; 16 17 for i in 1 .. c.count loop 18 loop 19 select column_name 20 into l_col 21 from user_tab_columns 22 where table_name = p_tab 23 and column_id = i; 24 25 exit when l_col = c(i); 26 27 execute immediate 'alter table '||p_tab||' modify '||l_col||' invisible'; 28 execute immediate 'alter table '||p_tab||' modify '||l_col||' visible'; 29 end loop; 30 end loop; 31 end; 32 /
  • 28. SQL> exec FIX_COLS('T','C1,C2,C3'); PL/SQL procedure successfully completed. SQL> desc T Name Null? Type ---------------------------- -------- ------- C1 NUMBER(38) C2 NUMBER(38) C3 NUMBER(38)
  • 29. tools
  • 30. SQL> create table T ( c1 int, c2 int invisible); Table created. SQL> desc T Name Null? Type ------------------------- -------- ------------------ C1 NUMBER(38) SQL> set colinvisible ON SQL> desc T Name Null? Type ------------------------- -------- ----------- C1 NUMBER(38) C2 (INVISIBLE) NUMBER(38)
  • 31.
  • 32. SQL> alter table T add "C3 (INVISIBLE)" int; Table altered. SQL> desc T Name Null? Type ------------------------- -------- ------------ C1 NUMBER(38) C3 (INVISIBLE) NUMBER(38) C2 (INVISIBLE) NUMBER(38)