Friday, December 16, 2011

Does an XU2/XU5 Script Produce an ORA-00947 Error?


Have you ever received the ORA-00947 from one of your XU2/XU5 scripts?   This occurs in SQL statements requiring two equal sets of values (very common to occur in an insert statement).   Here is an example from a part of a XU2 script:

SQL> INSERT INTO n_view_column_templates
  2  (view_label
  3  , query_position
  4  , column_label
  5  , table_alias
  6  , column_expression
  7  , column_position
  8  , column_type
  9  , description
 10  , group_by_flag
 11  , gen_search_by_col_flag
 12  , profile_option
 13  , product_version
 14  , created_by
 15  , creation_date
 16  , last_updated_by
 17  , last_update_date
 18  )
 19  VALUES
 20  ('OE_ACME_Blanket_Order_Pricing'    --view_label
 21  ,1     --query_position  number
 22  ,'Line_Revision_Date' --column_label
 23  ,'QPLNS'     --table_alias
 24  ,'LINE_REVISION_DATE'     --COLUMN_EXPRESSION
 25  ,76    --column_position number
 26  ,'COL'    --column_type
 27  ,'The line revision date ' --description
 28  , NULL  --profile_option
 29  ,'*'     --product_version
 30  ,’flintstonef’     -- created_by
 31  , SYSDATE                --creation_date
 32  ,’flintstonef’     --last_updated_by
 33  , SYSDATE                --last_update_date
 34  );
VALUES
*
ERROR at line 19:
ORA-00947: not enough values

With a cursory look, you might not catch the discrepancy, but by juxtaposing the insert columns with the value columns, we see that the insert set has 16 columns whereas the value set has 14 columns:


SQL> INSERT INTO n_view_column_templates
 19  VALUES
2 (view_label
 20  ('OE_ACME_Blanket_Order_Pricing'    --view_label
  3  , query_position
 21  ,1     --query_position  number
  4  , column_label
 22  ,'Line_Revision_Date' --column_label
  5  , table_alias
 23  ,'QPLNS'     --table_alias
  6  , column_expression
 24  ,'LINE_REVISION_DATE'     --COLUMN_EXPRESSION
  7  , column_position
 25  ,76    --column_position number
  8  , column_type
 26  ,'COL'    --column_type
  9  , description
 27  ,'The line revision date ' --description
 10  , group_by_flag
 28  , NULL  --profile_option
 11  , gen_search_by_col_flag
 29  ,'*'     --product_version
 12  , profile_option
 30  ,’flintstonef’     -- created_by
 13  , product_version
 31  , SYSDATE                --creation_date
 14  , created_by
 32  ,’flintstonef’     --last_updated_by
 15  , creation_date
 33  , SYSDATE                --last_update_date
 16  , last_updated_by
 34  );
 17  , last_update_date

 18  )


This juxtaposition allows us to see that the group_by_flag and the gen_search_by_col_flag columns have been omitted from the values set.

In this context the solution is easy, we just add these columns to the value set as follows:

 INSERT INTO n_view_column_templates
  2  (view_label
  3  , query_position
  4  , column_label
  5  , table_alias
  6  , column_expression
  7  , column_position
  8  , column_type
  9  , description
 10  , group_by_flag
 11  , gen_search_by_col_flag
 12  , profile_option
 13  , product_version
 14  , created_by
 15  , creation_date
 16  , last_updated_by
 17  , last_update_date
 18  )
 19  VALUES
 20  ('OE_ACME_Blanket_Order_Pricing'    --view_label
 21  ,1     --query_position  number
 22  ,'Line_Revision_Date' --column_label
 23  ,'QPLNS'     --table_alias
 24  ,'LINE_REVISION_DATE'     --COLUMN_EXPRESSION
 25  ,76    --column_position number
 26  ,'COL'    --column_type
 27  ,'The line revision date ' –description
28    ,'N'      -- group_by_flag
29    ,'N'      -- gen_search_by_col_flag
 30  , NULL  --profile_option
 31  ,'*'     --product_version
 32  ,’flintstonef’     -- created_by
 33  , SYSDATE                --creation_date
 34  ,’flintstonef’     --last_updated_by
 35  , SYSDATE                --last_update_date
 36  );


While this is not a common error, this has occurred in my development process.  I think the root cause is accidently deleting rows.

Friday, December 2, 2011

Does Your XU2/XU5 Script Produce an ORA-02291 Integrity Constraint Error?


A common error I have encountered when I regenerate my Noetix Views is the ORA-02291 integrity constraint error.  To provide a little more context regarding this entry, the example error I am looking at today is being thrown during a call to the hook script,   'OE_List_Lines_Base_xu2.sql’.

This error occurs during stage 4 of a regeneration and specifically, just after the template tables are loaded (this is when the xu2 scripts are invoked).  As a matter of observation, one can peruse the corresponding ‘.lst’ files generated by your hook scripts like this one, 'OE_List_Lines_Base_xu2.sql’, just before the second prompt for the APPS password (of course, this is using the GUI version of the NVA).  

When I am doing new development, I always perform a search in my ‘.lst’ files generated by my new hook scripts for the characters, ‘ORA-‘, to see if an error is being thrown.   One can just run your new hook scripts without running the NVA and check to see if an error will be thrown (but I would recommend removing the commits and I would recommend a rollback after the script is invoked).  Of course since this is development, we want to do this in a development environment.  Nothing is worse than testing or developing in a production environment.

Okay, so I developed my little hook script and just after I know that SQL Loader has loaded all the template tables with our configuration of the Noetix Views, I start looking at my ‘.lst’ hook scripts being generated and I spot this error in the ‘.lst’ file, 'OE_List_Lines_Base_xu2.lst':

Example:
ERROR at line 1:
ORA-02291: integrity constraint (NOETIX_SYS.N_VIEW_COLUMN_TEMPLATES_FK5)
Violated - parent key not found

Source offending script:
INSERT INTO n_view_column_templates
  2  (view_label
  3  , query_position
  4  , column_label
  5  , table_alias
  6  , column_expression
  7  , column_position
  8  , column_type
  9  , description
 10  , group_by_flag
 11  , gen_search_by_col_flag
 12  , profile_option
 13  , product_version
 14  , created_by
 15  , creation_date
 16  , last_updated_by
 17  , last_update_date
 18  )
 19  VALUES
 20  ('OE_List_Lines_Base'    --view_label
 21  ,1     --query_position  number
 22  ,'Sales_Document_Name' --column_label
 23  ,'OBHA'     --table_alias
 24  ,'SALES_DOCUMENT_NAME'     --column_expression
 25  ,82    --column_position number
 26  ,'COL'    --column_type
 27  ,'The sales document name --XXCMFG'-- description
 28  ,'N'     --group_by_flag
 29  ,'N'     --gen_search_by_col_flag
 30  , NULL  --profile_option
 31  ,'*'     --product_version
 32  ,'flinstonef'     -- created_by
 33  , SYSDATE                --creation_date
 34  ,'flinstonef'     --last_updated_by
 35  , SYSDATE                --last_update_date
 36  );
INSERT INTO n_view_column_templates


When we look up the constraint, NOETIX_SYS.N_VIEW_COLUMN_TEMPLATES_FK5, using the public view, dba_cons_columns with the following query, we see the following results:

select
 table_name,
 column_name
 from
 dba_cons_columns
 where
 constraint_name = 'N_VIEW_COLUMN_TEMPLATES_FK5';

___________________________________________________________
Table                                                                                  Column
___________________________________________________________
N_VIEW_COLUMN_TEMPLATES                               VIEW_LABEL
N_VIEW_COLUMN_TEMPLATES                               QUERY_POSITION
N_VIEW_COLUMN_TEMPLATES                               TABLE_ALIAS

Consequently, we know that there is foreign key constraint composed of these three columns.

This leaves me with three areas to check:

Is there a record in the N_VEIW_TEMPLATES table for this view label?  Yes.


Is there a record in the N_VEIW_QUERY_TEMPLATES table for this view label and query position one?  Yes.


Is there an insertion argument (or existing record) in the N_VEIW_TABLE_TEMPLATES table for this view label, query position and table?  Well, no.

It turns out that the insertion statement for the N_VIEW_TABLE_TEMPLATES was malformed (specifically, I have a typographical error associated with my view label).


To conclude, Noetix template tables are designed in such a way that when records are inserted, if there is a malformed command, the errors being thrown are clear enough that one can do some detective work and fix your error. 

I really appreciate how Noetix has “well instrumented” their code so that I do not need to do a lot of work to figure out where my errors are occurring and why they are occurring.

Of course, you can try to minimize your typographical errors and that will also help in your development of hook scripts.
  

Friday, October 28, 2011

Development and Test Environment: Post Regeneration Set-up Scripts


In a development and test environment, I hate logging in to Oracle Applications and having to run concurrent programs (and check concurrent programs) associated with security and the key flexfields after I have regenerated my Noetix Views.   Specifically, I do not like spending a lot of time after a regeneration to perform set-ups to make the environment end user friendly.  

Consequently, I just created some grant scripts (around Noetix packages to APPS) and initial KFF table uploads sql scripts so that end users can test their reports without errors associated with security or KFF tables being empty. 

Here is my approach:

1.        Run a grant script because some of the Noetix packages which are executed by the Noetix concurrent program have not been properly granted (grant execute) to the APPS database user.  If this grant is not performed in the 6.01 Noetix Views (with Oracle Apps 12.1.3), I have noticed the security and KFF concurrent programs failing.
Here is my script which I spool (and spool results) using my NOETIX_SYS database account:
/*
select
'grant execute on ' || object_name ||' to apps; '
from
all_objects
where
owner = 'NOETIX_SYS'
and object_type = 'PACKAGE'
order by 1;
*/


grant execute on NOETIX_APPS_SECURITY_PKG to apps;
grant execute on NOETIX_AP_ERRORS_PKG to apps;
grant execute on NOETIX_AP_INVOICES_PKG to apps;
grant execute on NOETIX_AR_ERRORS_PKG to apps;
grant execute on NOETIX_AR_PKG to apps;
grant execute on NOETIX_BOM_PKG to apps;
grant execute on NOETIX_CSD_PKG to apps;
grant execute on NOETIX_DBMS_WRAPPER_PKG to apps;
grant execute on NOETIX_DELIVERY_PKG to apps;
grant execute on NOETIX_ENV_PKG to apps;
grant execute on NOETIX_GL_SECURITY_PKG to apps;
grant execute on NOETIX_ORDER_LINE_STATUS_PKG to apps;
grant execute on NOETIX_ORDER_STATUS_PKG to apps;
grant execute on NOETIX_PA_PKG to apps;
grant execute on NOETIX_PREFIX_PKG to apps;
grant execute on NOETIX_QA_PKG to apps;
grant execute on NOETIX_QA_RSLT_POP_PKG to apps;
grant execute on NOETIX_SERVICE_PKG to apps;
grant execute on NOETIX_USER_PKG to apps;
grant execute on NOETIX_UTILITY_PKG to apps;
grant execute on NOETIX_WF_PKG to apps;
grant execute on NOETIX_XOP_PKG to apps;
grant execute on NOETIX_XXNAO_PKG to apps;
grant execute on N_DB_OBJECTS_PKG to apps;
grant execute on N_EUL_GEN_EUL50_2_PKG to apps;
grant execute on N_EUL_GEN_EUL50_PKG to apps;
grant execute on N_EUL_GEN_HELPER_PKG to apps;
grant execute on N_EUL_GEN_ITEM_CLASS_PKG to apps;
grant execute on N_GENERATORS_PKG to apps;
grant execute on N_GEN_COLUMN_SOURCE_PKG to apps;
grant execute on N_GEN_PKG_VALIDATION to apps;
grant execute on N_GSEG_INTEGRATION_PKG to apps;
grant execute on N_GSEG_METADATA_PKG to apps;
grant execute on N_GSEG_PKG to apps;
grant execute on N_GSEG_UTILITY_PKG to apps;
grant execute on N_KFF_ACCALIAS_PKG to apps;
grant execute on N_KFF_CTLG_GRP_PKG to apps;
grant execute on N_KFF_GL_ACCT_PKG to apps;
grant execute on N_KFF_ITEM_LOC_PKG to apps;
grant execute on N_KFF_MTL_CAT_PKG to apps;
grant execute on N_KFF_SYS_ITEM_PKG to apps;
grant execute on N_SEC_MANAGER_API_PKG to apps;
grant execute on N_SEC_MANAGER_DM_PKG to apps;
grant execute on N_SEC_MANAGER_GUI_PKG to apps;
grant execute on N_SEC_MANAGER_MDSEC_PKG to apps;
grant execute on N_VIEW_PARAMETERS_API_PKG to apps;

2.       Here is my scripts to load the KFF tables:

/*

 SELECT
'execute '|| OBJECT_NAME||'.Init_Upld();'
FROM
user_objects
WHERE 1=1
 AND OBJECT_NAME LIKE 'N_KFF_%_PKG'
 AND OBJECT_TYPE= 'PACKAGE'
 ;

 */


execute N_KFF_ACCALIAS_PKG.Init_Upld();
execute N_KFF_CTLG_GRP_PKG.Init_Upld();
execute N_KFF_GL_ACCT_PKG.Init_Upld();
execute N_KFF_ITEM_LOC_PKG.Init_Upld();
execute N_KFF_MTL_CAT_PKG.Init_Upld();
execute N_KFF_SYS_ITEM_PKG.Init_Upld();


I find that this saves me some time.


Thursday, October 20, 2011

Noetix Views 6.1 for Oracle EBS is now Shipping

If you have not heard, Noetix Views 6.1 for Oracle EBS is now shipping.

Friday, September 30, 2011

Complete Xu2 View Cloning Script


Back in June of 2011, I documented how to clone a view.  Presently, I have had a requirement to extend the seeded Noetix view, MSCG_Pegging_Details.  Specifically, I have received a requirement to add a lot more end pegging features (which requires pulling records from an alias of NOETIX_SYS_ASCP.MSCG_Demands_Base and MSC_SALES_ORDERS that join to the alias of MSC.MSC_FULL_PEGGING which supply the end pegging information). 

Today, I thought I would post my cloning script associated with this requirement.  This script is in user acceptance testing and I expect more changes are underway, but I thought it would be valuable to see the entire xu2 script.

I obtain a copy of this Xu2 script from my custom development scripts file on my Noetix Server as follows, C:\Program Files\Noetix Corporation\NoetixViews 6.01 -ASCP\Master\Custom\development.

As I have posted, it is imperative that the administrator has a master repository for these scripts (and Noetix encouraged me to use the file, C:\Program Files\Noetix Corporation\NoetixViews 6.01 -ASCP\Master\Custom, as a production repository.  As you can see, I place my development in sub-folder of the Custom folder.  In my shop, we also have implemented PVCS and I place my production version of all my scripts there.

Here it is:


-- ****************************************************************************
-- File Name:     MSC_ACME_Pegging_Details_xu2.sql
--
-- Date Created:  30-SEP-2011
--
-- Purpose:   Extend seeded Noetix View, MSC_Pegging_Details
--
-- Requested By:  Wilma Flinstone
--
-- Versions:  6.01
-- - Oracle EBS:  12.1.3
-- - Oracle DB:   10.2.0.4
-- - NoetixViews: 6.01
--
--
-- Change History:
-- ===============
-- Date         Who            Comments
-- -----------  -------------  ---------
-- 23-SEP-2011  F. Flinstone   Created
--                             View template cloned from MSC_Pegging_Details.
--                             References to Projects and Tasks
--                             have been removed to improve performance.  Added
--                             addtional tables/base views joined to end pegging.


-- This file is called from wnoetxu2.sql

-- ****************************************************************************

-- output to MSC_ACME_Pegging_Details_xu2.lst file
@utlspon MSC_ACME_Pegging_Details_xu2


-- -----------------------------------------------------------------------------
--   Clone OE_Lines view template to MSC_ACME_Pegging_Details
-- -----------------------------------------------------------------------------
INSERT INTO n_view_templates
(view_label,
 application_label,
 description,
 profile_option,
 essay,
 keywords,
 product_version,
 include_flag,
 export_view,
 security_code,
 special_process_code,
 sort_layer,
 freeze_flag,
 created_by,
 creation_date,
 last_updated_by,
 last_update_date,
 original_version,
 current_version
)
(SELECT 'MSC_ACME_Pegging_Details' view_label,
        application_label,
        description,
        profile_option,
        essay,
        keywords,
        product_version,
        include_flag,
        export_view,
        security_code,
        special_process_code,
        sort_layer,
        freeze_flag,
        'flintstonef' created_by,
        sysdate creation_date,
        'flintstonef' last_updated_by,
        sysdate last_update_date,
        original_version,
        current_version
 FROM   n_view_templates
 WHERE  view_label = 'MSC_Pegging_Details'
);

COMMIT;


INSERT INTO n_view_query_templates
(view_label,
 query_position,
 union_minus_intersection,
 group_by_flag,
 profile_option,
 product_version,
 include_flag,
 view_comment,
 created_by,
 creation_date,
 last_updated_by,
 last_update_date
)
(SELECT 'MSC_ACME_Pegging_Details' view_label,
        query_position,
        union_minus_intersection,
        group_by_flag,
        profile_option,
        product_version,
        include_flag,
        view_comment,
        'flintstonef' created_by,
        sysdate creation_date,
        'flintstonef' last_updated_by,
        sysdate last_update_date
 FROM   n_view_query_templates
 WHERE  view_label = 'MSC_Pegging_Details'
);

COMMIT;


INSERT INTO n_view_table_templates
(view_label,
 query_position,
 table_alias,
 from_clause_position,
 application_label,
 table_name,
 profile_option,
 product_version,
 include_flag,
 base_table_flag,
 key_view_label,
 subquery_flag,
 created_by,
 creation_date,
 last_updated_by,
 last_update_date,
 gen_search_by_col_flag
)
(SELECT 'MSC_ACME_Pegging_Details' view_label,
        query_position,
        table_alias,
        from_clause_position,
        application_label,
        table_name,
        profile_option,
        product_version,
        include_flag,
        base_table_flag,
        key_view_label,
        subquery_flag,
        'flintstonef' created_by,
        sysdate creation_date,
        'flintstonef' last_updated_by,
        sysdate last_update_date,
        gen_search_by_col_flag
 FROM   n_view_table_templates
 WHERE  view_label = 'MSC_Pegging_Details'
);

COMMIT;


INSERT INTO n_view_where_templates
(view_label,
 query_position,
 where_clause_position,
 where_clause,
 profile_option,
 product_version,
 include_flag,
 created_by,
 creation_date,
 last_updated_by,
 last_update_date
)
(SELECT 'MSC_ACME_Pegging_Details' view_label,
        query_position,
        where_clause_position,
        where_clause,
        profile_option,
        product_version,
        include_flag,
        'flintstonef' created_by,
        sysdate creation_date,
        'flintstonef' last_updated_by,
        sysdate last_update_date
 FROM   n_view_where_templates
 WHERE  view_label = 'MSC_Pegging_Details'
);

COMMIT;


INSERT INTO n_view_column_templates
(view_label,
 query_position,
 column_label,
 table_alias,
 column_expression,
 column_position,
 column_type,
 description,
 ref_application_label,
 ref_table_name,
 key_view_label,
 ref_lookup_column_name,
 ref_description_column_name,
 ref_lookup_type,
 id_flex_application_id,
 id_flex_code,
 group_by_flag,
 format_mask,
 format_class,
 gen_search_by_col_flag,
 lov_view_label,
 lov_column_label,
 profile_option,
 product_version,
 include_flag,
 created_by,
 creation_date,
 last_updated_by,
 last_update_date
)
(SELECT 'MSC_ACME_Pegging_Details' view_label,
        query_position,
        column_label,
        table_alias,
        column_expression,
        column_position,
        column_type,
        description,
        ref_application_label,
        ref_table_name,
        key_view_label,
        ref_lookup_column_name,
        ref_description_column_name,
        ref_lookup_type,
        id_flex_application_id,
        id_flex_code,
        group_by_flag,
        format_mask,
        format_class,
        gen_search_by_col_flag,
        lov_view_label,
        lov_column_label,
        profile_option,
        product_version,
        include_flag,
        'flintstonef' created_by,
        sysdate creation_date,
        'flintstonef' last_updated_by,
        sysdate last_update_date
 FROM   n_view_column_templates
 WHERE  view_label = 'MSC_Pegging_Details'
);

COMMIT;


UPDATE n_view_templates
SET    description = 'ACME Quarry Custom - Basic version of the MSC_Pegging_Details view.',
       essay = 'This view provides an efficient means of querying pegging details ' ||
               'with additional end pegging information added.  --ACME  ' --essay
WHERE  view_label = 'MSC_ACME_Pegging_Details'
;

COMMIT;


-- -----------------------------------------------------------------------------------------
--   Include MSC_ACME_Pegging_Details in all Roles that currently contain OE_Lines
-- -----------------------------------------------------------------------------------------
INSERT INTO n_role_view_templates
(role_label,
 view_label,
 product_version,
 include_flag,
 created_by,
 creation_date,
 last_updated_by,
 last_update_date
)
(SELECT role_label,
        'MSC_ACME_Pegging_Details' view_label,
        product_version,
        include_flag,
        'flintstonef' created_by,
        sysdate creation_date,
        'flintstonef' last_updated_by,
        sysdate last_update_date
 FROM   n_role_view_templates
 WHERE  view_label = 'MSC_Pegging_Details'
);

COMMIT;



-- -----------------------------------------------------------------------------------------
--   Delete Tables, Wheres, and Columns related to Projects and Project Tasks
-- -----------------------------------------------------------------------------------------
DELETE FROM n_view_column_templates
WHERE  view_label = 'MSC_ACME_Pegging_Details'
AND    (
         column_expression like 'PROJECT%' OR
         column_expression like 'TASK%'
       )
;

COMMIT;


DELETE FROM n_view_where_templates
WHERE  view_label = 'MSC_ACME_Pegging_Details'
AND    (
         where_clause like 'AND PROJ.%' OR
         where_clause like 'AND TASK.%'
       )
;

COMMIT;


DELETE FROM n_view_table_templates
WHERE  view_label = 'MSC_ACME_Pegging_Details'
AND    table_alias IN ('PROJ', 'TASK')
;

COMMIT;













INSERT INTO n_view_table_templates
(view_label
,query_position
,table_alias
,from_clause_position
,application_label
,table_name
,product_version
,base_table_flag
,subquery_flag
,gen_search_by_col_flag
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,'EDMAN'                             -- table_alias
,25                                -- from_clause_position
,'NOETIX'                           -- application_label
,'MSC_DEMANDS_BASE'   -- table_name
,'*'                            -- product_version
,'Y'                              -- base_table_flag
,'N'                              -- subquery_flag
,'N'                              -- gen_search_by_col_flag
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_table_templates
(view_label
,query_position
,table_alias
,from_clause_position
,application_label
,table_name
,product_version
,base_table_flag
,subquery_flag
,gen_search_by_col_flag
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,'MTP'                             -- table_alias
,26                                -- from_clause_position
,'MSC'                           -- application_label
,'MSC_TRADING_PARTNERS'   -- table_name
,'*'                            -- product_version
,'Y'                              -- base_table_flag
,'N'                              -- subquery_flag
,'N'                              -- gen_search_by_col_flag
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;



INSERT INTO n_view_table_templates
(view_label
,query_position
,table_alias
,from_clause_position
,application_label
,table_name
,product_version
,base_table_flag
,subquery_flag
,gen_search_by_col_flag
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,'MTPS'                             -- table_alias
,27                                -- from_clause_position
,'MSC'                           -- application_label
,'MSC_TRADING_PARTNER_SITES'   -- table_name
,'*'                            -- product_version
,'N'                              -- base_table_flag
,'N'                              -- subquery_flag
,'N'                              -- gen_search_by_col_flag
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;





INSERT INTO n_view_table_templates
(view_label
,query_position
,table_alias
,from_clause_position
,application_label
,table_name
,product_version
,base_table_flag
,subquery_flag
,gen_search_by_col_flag
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,'PSUPP'                             -- table_alias
,28                                -- from_clause_position
,'MSC'                           -- application_label
,'MSC_SUPPLIES'   -- table_name
,'*'                            -- product_version
,'N'                              -- base_table_flag
,'N'                              -- subquery_flag
,'N'                              -- gen_search_by_col_flag
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;



INSERT INTO n_view_table_templates
(view_label
,query_position
,table_alias
,from_clause_position
,application_label
,table_name
,product_version
,base_table_flag
,subquery_flag
,gen_search_by_col_flag
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,'ESORD'                             -- table_alias
,29                                -- from_clause_position
,'MSC'                           -- application_label
,'MSC_SALES_ORDERS'   -- table_name
,'*'                            -- product_version
,'Y'                              -- base_table_flag
,'N'                              -- subquery_flag
,'N'                              -- gen_search_by_col_flag
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;



INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,55                                -- where_clause_position
, 'AND EDMAN.PLAN_ID (+) = EPEGG.PLAN_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


 INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,56                                -- where_clause_position
, 'AND EDMAN.DEMAND_ID (+) = EPEGG.DEMAND_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;

 INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,57                                -- where_clause_position
,'AND EDMAN.SOURCE_INSTANCE_ID(+) = EPEGG.SR_INSTANCE_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


 INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,58                                -- where_clause_position
,'AND MTP.PARTNER_TYPE (+) = 2'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


 INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,59                                -- where_clause_position
,'AND MTP.PARTNER_ID (+) = EDMAN.CUSTOMER_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;





 INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,59.5                                -- where_clause_position
,'AND MTPS.PARTNER_ID (+) = EDMAN.CUSTOMER_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


 INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,59.6                                -- where_clause_position
,'AND MTPS.PARTNER_SITE_ID(+) = EDMAN.CUSTOMER_SITE_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;







 INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,60                                -- where_clause_position
,'AND PSUPP.PLAN_ID (+) = PPEGG.PLAN_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;



    
   
    
  
 

INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,61                                -- where_clause_position
,'AND PSUPP.TRANSACTION_ID (+) = PPEGG.TRANSACTION_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,62                                -- where_clause_position
,'AND PSUPP.SR_INSTANCE_ID (+) = PPEGG.SR_INSTANCE_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,65                                -- where_clause_position
,'AND ESORD.DEMAND_ID (+) = EPEGG.DEMAND_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_where_templates
(view_label
,query_position
,where_clause_position
,where_clause
,profile_option
,product_version
,created_by
,creation_date
,last_updated_by
,last_update_date)
VALUES
('MSC_ACME_Pegging_Details'               -- view_label
,1                                -- query_position
,66                                -- where_clause_position
,'AND ESORD.SR_INSTANCE_ID (+) = EPEGG.SR_INSTANCE_ID'    -- where_clause
,''                               -- profile_option
,'*'                            -- product_version
,'flintstonef'                         -- created_by
,SYSDATE                          -- creation_date
,'flintstonef'                         -- last_updated_by
,SYSDATE)                         -- last_update_date
;

COMMIT;
   








INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'Suggested_Wip_End_Date'               -- column_label
      ,'SUPP'                            -- table_alias
      ,'NEW_SCHEDULE_DATE'               -- column_expression
      ,75                               -- column_position
      ,'COL'                            -- column_type
      ,'The suggested wip end date.  -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;




INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'Next_Level_Demand_Date'               -- column_label
      ,'PSUPP'                            -- table_alias
      ,'NEW_WIP_START_DATE'               -- column_expression
      ,77                               -- column_position
      ,'COL'                            -- column_type
      ,'The next level demand date. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Demand_Customer_Name'               -- column_label
      ,'MTP'                            -- table_alias
      ,'PARTNER_NAME'               -- column_expression
      ,78                               -- column_position
      ,'COL'                            -- column_type
      ,'The end demand customer name. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;



INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Demand_Customer_Site'               -- column_label
      ,'MTPS'                            -- table_alias
      ,'LOCATION'               -- column_expression
      ,79                               -- column_position
      ,'COL'                            -- column_type
      ,'The end demand customer site. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'      -- view_label
      ,1                               -- query_position
      ,'End_Demand_Order_Number'    -- column_label
      , NULL                -- table_alias
      ,'DECODE(EDMAN.ORDER_TYPE_CODE,30,EDMAN.ORDER_NUMBER ,NULL)'             -- column_expression
      ,80                              -- column_position
      ,'EXPR'                          -- column_type
      ,'The end demand order number. --ACME'  -- description
      ,'N'                             -- group_by_flag
      , NULL                               -- profile_option
      ,'%'                             -- product_version
      ,'flintstonef'                        -- created_by
      ,SYSDATE                         -- creation_date
      ,'flintstonef'                        -- last_updated_by
      ,SYSDATE)                        -- last_update_date
;

COMMIT;




INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Demand_Organization_Code'               -- column_label
      ,'OPART'                            -- table_alias
      ,'ORGANIZATION_CODE'               -- column_expression
      ,81                               -- column_position
      ,'COL'                            -- column_type
      ,'The end demand organization code. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;









INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Demand_Priority'               -- column_label
      ,'EDMAN'                            -- table_alias
      ,'DEMAND_PRIORITY'               -- column_expression
      ,82                               -- column_position
      ,'COL'                            -- column_type
      ,'The end demand priority. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Demand_Ship_Method'               -- column_label
      ,'EDMAN'                            -- table_alias
      ,'ORIGINAL_SHIPPING_METHOD_CODE'               -- column_expression
      ,83                               -- column_position
      ,'COL'                            -- column_type
      ,'The end demand shipping method code. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;

INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Demand_Old_Due_Date'               -- column_label
      ,'EDMAN'                            -- table_alias
      ,'CURRENT_DUE_DATE'               -- column_expression
      ,84                               -- column_position
      ,'COL'                            -- column_type
      ,'The end demand shipping method code. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Item_Planner_Code'               -- column_label
      ,'EITEM'                            -- table_alias
      ,'PLANNER_CODE'               -- column_expression
      ,85                               -- column_position
      ,'COL'                            -- column_type
      ,'The end item planner code. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'Previous_Item_Planner_Code'               -- column_label
      ,'PITEM'                            -- table_alias
      ,'PLANNER_CODE'               -- column_expression
      ,86                               -- column_position
      ,'COL'                            -- column_type
      ,'The previous item planner code. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;




INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Demand_Satisfied_Date'               -- column_label
      ,'EDMAN'                            -- table_alias
      ,'DEMAND_SATISFIED_DATE'               -- column_expression
      ,87                               -- column_position
      ,'COL'                            -- column_type
      ,'The demand satisified date associated '||
      'with the end pegging. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Requirement_Date'               -- column_label
      ,'ESORD'                            -- table_alias
      ,'REQUIREMENT_DATE'               -- column_expression
      ,88                               -- column_position
      ,'COL'                            -- column_type
      ,'The end requirement date associated '||
      'with the end pegging. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;


INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,gen_search_by_col_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'               -- view_label
      ,1                                -- query_position
      ,'End_Schedule_Arrival_Date'               -- column_label
      ,'ESORD'                            -- table_alias
      ,'SCHEDULE_ARRIVAL_DATE'               -- column_expression
      ,89                               -- column_position
      ,'COL'                            -- column_type
      ,'The end scheduled arrival date associated '||
      'with the end pegging. -XXCMFG' -- description
      ,'N'                              -- group_by_flag
      ,'N'                              -- gen_search_by_col_flag
      ,''                               -- profile_option
      ,'*'                            -- product_version
      ,'flintstonef'                         -- created_by
      ,SYSDATE                          -- creation_date
      ,'flintstonef'                         -- last_updated_by
      ,SYSDATE)                         -- last_update_date
;

COMMIT;



 INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'      -- view_label
      ,1                               -- query_position
      ,'End_Request_Date'    -- column_label
      , NULL                -- table_alias
      ,' DECODE( ESORD.ORDER_DATE_TYPE_CODE, '||
       '2, ESORD.REQUEST_DATE, TO_DATE (NULL))' -- column_expression
      ,90                              -- column_position
      ,'EXPR'                          -- column_type
      ,'The end request date associated with the '||
       'end pegging.  --ACME'  -- description
      ,'N'                             -- group_by_flag
      , NULL                               -- profile_option
      ,'%'                             -- product_version
      ,'flintstonef'                        -- created_by
      ,SYSDATE                         -- creation_date
      ,'flintstonef'                        -- last_updated_by
      ,SYSDATE)                        -- last_update_date
;

COMMIT;



 INSERT INTO n_view_column_templates
      (view_label
      ,query_position
      ,column_label
      ,table_alias
      ,column_expression
      ,column_position
      ,column_type
      ,description
      ,group_by_flag
      ,profile_option
      ,product_version
      ,created_by
      ,creation_date
      ,last_updated_by
      ,last_update_date)
VALUES
      ('MSC_ACME_Pegging_Details'      -- view_label
      ,1                               -- query_position
      ,'End_Promise_Date'    -- column_label
      , NULL                -- table_alias
      ,' DECODE( ESORD.ORDER_DATE_TYPE_CODE, '||
       '2, ESORD.PROMISE_DATE, TO_DATE (NULL))' -- column_expression
      ,91                              -- column_position
      ,'EXPR'                          -- column_type
      ,'The end promise date associated with the '||
       'end pegging.  --ACME'  -- description
      ,'N'                             -- group_by_flag
      , NULL                               -- profile_option
      ,'%'                             -- product_version
      ,'flintstonef'                        -- created_by
      ,SYSDATE                         -- creation_date
      ,'flintstonef'                        -- last_updated_by
      ,SYSDATE)                        -- last_update_date
;

COMMIT;

@utlspoff