kreta/Tools/CodeGeneration/Templates/Common/DBUtil.tdl
2024-03-13 00:33:46 +01:00

61 lines
2.3 KiB
Text

//***************************************************************************//
// SQL table script formázott fejlézének elkészítéséhez használt függvény. //
// a paraméterként kapott stringet kiegészíti 75 karakter hosszúra spacekkel //
//***************************************************************************//
proc FormatSQLHeader(str)
return CompleteString( [str],75," ","post");
end proc
//***************************************************************************//
// Az SQL table script oszlop kényszer értékét formázza meg //
//***************************************************************************//
proc FormatSQLColumnModifier(str)
return [str];
end proc
//***************************************************************************//
// Az SQL table script oszlop típus értékét formázza meg //
//***************************************************************************//
proc FormatSQLColumnType(str)
return CompleteString( [str],32," ","post");
end proc
//***************************************************************************//
// Az SQL table script oszlop név értékét formázza meg //
//***************************************************************************//
proc FormatColumnName(str)
return CompleteString( [str],33," ","post");
end proc
//***************************************************************************//
// Az DROP TABLE <TÁBLANÉV> utáni részt adja vissza. //
//***************************************************************************//
proc GetDropTableOptions()
switch ( [SQL_DBType])
//ORACLE Type
case "ORACLE" :
return "cascade constraints";
case "MSSQL" :
return "";
case "DB2" :
return "";
end switch
end proc
//***************************************************************************//
// A paraméterként megadott elemhez tartozo Constraint értékét adja vissza //
//***************************************************************************//
proc getConstraint(MSemElement)
loop(MSemElement->Note where [Note.type] == "UmlExtensibilityDefinition")
loop(Note->Item where [Item.type] == "UmlConstraintItem")
return [Item.value];
end loop
end loop
return "";
end proc