Skip to content Skip to sidebar Skip to footer

Sql Query Works In Pl/sql But Not In Visual Studio

I searched online and found out many had the same problem, but non of the solutions worked for me. I'm really hoping you could help me: I have this ORACLE SQL query that is working

Solution 1:

Your second query is so much nicer to write as:

select bzq_terminate_provider as PROVIDER, sum(callsnum) as CALLS,
       sum(charge_amount) as CHARGE, sum(at_call_dur_sec) as DUR
from usage_cycle_sum 
where ban = '80072922'and ben = '1'and
      subscriber_no = '036585305'and
      start_cycle_code ='20150207'and
      feature_code_rank in ('1', '2')
groupby bzq_terminate_provider ;

Or, perhaps the select needs to be:

select bzq_terminate_provider as PROVIDER,
       sum(casewhen feature ='1'then callsnum else0end) as CALLS,
       sum(charge_amount) as CHARGE,
       sum(casewhen feature ='1'then at_call_dur_sec else0end) as DUR

(The first version assumed that the fields were zeroed out in the second subquery because they are NULL in the data, but that might not be true.)

However, application software is not yet smart enough to identify such awkwardly written queries, so that is not the actual problem you are facing. If the query works in the database, but not in the application, then typical problems are:

  • The application is not connected to the right database.
  • The application does not have permissions on the database or table.
  • The application query is different from the query run in the database, typically due to some substitution problem.
  • The results from running the query in the application are not being interpreted correctly.

Post a Comment for "Sql Query Works In Pl/sql But Not In Visual Studio"