473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

"Subquery returned more than 1 value. This is not permitted..." error

22
Basically I have an app with 3 buttons that populate a Gridview and all but 1 button work and the one that doesn't work brings back this error.

any ideas?
Apr 9 '08 #1
5 896
deric
92
I believe it is an error in your SQL query... Please check your SQL statement for that particular button. If you'll encounter trouble with your SQL quries, please post it on the appropriate SQL forum..
Apr 10 '08 #2
DrBunchman
979 Expert 512MB
Yes, this is a SQL error. If you print the SQL here that's generated by the click of this button I'll take a look at it for you.

Dr B
Apr 10 '08 #3
Barno77
22
Yes, this is a SQL error. If you print the SQL here that's generated by the click of this button I'll take a look at it for you.

Dr B
here's the sql query:
Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT 
  3. SO2_SOEntryDetailLine.SalesOrderNumber, 
  4. SO1_SOEntryHeader.Division, 
  5. SO1_SOEntryHeader.CustomerNumber, 
  6. SO1_SOEntryHeader.BillToName, 
  7. CA_OPS_PICKSEQS.LastPickSeq AS [Pick Ticket], 
  8. SO2_SOEntryDetailLine.ItemNumber, 
  9. SO2_SOEntryDetailLine.WhseCode, 
  10. SO2_SOEntryDetailLine.LineIndex, 
  11. SO1_SOEntryHeader.OrderStatus, 
  12. CA_APICK_QTYS.QtyOrdered, 
  13. CA_APICK_QTYS.QtyAvailable + CA_APICK_QTYS.QtyLoadAvailable AS QtyAvailable, 
  14. CA_APICK_QTYS.QtyPicked AS QtyShipped, 
  15. ISNULL(CA_APICK_LOAD_QTYS.TicketRelease, 0) AS TicketRelease, 
  16. CA_OPS_PICKSEQS.LastPickDateTime, 
  17. CA_APICK_QTYS.PromiseDate, 
  18. SO_90_UDF_Sales_Order.CB_UDF_SOH_OK, 
  19. SO2_SOEntryDetailLine.Extension 
  20. FROM 
  21. CA_APICK_LOAD_QTYS 
  22. RIGHT OUTER JOIN CA_APICK_QTYS ON CA_APICK_LOAD_QTYS.WhseCode = CA_APICK_QTYS.WhseCode AND CA_APICK_LOAD_QTYS.ItemNumber = CA_APICK_QTYS.ItemNumber AND CA_APICK_LOAD_QTYS.SalesOrderNumber = CA_APICK_QTYS.SalesOrderNumber 
  23. FULL OUTER JOIN SO2_SOEntryDetailLine 
  24. INNER JOIN SO1_SOEntryHeader ON SO2_SOEntryDetailLine.SalesOrderNumber = SO1_SOEntryHeader.SalesOrderNumber 
  25. LEFT OUTER JOIN CA_OPS_PICKSEQS ON SO2_SOEntryDetailLine.WhseCode = CA_OPS_PICKSEQS.WhseCode AND SO2_SOEntryDetailLine.SalesOrderNumber = CA_OPS_PICKSEQS.SaleOrderNumber ON CA_APICK_QTYS.SalesOrderNumber = SO2_SOEntryDetailLine.SalesOrderNumber AND CA_APICK_QTYS.LineIndex = SO2_SOEntryDetailLine.LineIndex 
  26. LEFT OUTER JOIN SO_90_UDF_Sales_Order ON CA_APICK_QTYS.SalesOrderNumber = SO_90_UDF_Sales_Order.SalesOrderNumber 
  27. WHERE 
  28. (SO2_SOEntryDetailLine.ItemNumber IS NOT NULL)
  29.  
Apr 10 '08 #4
DrBunchman
979 Expert 512MB
I can't see an obvious problem - have you got a Query Analyzer of something like that which you can run the query in?

If so then run it in there and it should give you the line that's causing the error.

Dr B
Apr 11 '08 #5
jhardman
3,406 Expert 2GB
here's the sql query:
On a scale of 1 to 10, I would rate this ~8.5 of the "most complex SQL statements I've ever seen". I think the error is line 22 where you don't specify how SO2_SOEntryDetailLine joins. Was this generated by visual studio, or did you come up with it yourself? Exactly what does it pull up? Would it be OK to simplify it? for example, if you were OK with just inner joins, you could say:
Expand|Select|Wrap|Line Numbers
  1.       SELECT * FROM SO2_SOEntryDetailLine, SO1_SOEntryHeader,
  2.       CA_OPS_PICKSEQS, CA_APICK_QTYS, CA_APICK_LOAD_QTYS, 
  3.       SO_90_UDF_Sales_Order, SO2_SOEntryDetailLine
  4.       WHERE CA_APICK_LOAD_QTYS.WhseCode = CA_APICK_QTYS.WhseCode 
  5.       AND CA_APICK_LOAD_QTYS.ItemNumber = CA_APICK_QTYS.ItemNumber 
  6.       AND CA_APICK_LOAD_QTYS.SalesOrderNumber = CA_APICK_QTYS.SalesOrderNumber
  7.       AND SO2_SOEntryDetailLine.SalesOrderNumber = SO1_SOEntryHeader.SalesOrderNumber
  8.       AND SO2_SOEntryDetailLine.WhseCode = CA_OPS_PICKSEQS.WhseCode 
  9.       AND SO2_SOEntryDetailLine.SalesOrderNumber = CA_OPS_PICKSEQS.SaleOrderNumber 
  10.       AND CA_APICK_QTYS.SalesOrderNumber = SO2_SOEntryDetailLine.SalesOrderNumber 
  11.       AND CA_APICK_QTYS.LineIndex = SO2_SOEntryDetailLine.LineIndex
  12.       AND CA_APICK_QTYS.SalesOrderNumber = SO_90_UDF_Sales_Order.SalesOrderNumber
  13.       AND (SO2_SOEntryDetailLine.ItemNumber IS NOT NULL)
Apr 11 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
1
by: Denzil | last post by:
Hi, I am retrieving my DB values and setting them in the MyRS::DoFieldExchange(CFieldExchange* pFX) function. One of these records is a Long datatype and could be "Null" in the DB table. The...
1
by: LazyAnt | last post by:
Does DB2 process "ALL" subquery by "nested iteration" strategy, or using its own special algorithm? For example, assume r(A, B, C) and s(D, E, F) are two relations, consider the following query:...
5
by: Diwa | last post by:
Does the "value" type (value as in key-value pair )of "std::map" require a default ctor even if it is not used ? If I comment out Line 1 in the code attached later, i.e remove the default ctor...
1
by: dschat | last post by:
Hi all, I am receiving: 'SQL0443N The Routine "SQLSTATISTICS" returned an error' when I try to connect to a DB2/OS390 table over MS Access. I bound the database with db2cli.lst, ddcsmvs.lst and...
2
by: flowermusic | last post by:
I am creating a report that would generate a Summary report for Student Activity Attendance. Every student can attend multiple activities, and my report group by student, name, and activity. Then I...
13
by: ThePrinceIsRight | last post by:
I have a problem with using a subquery in MS Access. The purpose of the sub-query is to create a list of people who have had doctor exams in the past 6 months and exclude them from the main query....
10
by: MLH | last post by:
I would like to call a function that "returned" several values - all of which are relevant to the needs of a procedure on a form. I do understand that FN's return a single value. I'm wondering,...
11
by: nelsonbrodyk | last post by:
Hey All, I want to use a resource file to store key/value pairs (resx file calls them Name/Value) for errors. I want the Key(Name) to be the error code, and the value to be the message. My only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.