If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Chit Chat > Please Help!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-03, 01:35
van02 van02 is offline
Registered User
 
Join Date: Oct 2003
Posts: 2
Exclamation Please Help!

hey guys, i'm having real trouble with a page i can't access, that's really really important! It use to work, but now everytime i go to it, it says,

Server Error in '/' Application.
--------------------------------------------------------------------------------

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.]
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior) +45
DotNetNuke.SchedulesDB.GetRefSchedList(Int32 ModuleId, Int32 UserId, Int32 RICRoleId, Int32 RefRoleId, String History, String StartDate, String EndDate)
DotNetNuke.RefSchedules.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +731

i have absolutely no idea what this all means! please help !!
Reply With Quote
  #2 (permalink)  
Old 11-15-03, 12:15
lucadall lucadall is offline
Registered User
 
Join Date: Nov 2003
Posts: 1
Re: Please Help!

This error is caused by a sub-query that return more than 1 value that is used by a query with one of the operators showed in the error description.

For example,
consider the following query:

Delete
From ECommerceRigheOrdini
Where IdTestata = (
Select R.IdTestata
From ECommerceRigheOrdini R Inner Join ECommerceTestateOrdini T
On R.IdTestata = T.IdTestata
Where R.IdTestata = @IdTestata
And T.CodiceCliente = @CodiceCliente
And T.SuffissoCliente = @SuffissoCliente
And T.Status = 'N'
)

, that contains 3 parameters (@IdTestata, @CodiceCliente and @SuffissoCliente)

If the sub-query

Select R.IdTestata
From ECommerceRigheOrdini R Inner Join ECommerceTestateOrdini T
On R.IdTestata = T.IdTestata
Where R.IdTestata = @IdTestata
And T.CodiceCliente = @CodiceCliente
And T.SuffissoCliente = @SuffissoCliente
And T.Status = 'N'

returns more than 1 value (or record), its result cannot be used by the delete query, because the "=" operator has a list of values (records) on the right (and it has no sense).

If the select statement returns only 1 value, e.g. 150, you can imagine a query like this:

Delete
From ECommerceRigheOrdini
Where IdTestata = (150)

that is correct,

but if the select statement returns two rows than the global sql query is wrong.

I hope this can help.


Bye.
Reply With Quote
  #3 (permalink)  
Old 11-27-03, 15:55
binoculars binoculars is offline
Registered User
 
Join Date: Nov 2003
Posts: 4
Cool subquery

yep!

Instead of a subquery I used a fieldname.
no more errors!
Tanx!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On