Question Rafael Santos · Feb 26, 2018

How export data using query

Hi, iam newbie on caché database.

Iam trying, export data from query.

I read in some article that is not so simple.

So I create a view then a execute a query insert into select statement.

I have problem to know the job progress. I execute an hour ago and nothing  happened.

Iam using intersystems web IDE.

Thanks for help!

Comments

Robert Cemper · Feb 26, 2018

pls. post your query in detail.
it's not obvious what you try to do.

0
Rafael Santos  Feb 26, 2018 to Robert Cemper

INSERT INTO DestTable(CPF,Cargo,CodigoUnidade,LotacaoCidade,LotacaoUF,
Matricula,Nome,NomeProduto,NumeroApolice,NumeroParcela,NumeroTitulo,Produto,ValorBruto)
SELECT CPF,Cargo,CodigoUnidade,LotacaoCidade,LotacaoUF,
Matricula,Nome,NomeProduto,NumeroApolice,NumeroParcela,NumeroTitulo,Produto,ValorBruto
FROM VwSrcTable

0
Eduard Lebedyuk  Feb 27, 2018 to Rafael Santos

Modify second query to return 1 row:

SELECT TOP 1 ....

Check if inserting 1 row works.

0
Robert Cemper · Feb 26, 2018

You look for INSERT from Query
doc is here http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_insert#RSQL_insertselect

As far as I see it should work the way you have written
(assuming data types between target and source match) 

To estimate runtime you may try the select count(*) from  VwSrcTable  first to get a feeling
how many records that will be. 

Then during load running Select count(*) from DestTable from a 2nd session may let you see your progress.
 

0
John Murray  Feb 27, 2018 to Evgeny Shvarov

I guess he means Management Portal. And I wonder if a long-running SQL operation initiated from there might be adversely affected by a CSP Web Gateway timeout.

0
Evgeny Shvarov · Feb 27, 2018

Hi, Rafael!

I wonder, what is InterSystems web IDE? 

0