vspacer
 
vspacer
 
Valid XHTML 1.0!
 
Valid CSS 1.0

Kintana Script : Command Script Diagnostics

 

ZDS Kintana Scripts

Purpose

When you run a new command script for the first time you may encounter these run-time errors:

*Syntax error: `newline or ;' is not expected
*(KNTA-10127) Unknown or out of sequence command

These scripts will help you to locate the error.

Tested

With HP PPM (Project and Portfolio Management) Kintana v6.0.

Usage

Paste the following script into Toad or SQL Runner

Omit the comment if you're using SQL Runner.
This only supports select statements and you'll get a KNTA-10648 error.

Invisible
Spaces
Syntax error: `newline or ;' is not expected
-- Cause : One of the (many) weaknesses of the command parser is that
--         it cannot handle single space separator lines.
--         This is not something that's visually obvious!
--         To find and eliminate them you have to cursor to the
--         offending line, and hit delete. If the separator line
--         does not close up you have an invisible space line.
--         The parser should (but does not) check for this condition
--         when you Ok out of the command step edit dialog.
-- List Special command code with space lines
select unique nsct.special_command_type_name,
       nc.command_seq,
       ncs.step_seq,
       ncs.command
from KNTA_COMMANDS nc,
     KNTA_ENTITIES ne,
     KNTA_COMMAND_STEPS ncs,
     KNTA_SPECIAL_COMMAND_TYPES nsct
where nsct.special_command_type_id = nc.parent_id
-- and nsct.special_command_type_id = nscp.special_command_type_id
and nc.command_id = ncs.command_id
and nc.parent_entity_id = ne.entity_id
and ne.entity_name = 'Special Commands'
and nsct.special_command_type_name like 'sc_%'
and ncs.command like ' %'    -- Note
order by nsct.special_command_type_name, nc.command_seq, ncs.step_seq
-- NOTE It's possible to have to type multiple deletes to get two lines
--      to close up.  If you still get this error you can extend the
--      above:
--      ( and ncs.command like ' %'
--         or ncs.command like '  %'
--         or ncs.command like '   %'
--      ...)
-- List step command code with space lines
select dot.object_type_name,
       --nc.command_seq,
       nc.command_name,
       ncs.step_seq,
       ncs.command
from KDLV_OBJECT_TYPES dot,
     KNTA_COMMANDS nc,
     KNTA_COMMAND_STEPS ncs
where dot.enabled_flag = 'Y'
  and dot.object_type_id = nc.parent_id
  and nc.command_id = ncs.command_id
-- and ncs.command_name like 'File'
  and ncs.command like ' %'
--and dot.object_type_name not like '%foo%'
order by ncs.command
Out of
Sequence
Command
(KNTA-10127) Unknown or out of sequence command
-- Cause : The leading culprit for this is a ksc_connect without
--         a matching ksc_exit to close it.
--         Again this is a weakness in the parser which should
--         look for mismatched pairs when you Ok out of the edit
--         dialog and warn you then and there, not fail at run-time.
--         C, C++, C#, Java et al compilers manage to do this
--         and so should the Kintana parser.
--         These 'Best Practices' can help avoid this error:
--      #1 Keep ksc_connect/ksc_exit's at the top (Object Commmand step)
--         level, where they are visible! Don't embed them in lower
--         level special commands.  This way you have only one
--         place to look for mismatches!
--     #2  When you write a ksc_connect, IMMEDIATELY, and before
--         writing any code, write the ksc_exit! If you have to
--         create a step to hold the ksc_exit, then do it NOW!
--         Then, and only then, write the code between them.
-- List object command code for a specified object
select --dot.object_type_name,
       nc.command_seq,
       --nc.command_name,
       ncs.step_seq,
       ncs.command
from KDLV_OBJECT_TYPES dot,
     KNTA_COMMANDS nc,
     KNTA_COMMAND_STEPS ncs
where dot.object_type_name = 'SQL Script'
  and dot.object_type_id = nc.parent_id
  and nc.command_id = ncs.command_id
  and nc.enabled_flag = 'Y'
order by nc.command_seq, ncs.step_seq

Download

KintanaScripts.zip (58 Kb)


   


Back to top | ZDS Home | This article updated January 1, 2008.