| Joseg |
20 de diciembre de 2017 11:30 |
Cobol + Sqlite
Para quem pretende aceder ao Sqlite sem ter que fazer nenhuma instalação.
Acesso muito rápido.
Tenho um sistema em produção que movimenta Gbytes sem qualquer problema.
Um exemplo:
Código COBOL:
01 comando. 03 pic x(15) value "sqlite3 ex1.db ". 03 mystring pic x(200). - Nova base de dados: INVOKE pow-self "Execute" USING 'sqlite3.exe ex1.db .quit' POW-SWHIDE - Nova tabela INVOKE pow-self "ExecuteSync" USING 'sqlite3 ex1.db ";create table tb1 (tb1key INTEGER PRIMARY KEY,data TEXT,num double,timeEnter DATE);";' POW-SWHIDE - Atualizar string '";insert into tb1 (data,num) ' delimited by size "values ('Linha1,9);" delimited by size '";' delimited by size into mystring INVOKE pow-self "Execute" USING comando POW-SWHIDE string '";insert into tb1 (data,num) ' delimited by size "values ('Linha2,19);" delimited by size '";' delimited by size into mystring INVOKE pow-self "Execute" USING comando POW-SWHIDE string '";insert into tb1 (data,num) ' delimited by size "values ('Linha3,212);" delimited by size '";' delimited by size into mystring INVOKE pow-self "Execute" USING comando POW-SWHIDE - query INVOKE pow-self "ExecuteSync" USING 'sqlite3 ex1.db ";select * from tb1";; >teste.txt' POW- SWHIDE - ver resultado: Processar teste.txt ou move "CommandLine" OF pow-self to "Caption" OF CmStatic1 ----> não testei isto, não sei se funciona
|