Network Automation Software
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Automate changes SQL before execute in base
Topic Summary:
Created On: 08/01/2011 01:32 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 08/01/2011 01:32 PM
User is offline View Users Profile Print this message

Author Icon
FabioCrivelaro
Journeyman (50-99)

Posts: 58
Joined: 05/06/2010

Hi Guys!

We have a problem with the Oracle database and noticed the following situation:

By "SQL Query" command, we are executing the instruction below:

SELECT a.cd_commod          AS Mercadoria ,
  a.cd_mercad               AS Mercado ,
  a.cd_serie                AS Vencimento ,
  SUM(ABS(a.qt_qtdesp))     AS Quantidade ,
  a.tp_negocio              AS Tipo ,
  SUM(ABS(a.vl_corneg_bro)) AS Repasse
FROM vmfrepcor_h a ,
  tscclibmf c
WHERE a.dt_datmov      >= to_date('01/07/2011', 'dd/mm/yyyy')
AND a.dt_datmov        <= to_date('31/07/2011', 'dd/mm/yyyy')
AND a.cd_origem         = 147
AND a.cd_commod         = 'DDI'
AND c.codcli            = a.cd_cliente
AND c.cd_cliente_liqfin = 7983
GROUP BY a.dt_negocio ,
  a.cd_corresp ,
  a.cd_commod ,
  a.cd_mercad ,
  a.cd_serie ,
  a.cd_cliente ,
  a.tp_negocio ,
  a.vl_taxcor ,
  a.vl_taxcor_bro ,
  a.in_tipo_cor
ORDER BY a.dt_negocio ,
  a.cd_cliente ,
  a.cd_commod ,
  a.cd_mercad ,
  a.cd_serie ,
  a.tp_negocio


Notice that there is no field named ROWID


But in the oracle database log we have this instruction executed by the BPA.exe application:

SELECT A.CD_COMMOD          AS MERCADORIA ,
  A.CD_MERCAD               AS MERCADO ,
  A.CD_SERIE                AS VENCIMENTO ,
  SUM(ABS(A.QT_QTDESP))     AS QUANTIDADE ,
  A.TP_NEGOCIO              AS TIPO ,
  SUM(ABS(A.VL_CORNEG_BRO)) AS REPASSE,
  A.ROWID, --ghost field
  C.ROWID --ghost field
FROM VMFREPCOR_H A ,
  TSCCLIBMF C
WHERE A.DT_DATMOV      >= TO_DATE('01/07/2011', 'dd/mm/yyyy')
AND A.DT_DATMOV        <= TO_DATE('31/07/2011', 'dd/mm/yyyy')
AND A.CD_ORIGEM         = 147
AND A.CD_COMMOD         = 'DDI'
AND C.CODCLI            = A.CD_CLIENTE
AND C.CD_CLIENTE_LIQFIN = 7983
GROUP BY A.DT_NEGOCIO ,
  A.CD_CORRESP ,
  A.CD_COMMOD ,
  A.CD_MERCAD ,
  A.CD_SERIE ,
  A.CD_CLIENTE ,
  A.TP_NEGOCIO ,
  A.VL_TAXCOR ,
  A.VL_TAXCOR_BRO ,
  A.IN_TIPO_COR
ORDER BY A.DT_NEGOCIO ,
  A.CD_CLIENTE ,
  A.CD_COMMOD ,
  A.CD_MERCAD ,
  A.CD_SERIE ,
  A.TP_NEGOCIO

Oracle return this error:

=> ORA-01446: cannot
SELECT ROWID FROM, OR sample, a VIEW
WITH DISTINCT, GROUP BY, etc.

This situation does not cause problems in the workflow, but causes serious problems in the database.

Why Automate adds these fields for any query?



 Category Survey
 08/02/2011 03:30 PM
User is offline View Users Profile Print this message

Author Icon
Rick Johnson
AUTOMATE EMPLOYEE

Posts: 2757
Joined: 07/14/2008

Hi Fabio,

I'm having the developers look into this one. Could you copy your SQL query step to the clipboard and paste it into a reply after pressing the Attach Code button?

 Category Survey


-------------------------
- Rick Johnson
Network Automation
 08/03/2011 09:26 AM
User is offline View Users Profile Print this message

Author Icon
FabioCrivelaro
Journeyman (50-99)

Posts: 58
Joined: 05/06/2010

This happens with all commands "SQL Query".



 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 08/03/2011 03:55 PM
User is offline View Users Profile Print this message

Author Icon
Rick Johnson
AUTOMATE EMPLOYEE

Posts: 2757
Joined: 07/14/2008

Hi Fabio,

I have asked the development team about this issue and will follow up with you shortly.

 Category Survey


-------------------------
- Rick Johnson
Network Automation
 08/05/2011 03:08 PM
User is offline View Users Profile Print this message

Author Icon
Rick Johnson
AUTOMATE EMPLOYEE

Posts: 2757
Joined: 07/14/2008

Hi Fabio,

After discussing this with the developers, we're not certain this issue is being cause by AutoMate. We do not use the term ROWID in the source code at all, and we do not have any routines which modify the queries.
This points to possibilities such as database drivers, connection strings, or configurations on the database server.

I was not able to see your connection string, as you seem to have used an existing session in a previous step prior to executing the query. Can you determine which database driver you are using, and what the connection string is? Would you be able to have your DBA validate the server configuration? If you copy the query from your step and paste it into your Oracle management tools, does the query behave the same as with AutoMate?

 Category Survey


-------------------------
- Rick Johnson
Network Automation
Statistics
18257 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 6686 on 11/01/2020 at 01:24 AM.
There are currently 1458 guests browsing this forum, which makes a total of 1458 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog