added LSL2 stored procedures

This commit is contained in:
Infineon\StieberD
2024-03-25 14:46:21 -07:00
parent 09f1a66046
commit c667dd56eb
1655 changed files with 527967 additions and 0 deletions

View File

@ -0,0 +1,69 @@
compile function mssql_checkdata( Row, ConfigRecID, ConfigRec, ConfigTable )
declare function fieldcount, msg
$insert logical
convert '`' to @fm in Row
ThisRowID = Row<1>
Rcnt = fieldcount( Row, @fm )
NewRow = ''
for i = 1 to Rcnt
ThisColumn = Row<i>
ColRule = ConfigRec<i>
convert '`' to @fm in ColRule
DataType = ColRule<1>
DataSpec = ColRule<2>
DataSpec2 = ColRule<3>
begin case
case DataType = 'V'
if len( ThisColumn ) > DataSpec then
gosub WriteErr
return 1
end
case DataType = 'I'
if index( ThisColumn, '.', 1 ) then
gosub WriteErr
return 1
end else
if num( ThisColumn ) else
gosub WriteErr
return 1
end
end
case DataType = 'DT'
ThisColumn = oconv( ThisColumn, 'D2/' )
case DataType = 'D'
ThisColumn = oconv( ThisColumn, 'MD':DataSpec2 )
if len(field( ThisColumn, '.', 1 )) > DataSpec then
gosub WriteErr
return 1
end
case DataType = 'T'
if index( ThisColumn, '`', 1 ) then
gosub WriteErr
return 1
end
case DataType = 'C'
if len( ThisColumn ) = DataSpec else
gosub WriteErr
return 1
end
end case
NewRow := ThisColumn:'`'
next i
NewRow[-1,1] = ''
Row = NewRow
return 0
*================================================================================================*
WriteErr:
ErrorRecID = ConfigRecID:'_ERR'
ErrorLine = fmt( ThisRowId, 'R#15' ):' ':i: ' ':ThisColumn
ErrorRec = xlate( 'CONFIG', ErrorRecID, '', 'X' )
ErrorRec<-1> = ErrorLine
write ErrorRec on ConfigTable, ErrorRecID else
Void = msg( '', 'Error writing ':ErrorRecID:' on CONFIG...' )
return 0
end
return
*================================================================================================*