Алексей — различия между версиями

Материал из Фабиус wiki
Перейти к: навигация, поиск
м (Смотрите также)
м
Строка 1: Строка 1:
 +
elseif x = 8 // test
 +
  local _, sql, _2, fld, aa
 +
  fld := ' _0,C,4; _1,N,5; _2,N,14,4; _3,C,60; '
 +
  try
 +
    _ := CreateTmpFile( fld, '_', ~IsFreeDel := true )
 +
    _2 := CreateTmpFile( fld, '_2', ~IsFreeDel := true )
 +
    while !eof
 +
      sql := [ Select KREFL2, KANAL2, "SUM" From DOCS] + RET_F_EXT() + [ Where KINDDOC = 'RTH' and LVLNUM = '3' and ;
 +
        CATTR10 <> 'Д' and AMNT <> 0 and KREFL2 = 'R11 ' and ] + SQLFIELD( 'NDS_PRC ') + [ = 10 and EXTPARENT = '] + RGNUM + [' ]
 +
      SimpleSql( [ Insert into ] + TmpFilePath( _2 ) + [( _0, _1, _2 ) ] + sql, OpdataPath ) // RTH3
 +
      sql := [ Select KREFL2, KANAL2, ] + SQLFIELD( 'NACSUM' ) + [ From DOCS] + RET_F_EXT() + [ Where KINDDOC = 'YTM' and ;
 +
        LVLNUM = '2' and EXTPARENT = '] + RGNUM + [' and ] + SQLFIELD( 'NDSPRC ') + [ = 10 ] // YTM2
 +
      SimpleSql( [ Insert into ] + TmpFilePath( _2 ) + [( _0, _1, _2 ) ] + sql, OpdataPath )
 +
      sql := [ Select KREFL2, KANAL2, "SUM" From DOCS] + RET_F_EXT() + [ Where KINDDOC = 'ACP' and LVLNUM = '3' and ;
 +
        ] + SQLFIELD( 'NDSPRC ') + [ = 10 and PARENT = '] + RGNUM + [' ] // ACP3
 +
      SimpleSql( [ Insert into ] + TmpFilePath( _2 ) + [( _0, _1, _2 ) ] + sql, OpdataPath )
 +
      DBSKIP()
 +
    end
 +
    sql := [ Select _0, _1, SUM( _2 ) From ] + TmpFilePath( _2 ) + [ Group by _0, _1 ] // _2 -> _
 +
    SimpleSql( [ Insert into ] + TmpFilePath( _ ) + [( _0, _1, _2 ) ] + sql, OpdataPath )
 +
 +
    sql := [ Update _ Set _3 = Left( PNAME, 60 ) From ] + TmpFilePath( _ ) + [ _ ;
 +
      left outer join R08 ON _1 = KOD Where _0 = 'R08 ' ]
 +
 +
    sql := [ Update tt Set _3 = Left( PNAME, 60 ) From ] + TmpFilePath( _ ) + [ tt left outer join R08 ON _1 = KOD Where _0 = 'R08 ' ]
 +
@
 +
    SIMPLESQL( sql, reflispath )
 +
@
 +
//    SimpleSql( sql, reflispath )
 +
//    SimpleSql( sql, reflispath ) // r08
 +
 +
  finally
 +
    CLOSETABLE( _2 )
 +
    CLOSETABLE( _ )
 +
  end
 +
 +
 +
 
[mailto:support@sftserv.ru support@sftserv.ru]
 
[mailto:support@sftserv.ru support@sftserv.ru]
  

Версия 16:57, 18 июля 2018

elseif x = 8 // test

 local _, sql, _2, fld, aa
 fld := ' _0,C,4; _1,N,5; _2,N,14,4; _3,C,60; '
 try
   _ := CreateTmpFile( fld, '_', ~IsFreeDel := true )
   _2 := CreateTmpFile( fld, '_2', ~IsFreeDel := true )
   while !eof
     sql := [ Select KREFL2, KANAL2, "SUM" From DOCS] + RET_F_EXT() + [ Where KINDDOC = 'RTH' and LVLNUM = '3' and ;
       CATTR10 <> 'Д' and AMNT <> 0 and KREFL2 = 'R11 ' and ] + SQLFIELD( 'NDS_PRC ') + [ = 10 and EXTPARENT = '] + RGNUM + [' ]
     SimpleSql( [ Insert into ] + TmpFilePath( _2 ) + [( _0, _1, _2 ) ] + sql, OpdataPath ) // RTH3
     sql := [ Select KREFL2, KANAL2, ] + SQLFIELD( 'NACSUM' ) + [ From DOCS] + RET_F_EXT() + [ Where KINDDOC = 'YTM' and ;
       LVLNUM = '2' and EXTPARENT = '] + RGNUM + [' and ] + SQLFIELD( 'NDSPRC ') + [ = 10 ] // YTM2
     SimpleSql( [ Insert into ] + TmpFilePath( _2 ) + [( _0, _1, _2 ) ] + sql, OpdataPath )
     sql := [ Select KREFL2, KANAL2, "SUM" From DOCS] + RET_F_EXT() + [ Where KINDDOC = 'ACP' and LVLNUM = '3' and ;
       ] + SQLFIELD( 'NDSPRC ') + [ = 10 and PARENT = '] + RGNUM + [' ] // ACP3
     SimpleSql( [ Insert into ] + TmpFilePath( _2 ) + [( _0, _1, _2 ) ] + sql, OpdataPath )
     DBSKIP()
   end
   sql := [ Select _0, _1, SUM( _2 ) From ] + TmpFilePath( _2 ) + [ Group by _0, _1 ] // _2 -> _
   SimpleSql( [ Insert into ] + TmpFilePath( _ ) + [( _0, _1, _2 ) ] + sql, OpdataPath )
   sql := [ Update _ Set _3 = Left( PNAME, 60 ) From ] + TmpFilePath( _ ) + [ _ ;
     left outer join R08 ON _1 = KOD Where _0 = 'R08 ' ]
   sql := [ Update tt Set _3 = Left( PNAME, 60 ) From ] + TmpFilePath( _ ) + [ tt left outer join R08 ON _1 = KOD Where _0 = 'R08 ' ]

@

   SIMPLESQL( sql, reflispath )

@ // SimpleSql( sql, reflispath ) // SimpleSql( sql, reflispath ) // r08

 finally
   CLOSETABLE( _2 )
   CLOSETABLE( _ )
 end


support@sftserv.ru

Skype

alexey_veretennikov

Рабочий телефон

8 (495) 989-57-08 ( добавочный 05 )

veretennikovalexey@gmail.com

Все права защищены

https://msk.yitservice.ru/
R217\\4.7.47.51:5050\data\fabius\opdata\dict.add
MAKER=Softs
servicepath=\\server\vol1\service\db
192.168.234.32
raidex@yandex.ru
AdsSys - логин для словаря DICT.ADD

https://notepad-plus-plus.org/

Смотрите также

Участник википедии

Список участников

Контакты