using parameters on my query bring me an error

0

Hi im using parameters on my query and a error is shown, when i use the values instead of the parameters the query works fine.

The error is: Error:General problem:Error executing SQL statement for: nullCheck userName and password; is the DBMS active?

Im using ireport 5.0.1

Here is my query with parameters

..Select
  trunc(n.fecha,$P{pFechas} ) mes_g,
  decode(substr(n.sector,1,1),
     'B', '1',
     'M', '2',
     'T', '3',
     'P', '4', '5') orden_g,
  decode(substr(n.sector,1,1),
     'B', 'Burócratas',
     'M', 'Maestros',
     'T', 'Telesecundarias',
     'P', 'D.P.E.', 'desconocido') sector_g,
  COUNT(*) numero_g,
  SUM(n.capital) monto_g
FROM (SELECT fecha, sector, capital FROM allpcps WHERE nvl(estado,'A')='A'
         UNION ALL
         SELECT fecha, sector, capital FROM psuas WHERE nvl(estado,'A')='A') n
WHERE n.fecha BETWEEN to_date( $P{pDesde}) AND to_date($P{pHasta})
GROUP BY  trunc(n.fecha,$P{pFechas} ),
  decode(substr(n.sector,1,1),
     'B', '1',
     'M', '2',
     'T', '3',
     'P', '4', '5'),
  decode(substr(n.sector,1,1),
     'B', 'Burócratas',
     'M', 'Maestros',
     'T', 'Telesecundarias',
     'P', 'D.P.E.', 'desconocido')
ORDER BY 1, 2 ..
 
Here IS my query WITH VALUES:
 
..
SELECT
  trunc(n.fecha,'mm' ) mes_g,    <-------------
  decode(substr(n.sector,1,1),
     'B', '1',
     'M', '2',
     'T', '3',
     'P', '4', '5') orden_g,
  decode(substr(n.sector,1,1),
     'B', 'Burócratas',
     'M', 'Maestros',
     'T', 'Telesecundarias',
     'P', 'D.P.E.', 'desconocido') sector_g,
  COUNT(*) numero_g,
  SUM(n.capital) monto_g
FROM (SELECT fecha, sector, capital FROM allpcps WHERE nvl(estado,'A')='A'
         UNION ALL
         SELECT fecha, sector, capital FROM psuas WHERE nvl(estado,'A')='A') n
WHERE n.fecha BETWEEN to_date( '01-01-2019') AND to_date('02-08-2019')    <---------------
GROUP BY  trunc(n.fecha,'mm' ),         <-----------------
  decode(substr(n.sector,1,1),
     'B', '1',
     'M', '2',
     'T', '3',
     'P', '4', '5'),
  decode(substr(n.sector,1,1),
     'B', 'Burócratas',
     'M', 'Maestros',
     'T', 'Telesecundarias',
     'P', 'D.P.E.', 'desconocido')
ORDER BY 1, 2 ..
 
Can you help me?
 
Regards

kito_park's picture
Joined: Mar 28 2019 - 3:42pm
Last seen: 1 month 4 weeks ago

0 Answers:

No answers yet
Feedback
randomness