JianJunShen
asked on
Oracle: select insert
Does anyone knows what this "select 'insert..." clause means? It looks like that it generates a lot of insert statement. Are there some introduction material telling about that?
==================create_p ortlets.sq l========= ========== =========
set pagesize 999;
set linesize 320;
set feedback off;
set verify off;
set heading off;
SET TERM ON;
SET ECHO ON;
SPOOL tmp_create_test_data.sql;
-- Login (user, pwd)
select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MA TCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES ('
|| pf_portlet_definition.port let_defini tion_id || ', '
|| pf_placeholder_definition. placeholde r_definiti on_id || ', '
|| '1' || ');' from pf_placeholder_definition, pf_markup_definition, pf_portlet_definition
where pf_placeholder_definition. markup_def inition_id = pf_markup_definition.marku p_definiti on_id
and pf_portlet_definition.port let_label = 'portlet_userpwdlogin' and pf_portlet_definition.weba pp_name = 'portal'
and pf_markup_definition.marku p_type = 'Placeholder';
-- Registration
select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MA TCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES ('
|| pf_portlet_definition.port let_defini tion_id || ', '
|| pf_placeholder_definition. placeholde r_definiti on_id || ', '
|| '1' || ');' from pf_placeholder_definition, pf_markup_definition, pf_portlet_definition
where pf_placeholder_definition. markup_def inition_id = pf_markup_definition.marku p_definiti on_id
and pf_portlet_definition.port let_label = 'portlet_registration' and pf_portlet_definition.weba pp_name = 'portal'
and pf_markup_definition.marku p_type = 'Placeholder';
SPOOL OFF;
set pagesize 55;
set feedback on;
set heading on;
@tmp_create_test_data;
commit;
========================== ===
====================
SQL> -- Login (user, pwd)
SQL> select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MA TCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES ('
2 || pf_portlet_definition.port let_defini tion_id || ', '
3 || pf_placeholder_definition. placeholde r_definiti on_id || ', '
4 || '1' || ');' from pf_placeholder_definition, pf_markup_definition, pf_portlet_definition
5 where pf_placeholder_definition. markup_def inition_id = pf_markup_definition.marku p_definiti on_id
6 and pf_portlet_definition.port let_label = 'portlet_userpwdlogin' and pf_portlet_definition.weba pp_name = 'portal'
7 and pf_markup_definition.marku p_type = 'Placeholder';
INSERT INTO NPP_PLACEHOLDER_PORTLET_MA TCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES (77009, 2001, 1);
INSERT INTO NPP_PLACEHOLDER_PORTLET_MA TCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES (77009, 2002, 1);
INSERT INTO NPP_PLACEHOLDER_PORTLET_MA TCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES (77009, 2003, 1);
...
==================create_p
set pagesize 999;
set linesize 320;
set feedback off;
set verify off;
set heading off;
SET TERM ON;
SET ECHO ON;
SPOOL tmp_create_test_data.sql;
-- Login (user, pwd)
select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MA
|| pf_portlet_definition.port
|| pf_placeholder_definition.
|| '1' || ');' from pf_placeholder_definition,
where pf_placeholder_definition.
and pf_portlet_definition.port
and pf_markup_definition.marku
-- Registration
select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MA
|| pf_portlet_definition.port
|| pf_placeholder_definition.
|| '1' || ');' from pf_placeholder_definition,
where pf_placeholder_definition.
and pf_portlet_definition.port
and pf_markup_definition.marku
SPOOL OFF;
set pagesize 55;
set feedback on;
set heading on;
@tmp_create_test_data;
commit;
==========================
====================
SQL> -- Login (user, pwd)
SQL> select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MA
2 || pf_portlet_definition.port
3 || pf_placeholder_definition.
4 || '1' || ');' from pf_placeholder_definition,
5 where pf_placeholder_definition.
6 and pf_portlet_definition.port
7 and pf_markup_definition.marku
INSERT INTO NPP_PLACEHOLDER_PORTLET_MA
INSERT INTO NPP_PLACEHOLDER_PORTLET_MA
INSERT INTO NPP_PLACEHOLDER_PORTLET_MA
...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Are there some documents mentioning about that?