"No results were returned by the query" exception
Hi,
im using postgreSql (7.2) as a backend and JDBC3 (from http://jdbc.postgresql.org/).
im getting the exception, "No results were returned by the query" whenever i try to do an insert. the weird thing is that insert works and i can see a record in the database, but i still get this exception and i can't do anything.
Java: 1.4.0
thanks a lot
you should use executeUpdate for queries that do not return result sets. that would include insert, update and delete.
i didn't know that, that would cause a problem with postgreSql jdbc. im use to of Oracle and i never got these problems with Oracle
this is not a problem with postgres it is a problem with your lack of understanding the API and the Oracle driver if it let's you do this is wrong.
the API clearly states that is you try and execute a SQL statement that does not produce a ResultSet with executeQuery then a SQLException should be thrown.
so again the postgres driver is correct you and the oracle driver are wrong.
Similar Messages
-
There is an invalid number of result bindings returned for the ResultSetType
SSIS SQL Task: Single Row Result Set
Code was updated to test for data in target: If Exists Do Merge ELSE Do Insert
Previously was just a merge that Output $Action to @ChangeSum and then @ChangeSum queried for updates and inserts
That all worked but after injecting new code I receive the error There is an invalid number of result bindings returned for the ResultSetType that I don't know what it means or how to troubleshoot.
Inject New Code:
IF OBJECT_ID('tempdb..##TblTemp', 'U') IS NOT NULL
DROP TABLE ##TblTemp
Declare @sql nvarchar(max);
set @sql = @TestForData
exec (@sql);
IF EXISTS (select top 1 * from ##TblTemp)
Begin
--Beginning of existing code
begin transaction;
begin try
declare @MergeQuery varchar(max)
set @MergeQuery = convert(varchar(max), @MergeQuery1) + convert(varchar(max), @MergeQuery2)
+ ' ' + convert(varchar(max), @MergeQuery3)
+ ' ' + convert(varchar(max), @MergeQuery4)
+ ' ' + convert(varchar(max), @MergeQuery5);
exec(@MergeQuery);
end try
begin catch
declare
@Message VARCHAR(4000)
,@Severity INT
,@State INT;
select
@Message = ERROR_MESSAGE()
,@Severity = ERROR_SEVERITY()
,@State = ERROR_STATE();
if @@TRANCOUNT > 0
rollback transaction;
raiserror(@Message, @Severity, @State);
end catch;
if @@trancount > 0
begin
commit transaction;
end
--End of existing code
End
else
Begin
declare @InsertQuery nvarchar(max)
set @InsertQuery = convert(varchar(max),@InsertQuery1)
exec (@InsertQuery);
end
Drop Table ##TblTemp
=================================
SSIS Variable @InsertQuery1:
This variable is executed in SQL Task and the last 3 lines I expect a single row of Insert & Update counts to be returned.
declare @ChangeSum table(change varchar(25));
declare @Inserted int = 0;
declare @Updated int = 0;
While 1 = 1
Begin
INSERT INTO [R_Paid].[BusCodeF454x93]
OUTPUT Inserted.Sta3n INTO @ChangeSum
SELECT TOP 1000 s.*
FROM [R_Stage].[BusCodeF454x93] s
WHERE NOT EXISTS
SELECT 1
FROM [R_Paid].[BusCodeF454x93]
WHERE STA3N=S.STA3N and [BusCodeF454x93IEN] = s.[BusCodeF454x93IEN]
IF @@ROWCOUNT = 0 BREAK
END
set @Inserted = (select count(*) from @ChangeSum );
set @Updated = 0;
select @Inserted as Inserted, @Updated as Updated;"SELECT " + (DT_WSTR,50)@[User::TargetExists] + " = CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END
FROM " + (DT_WSTR, 100) @[User::DataDestinationTable]
must do the trick
The T-SQL merge allows both inserts and updates:
MERGE Target AS T
USING Source AS S
ON (T.EmployeeID = S.EmployeeID)
WHEN NOT MATCHED BY TARGET AND S.EmployeeName LIKE 'S%'
THEN INSERT(EmployeeID, EmployeeName) VALUES(S.EmployeeID, S.EmployeeName)
WHEN MATCHED
THEN UPDATE SET T.EmployeeName = S.EmployeeName
WHEN NOT MATCHED BY SOURCE AND T.EmployeeName LIKE 'S%'
THEN DELETE
OUTPUT $action, inserted.*, deleted.*;
ROLLBACK TRAN;
GO
Arthur My Blog -
Windows 8.1 PC, using reader, when searching a folder containing approx 100 doc's. If i search for a word, no results are returned. only the doc names can be found but nothing from within the doc.
This is a new problem and was not the case before.Works perfectly fine for me with the latest Reader version (11.0.09).
You write that it worked "before"; before what? An update? Update from what version to what version? -
Failed to retrieve all the results. Try running the query or stored procedure again
I have a Product table in Azure SQL Database. I can't open data in Product table. I got an error message like this.."Failed to retrieve all the results. Try running the query or stored procedure again". In my Database
all tables showing their data expect Product table. Please let me know why only Product table showing error message. Thanks in Advance.Hi,
I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience
As this requires an expert advice, I suggest you to open a support case and our experts would be able to assist you further.
http://support2.microsoft.com/common/international.aspx?RDPATH=%2fdefault.aspx%3fid%3dfh%253ben-us%253bofferprophone
Girish Prajwal -
Hi All
We got stuck when our 6i character mode report migrate to 11g.
We use the same PC to test, when run 6i report(character mode with 200 column) in legacy system, report result were correct in our matrix printer ,
When running in 11g, if we directly print report via report builder (without preview), result were correct.
But running report via preview/screen mode, printing result were incorrect ( not 200 column width).
We try to adjust PC's printer/paper setting , but our-defined printing option never appeared in printer dialog.
Is anything(config or some setting) we forgot to do in this situation ?
Thanks for all your patient response!
HendryHi Shahmayur,
I too am facing the same problem. If your problem is cleared then please let me know, so that i can continue the work.
Rgds
Bhaskar -
How to know how many records is returned by the query in report
Hi
i want to know how many records has been returned by a sql statement in a report.
can any one help me to solve this problem.
santosh.you need to create a summary column with count function for a column in your select query. then u can print that formula column to know the no of rows selected in a query for a report
-
How do I count the number of records returned in the CMIS query
How do I count the number of records returned in the query CMIS?
SELECT COUNT(*) FROM ora:t:IDC:GlobalProfile WHERE ora:p:xRegionDefinition = \'RD_PROJETOS_EXCLUSIVOS\''}
Euler HomeroHi Euler,
interestingly enough, the reference guide for CMIS ( http://wiki.alfresco.com/wiki/CMIS_Query_Language ) that I found does not mention the COUNT function at all. On the other hand it states that: "The SELECT clause identifies which virtual columns to return in the result set. It can be either a comma-separated list of one or more queryNames of properties that are defined by queryable object types or * for all virtual columns."
There are, however, some other posts like e.g. http://alfrescoshare.wordpress.com/2010/01/20/count-the-total-number-of-documents-in-alfresco-using-sql/ which state that they could make it working.
Having asked in the WebCenter Portal forum, I assume that your content repository is WebCenter Content. The CMIS doc for the Content is available here: http://docs.oracle.com/cd/E23943_01/doc.1111/e15813.pdf (no COUNT there either). It does, however, mention explicitly that "CMIS queries return a Result Set where each Entry object will contain only the properties that were specified in the query.". This means your could rather investigate the Result Set. Note that there are also other means than CMIS how to get the requested result set (e.g. calling a search service directly via so-called RIDC).
In the given context I am also interested what your use case is. OOTB CMIS in WebCenter Portal is used, for instance, in Content Presenter, where it is content rather than "parameters" what's displayed. -
Display records returned for a query in the Report Region Title
Hi,
Is there any variable set that can be referenced to indicate how many records have been returned for a specific query. I have several hide/show regions dealing with various reports, and I would like to add a little info into the region title to display how many records there were returned for the report in this region.
Thx in Advance,
cliffHi,
addendum
These are simple sql queries BTW. I've seen posts alluding to the SQL%ROWCOUNT when using cursors. Is there any variable we can reference when using a simple sql query?
thx
cliff -
I have a .Net mobile service.
Calling this:
https://qserv.azure-mobile.net/tables/items?$filter=(company%20eq%20%27987af3f9-8d44-4a9d-8be2-7e0567287106%27)
Returns:
{"message":"The query specified in the URI is not valid. Could not find a property named 'company' on type 'Default.<>f__AnonymousType2_3OfString_String_Double'."}
The field name in the "items" entity model is "company" and on the database is "company_Id", neither will work.Using http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.2.5.min.jsWhat is wrong?
RegardsI see. Now works. So it would be like doing "SELECT ITEM,CATEGORY,COUNTRY, FROM TABLE WHERE CATEGORY='toy' AND COUNTRY='US'"
All rows will contain the "CATEGORY" and "COUNTRY" fields (or more), which is kind of redundant and bandwidth consuming.
Hope MS can change this.
Regards -
Hi Experts,
I have a query which calculates the quantity for a particular date, the results are wrong in the query. i checked the data in the psa it matches with the data from the source system, the keyfigure is set to addition in update rules.can any one let me know why am i getting the wrong results.
Thank You,Hai Shetty,
Your question is very vague. Most of the times, overwriting or addition depends on the way the system is designed and the requirement. As far as I understood. You have data in a cube or ODS and your report values donot match with the values in PSA. If thats the case, I would go step by step.
1. Select some of the records that have eronous values.
2. For the same records(based on primary keys), I would check the data in PSA and the data in ods or cube. If you have any intermediate stages, check them too. then you can findout where its going wrong.
3. If the data in one target(PSA) donot match with the immediate target(ODS or Cube), then there is certainly problem with either start routine or mapping or the addition or over writing. It depends on the system you are working on.
4. If the data in ODS or cube doesnot match with report, then you can check the query logic.
Hope this helps. Let me know if you need more information.
Thanks. -
Hierarchy Subtotals in the Query
Hi,
I have inserted a GL Account hierarchy in the query,all amounts are okay in the query except the subtotals. The subtotals are totally wrong, its giving me this message:
Diagnosis
The function Calculate Results as ... could not be applied everywhere.
Recalculation of a resutls row is always based on the amount of detail cells subordinate to this cell, which is the finest details of a drilldown. It is not possible to recalculate resutls in hierarchical lists. This means that calculation of a results cell is not performed if a row or column with an expand symbol is subordinate to it. With recalculation, the newly calculated result has to change with each expansion of a node subordinate to it. This is not supported for technical reasons and would only confuse the user.
Note, however, that Calculate Results as -> Suppress Results is always executed, because the problem above does not apply in that case.
I need to combine Purchasing and Price GL accounts in one line.
How can I:
1. Fix the sub-totals
or
2. Combine Purchamsing and Price GL accounts in one line
ThanksHi Dave,
For sub totals, the message suggests that for that column you have used a result/single value calculate as, instead of default nothing defined.
And in case of hierarchies, custom result calculations is not supported.
Second one about adding multiple GL values. I guess you are intended to use GL Hierachy in your rows. If that is the case then the values will be shown only against the respective nodes.
In the case, the intention is not to use GL hierarchy, then create two selections/restricted key figures, each one restricting by Purchasing accounts and Price accounts and then sum them up using a formula.
This should provide the desired result.
Do let us know, if you are looking for some thing else.
Naveen.A -
Filtering users based on return of past query
Greetings!
We have a Users table with over 3 million user records in it (like a data warehouse). The requirement is to execute 2 queries on the Users table, where the return of the second query should not have any users that were returned in the first query.
For e.g. Consider a sweepstake user-list, where you want to send flyers to people, notifying them about prizes, but do not want to send two flyers to the same person, even if he fulfills the selection criteria for both the sweepstakes.
So -
Query.1. has conditions, which state: All Users from New York, with age=25 (independently run, returns 500,000 users)
Query.2. has conditions, which state: All Users of age=25 (independently run, returns 700,000 users)
Expected Output:
Query 1 should return 500,000
Query 2 should return 700,000 MINUS those users that were already returned in Query 1. i.e. Only return all users of age 25, but who are not from New York
Any inputs will be much appreciated!
Thanks,Given that you know that the first query uses state = NY and age = 25, why can't you do the second query as:
SELECT * FROM table
WHERE age = 25 and
state <> 'NY'John -
Periodic Alert-How to send all the records returned from the SQL in a mail?
Hello all,
I have defined a Periodic Alert, my SQL query returns more than one record whenever I run it. I also defined an action to send an email with the message consisting of the output variables from the SQL. Whenever i run this alert, a mail is being sent for every single record returned from the query. But i want to send a single mail containing all the records information that my SQL query returns.
For Example: My SQL query lists all the users created on current date.
Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
from fnd_users where trunc(creation_date) = trunc(sysdate)
Now i want to send a mail with all the users information from the above query, to SYSADMIN. How can this be achieved?
Thanks & Regards
chakooHi Chakoo,
If the Periodic Alert is not working as requried. You can write a simple package with 3 procedures to implement the writing output to a out file and simultaneuosly send email to multiple receiptents.
Example:
Create Package xx_pac
Create public Procedure P1
begin
Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
from fnd_users where trunc(creation_date) = trunc(sysdate)
fnd_file.put_line (fnd_file.output, &OUTPUT1, &OUTPUT2);
end;
(Create private Procedure P2
begin
---Write the email package using the UTL_SMTP approch. Using this approch you can send the procedure P1 output file as an attachment to the desiginated receiptents.
end;
(Create public Procedure P3
begin
---call the procedure P1 using the "g_request_id = fnd_request.submit_request"
---Wait for the above procedure to complete using "l_conc_status := fnd_concurrent.wait_for_request" procedure.
---call the procedure P2. (When called you must provide the correct to, from address)
end;
end;
Register the Package xx_pac as a concurrent program and schedule when submit it from the request.
Regards
Arun Rathod -
Extra condition added in the query
Hi All,
I have created a report but its not showing all the results.When I checked the query I saw the extra filter (where ( D1.c7 = 1 )) .I have not added any such filter.Can someone please tell me how this filter has got added and how we can avoid OBIEE to add such filter for this report.Below is the query:
select T203238.ENTITY_TYPE as c1,
T203238.ENTITY_NAME as c2,
cast(T183904.DAY as DATE) as c3,
cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'hh24'), '99') as CHARACTER ( 30 ) ) as c4,
concat(concat(concat(concat(cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'hh24'), '99') as CHARACTER ( 30 ) ), ':'), cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'mi'), '99') as CHARACTER ( 30 ) )), ':'), cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'ss'), '99') as CHARACTER ( 30 ) )) as c5,
sum(T203256.USAGE_VALUE) as c6,
ROW_NUMBER() OVER (PARTITION BY T203238.ENTITY_NAME, T203238.ENTITY_TYPE, cast(T183904.DAY as DATE) ORDER BY T203238.ENTITY_NAME ASC, T203238.ENTITY_TYPE ASC, cast(T183904.DAY as DATE) ASC) as c7
from
(Select a.entity_pk_key entity_fk_key,a.Entity_Name Entity_Name,a.Entity_Description Entity_Description,d.meaning Entity_Type,c.plant_name Site_Name, b.System_Name System_Name,a.Production_Entity Production_Entity,a.Business_Function Business_Function,E.MEANING Status from
( SELECT EQUIPMENT_PK_KEY ENTITY_PK_KEY,EQUIPMENT_Name Entity_Name, EQUIPMENT_Description Entity_Description,'EQUIPMENT' Entity_Type, plant_fk_key, System_fk_key, PRODUCTION_EQUIPMENT Production_Entity ,
NULL Business_FUNCTION, STATUS FROM MTC_EQUIPMENTS_D)a
) T203238,
apps.MTC_HOUR_MV T183904 /* Dim_445_Period_Calendar_Hour */ ,
( SELECT e.ENTITY_FK_KEY,e.ENTITY_TYPE, Sum(e.USAGE_VALUE) USAGE_VALUE ,avg(e.N_EXT_ATTR1) N_EXT_ATTR1,avg(e.N_EXT_ATTR2) N_EXT_ATTR2, hour_fk_key FROM
(SELECT ENTITY_FK_KEY,B.MEANING ENTITY_TYPE, USAGE_VALUE ,NULL N_EXT_ATTR1,NULL N_EXT_ATTR2,hour_fk_key FROM MTH_ENTITY_SUSTAIN_ASPECT A,FND_LOOKUP_VALUES B
WHERE B.LOOKUP_TYPE IN ('MTH_USER_DEFINED_ENTITIES', 'MTH_OTHER_ENTITY_TYPE')
AND B.LANGUAGE = USERENV('LANG')
AND UPPER(A.ENTITY_TYPE)=UPPER(B.LOOKUP_CODE)
AND METER_CATEGORY ='PRIMARY'
AND SUSTAIN_ASPECT='ELECTRICITY'
AND entity_fk_key=1149
AND hour_fk_key IN(7283,7294,7300,7301,7302,7303,7304,7305,7306,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7295,7296,7297,7298,7299)
)e
GROUP BY entity_fk_key,entity_type ,hour_fk_key
) T203256
where ( T183904.HOUR_PK_KEY = T203256.HOUR_FK_KEY and T203238.ENTITY_FK_KEY = T203256.ENTITY_FK_KEY and T203238.ENTITY_TYPE = T203256.ENTITY_TYPE )
group by T203238.ENTITY_NAME, T203238.ENTITY_TYPE, cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'hh24'), '99') as CHARACTER ( 30 ) ), cast(T183904.DAY as DATE), concat(concat(concat(concat(cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'hh24'), '99') as CHARACTER ( 30 ) ), ':'), cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'mi'), '99') as CHARACTER ( 30 ) )), ':'), cast(TO_NUMBER(TO_CHAR(T183904.TO_TIME, 'ss'), '99') as CHARACTER ( 30 ) ))
) D1 )
where ( D1.c7 = 1 )
Thanks a lot in advanceNo,I am not having any topn or bottomn filters in my query .
1. I am having entity type and entity name in the report which comes form the view in rpd(view defn:SELECT EQUIPMENT_PK_KEY ENTITY_PK_KEY,EQUIPMENT_Name Entity_Name, EQUIPMENT_Description Entity_Description,'EQUIPMENT' Entity_Type, plant_fk_key, System_fk_key, PRODUCTION_EQUIPMENT Production_Entity ,
NULL Business_FUNCTION, STATUS FROM MTC_EQUIPMENTS_D) .I
2. want to see the data at hour level so the hour data comes from apps.MTC_HOUR_MV .
3. I want to see sum(usage_value) for a entity type,entity name and hour dimension .Sum(usage_value) comes from the view in rpd which has the definition:SELECT e.ENTITY_FK_KEY,e.ENTITY_TYPE, Sum(e.USAGE_VALUE) USAGE_VALUE ,avg(e.N_EXT_ATTR1) N_EXT_ATTR1,avg(e.N_EXT_ATTR2) N_EXT_ATTR2, hour_fk_key FROM
(SELECT ENTITY_FK_KEY,B.MEANING ENTITY_TYPE, USAGE_VALUE ,NULL N_EXT_ATTR1,NULL N_EXT_ATTR2,hour_fk_key FROM MTH_ENTITY_SUSTAIN_ASPECT A,FND_LOOKUP_VALUES B
WHERE B.LOOKUP_TYPE IN ('MTH_USER_DEFINED_ENTITIES', 'MTH_OTHER_ENTITY_TYPE')
AND B.LANGUAGE = USERENV('LANG')
AND UPPER(A.ENTITY_TYPE)=UPPER(B.LOOKUP_CODE)
AND METER_CATEGORY ='PRIMARY'
AND SUSTAIN_ASPECT='ELECTRICITY'
AND entity_fk_key=1149
AND hour_fk_key IN(7283,7294,7300,7301,7302,7303,7304,7305,7306,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7295,7296,7297,7298,7299)
)e
GROUP BY entity_fk_key,entity_type ,hour_fk_key
this view entity_fk_key and entity_type joins with enity_fk_key and entity_type of entity diemnsion and hour_fk_key joins with hour_pk_key of MV definition.
I am having entity type,entity name,day,hour,sum(usage_value) in the report
Thanks a lot for your help -
Hi All,
I am new to webadi. Pls do the needful to resolve my problem. My clinet gave letter names and he told me that, letter are retriving incorrrect results. So, change the query to get the proper details. So, Can anobody suggest what i need to do like where to change the qurery and how to find integrator.?
Thanks in advance.
Hasini.Hi Mohan,
First you may want to check if this error is surfaces in other environments as well or this is the only environment where you are seeing this.
If it does not work only in this environemnt you may want to have a look at the counters table and check if all counter are good.
also if any of the values are hardcoded you may wnat to check if they conflict with something in the UCM.
also cehck ther permission of ther service that you are calling.I hope you are calling CHECKIN_UNIVERSAL.
hope it helps.
cheers,
swapnil
Maybe you are looking for
-
CS3 - Video freezes on Capture and Playback - Please Help!
Hello all, Here's the problem: When Capturing footage via firewire from Mini DV, shot in standard DV, within a standard NTSC-DV Widescreen 48k Project, the picture freezes after 1 second. The audio can still be heard and the footage actually does ge
-
Installing XI 3.0 on Solaris - install error occurs
WAS 640 oracle successfully installed, then I start the XI install and right at the begining I get the following error: WARNING 2004-11-02 13:06:50 Execution of the command "/usr/bin/java '-classpath' '/tmp/sapinst_exe.29773.109 9418777/JAR/ins-j2ee.
-
I synconized my photos with the website. I decide I want to remove them from my website & restore them to my PC. How do I do this? Thanks, Alice
-
How to restore command shift 3 instead of grab
I always used command+shift+3 to photograph the desktop and command+shift+4 to photograph a selection of the screen. Then, one day I lost it and had to use Grab, which it takes longer to use. Can anyone help me restore that? Thank you. Beltran
-
My apps keep crashing. Is this an iOS problem and what can I do?
Every time I open an app, regardless of whether or not it comes built into iOS, it opens and will work for a little bit, but then crashes. The main apps I use are Safari, the Contacts app that comes standard in iOS, and Textfree + VM. Do I need to re