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