The shape command APPEND clause appends a column or columns to a Recordset. Often these columns are chapter columns, which refer to a child Recordset.
SHAPE [parent-command [[AS] parent-alias]] APPEND column-list
The parts of this clause are as follows:
SHAPE [parent-command [[AS] parent-alias]] APPEND (child-recordset [ [[AS] child-alias] RELATE parent-column TO child-column | PARAMETER param-number, ... ]) [[AS] chapter-alias] [, ... ]
Note The "parent-column TO child-column" clause is actually a list, where each relation defined is separated by a comma.
Note The clause after the APPEND keyword is actually a list, where each clause is separated by a comma and defines another column to be appended to the parent.
When you construct provider commands from user input as part of a SHAPE command, SHAPE will treat the user-supplied a provider command as an opaque string and pass them faithfully to the provider. For example, in the following SHAPE command,
SHAPE {select * from t1} APPEND ({select * from t2} RELATE k1 TO k2)
SHAPE will execute two commands: select * from t1
and (select * from t2 RELATE k1 TO k2)
. If the user supplies a compound command consisting of multiple provider commands separated by semicolons, SHAPE is not able to discern the difference. So in the following SHAPE command,
SHAPE {select * from t1; drop table t1} APPEND ({select * from t2} RELATE k1 TO k2)
SHAPE executes select * from t1; drop table t1
and (select * from t2 RELATE k1 TO k2),
not realizing that drop table t1
is a separate and in this case, dangerous, provider command. Applications must always validate the user input to prevent such potential hacker attacks from happening.
When you construct provider commands from user input as part of a SHAPE command, SHAPE will treat the user-supplied a provider command as an opaque string and pass them faithfully to the provider. For example, in the following SHAPE command,
SHAPE {select * from t1} APPEND ({select * from t2} RELATE k1 TO k2)
SHAPE will execute two commands: select * from t1
and (select * from t2 RELATE k1 TO k2)
. If the user supplies a compound command consisting of multiple provider commands separated by semicolons, SHAPE is not able to discern the difference. So in the following SHAPE command,
SHAPE {select * from t1; drop table t1} APPEND ({select * from t2} RELATE k1 TO k2)
SHAPE executes select * from t1; drop table t1
and (select * from t2 RELATE k1 TO k2),
not realizing that drop table t1
is a separate and in this case, dangerous, provider command. Applications must always validate the user input to prevent such potential hacker attacks from happening.
Data Shaping | Formal Shape Grammar | Shape Commands in General