Jump to content

using parameters on my query bring me an error


kito_park

Recommended Posts

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_gfrom (select fecha, sector, capital from allpcps where nvl(estado,'A')='A'         UNION ALL         select fecha, sector, capital from psuas where nvl(estado,'A')='A') nwhere 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_gfrom (select fecha, sector, capital from allpcps where nvl(estado,'A')='A'         UNION ALL         select fecha, sector, capital from psuas where nvl(estado,'A')='A') nwhere 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[/code]

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...