12 length libref $8 table_name $32 constraint_name $32 constraint_type $12
14 libref=
'WORK'; table_name=
'CLASSC'; constraint_name=
'PK_CLASSC';
15 constraint_type=
'PRIMARY'; column_name=
'id'; output;
16 libref=
'WORK'; table_name=
'CLASSC'; constraint_name=
'PK_CLASSC';
17 constraint_type=
'PRIMARY'; column_name=
'name'; output;
20%mp_createconstraints(inds=work.constraints,outds=work.cc_out,execute=NO)
23 select count(*) into: n_stmt from work.cc_out;
24 select count(*) into: n_pk from work.cc_out
25 where index(create_statement,'PRIMARY KEY')>0;
26 select count(*) into: n_cols from work.cc_out
27 where index(create_statement,'
id')>0 or index(create_statement,'name')>0;
32 desc=Checking that one create statement is produced per column,
33 outds=work.test_results
38 desc=Checking that a PRIMARY constraint becomes a PRIMARY KEY clause,
39 outds=work.test_results
44 desc=Checking that the column name is carried into each statement,
45 outds=work.test_results
51 id=1; name='one'; output;
52 id=2; name='two'; output;
55data work.constraints2;
56 length libref $8 table_name $32 constraint_name $32 constraint_type $12
58 libref='WORK'; table_name='CLASST'; constraint_name='PK_CLASST';
59 constraint_type='PRIMARY'; column_name='
id';
62%mp_createconstraints(inds=work.constraints2,outds=work.cc_out2,execute=YES)
65 desc=Checking that execute=YES runs the generated statements cleanly,
66 outds=work.test_results