TAKE REFLIS SQL R147
Материал из Фабиус wiki
TAKE_REFLIS_SQL_R147 - это программа из справочника R266
Прием справочников SQL2 R147
TAKE_REFLIS_SQL_R147()
Текст
local sql, r147, fld, conn, path, t, _ sql := [ DELETE FROM R147 WHERE 'SYSTEM.' = 'SYSTEM.' ] SimpleSql( sql, ReflisPath ) try r147 := OPENKLSF( 'R147',, true ) finally CLOSEKLSF( r147 ) end fld := ' _1,C,3; _2,C,30; _3,N,5; ' try _ := CreateTmpFile( fld, '_', ~IsFreeDel := true ) path := GetPrm( 'SHP_PATH', 'SHOPOPER' ) conn := CreateConnection( path, 'admuser', "ora=1" ) sql := [ Select KOD, PNAME, KOD_R360 From R147 ] t := SelectSql( sql, conn ) ( t )->( DbGoTop() ) while !( t )->( eof() ) ( _ )->( DbAppend() ) ( _ )->_1 := ( t )->KOD ( _ )->_2 := ( t )->PNAME ( _ )->_3 := ( t )->KOD_R360 ( t )->( DbSkip() ) end sql := [ Select _1, _2, _3 From ] + TmpFilePath( _ ) SimpleSql( [ Insert into R147( KOD, PNAME, KOD_R360 ) ] + sql, ReflisPath ) finally FreeAndNil( conn ) CloseTable( _ ) CloseTable( t ) end // _1 KOD // _2 PNAME // _3 KOD_R360