Link to home
Start Free TrialLog in
Avatar of JianJunShen
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_portlets.sql============================
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_MATCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES ('
 || pf_portlet_definition.portlet_definition_id || ', '
 || pf_placeholder_definition.placeholder_definition_id || ', '
 || '1' || ');' from pf_placeholder_definition, pf_markup_definition, pf_portlet_definition  
 where pf_placeholder_definition.markup_definition_id = pf_markup_definition.markup_definition_id
 and pf_portlet_definition.portlet_label = 'portlet_userpwdlogin' and pf_portlet_definition.webapp_name = 'portal'
 and pf_markup_definition.markup_type = 'Placeholder';

-- Registration
select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MATCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES ('
 || pf_portlet_definition.portlet_definition_id || ', '
 || pf_placeholder_definition.placeholder_definition_id || ', '
 || '1' || ');' from pf_placeholder_definition, pf_markup_definition, pf_portlet_definition  
 where pf_placeholder_definition.markup_definition_id = pf_markup_definition.markup_definition_id
 and pf_portlet_definition.portlet_label = 'portlet_registration' and pf_portlet_definition.webapp_name = 'portal'
 and pf_markup_definition.markup_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_MATCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES ('
  2   || pf_portlet_definition.portlet_definition_id || ', '
  3   || pf_placeholder_definition.placeholder_definition_id || ', '
  4   || '1' || ');' from pf_placeholder_definition, pf_markup_definition, pf_portlet_definition
  5   where pf_placeholder_definition.markup_definition_id = pf_markup_definition.markup_definition_id
  6   and pf_portlet_definition.portlet_label = 'portlet_userpwdlogin' and pf_portlet_definition.webapp_name = 'portal'
  7   and pf_markup_definition.markup_type = 'Placeholder';

INSERT INTO NPP_PLACEHOLDER_PORTLET_MATCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES (77009, 2001, 1);                                                                                                                                                                                              
INSERT INTO NPP_PLACEHOLDER_PORTLET_MATCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES (77009, 2002, 1);                                                                                                                                                                                              
INSERT INTO NPP_PLACEHOLDER_PORTLET_MATCH (PORTLET_DEFINITION_ID, PLACEHOLDER_DEFINITION_ID, ACTUAL_SIZE) VALUES (77009, 2003, 1);                                                                                                                                                                                              
...
ASKER CERTIFIED SOLUTION
Avatar of sventhan
sventhan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JianJunShen
JianJunShen

ASKER

what does this select mean here? "select 'INSERT INTO NPP_PLACEHOLDER_PORTLET_MATCH... "
Are there some documents mentioning about that?
SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial