Informix Sql Error 284
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 284: A subquery has returned not exactly one row up vote 0 down vote favorite I'm trying to do an update massive to a table in INFORMIX, but my query returns this error: 284: A subquery has returned not exactly one row This is my query: update newLocations set description= (select unique b.description from newLocations a,locations b where a.id_location=b.id_location ) Here are mi locations table Table: locations id_location id2_location description 02 AAA00 AS-LOC1 05 AA000 AS-LOC2 10 AA010 AS-LOC7 20 AA020 AS-LOC8 30 AA030 AS-LOC9 40 AA040 AS-LOCA 50 AA050 AS-LOCB Here are mi newLocations table Table: newLocations id_location description 02 05 05 05 05 05 10 20 30 40 50 My subquery returns: AS-LOC1 AS-LOC2 AS-LOC7 AS-LOC8 AS-LOC9 AS-LOCA AS-LOCB How can I do to assign the description in newLocations, relating id_location from locations? This is the solution, thanks to Joseph B update newLocations set description= (select max(l.description) from locations l where newLocations.id_location=l.id_location) where exists (select 1 from locations l2 where newLocations.id_location=l2.id_location); And this error: 201: A syntax error has occurred. sql informix share|improve this question edited Apr 24 '14 at 20:40 asked Apr 24 '14 at 15:47 user1600801 134319 1 Location 05 has several different descriptions. Which one did you want? AS-LOC2, AS-LOC3, AS_LOC4 etc... Without ID2_Location in newLOcations, and having that as part of the update, you simply can't do what you're trying to do. The engine doesn't know which 05 to set to what description, even though they may have the same counts. –xQbert Apr 24 '14 at 15:53 Sorry, mi table was wrong. There's unique id_location in locations –user1600801 Apr 24 '14 at 15:59 what da
When using fgldbsch to export the schema of a database fgldbsch failed with error code -284. http://www-01.ibm.com/support/docview.wss?uid=swg21621244 Symptom fgldbsch is stopped with following error message: ------------------------------------------------- 'fgldbslib.4gl', http://www.progtown.com/topic570858-sql-error-284-a-subquery-has-returned-not-exactly-one-row-p2.html line number 1073. SQL statement error number -284. A subquery has returned not exactly one row. ------------------------------------------------ Cause When the some user tables have column name "colattr" fgldbsch would fail. The root cause is an incorrect SQL using in fgldbsch Environment Genero 2.40 Diagnosing informix sql the problem An incorrect SQL cause the problem Resolving the problem 1) Move to the directory where Genero is installed and set the environment. Example: cd /my_genero_top_directory . ./envgenero 2) Edit the copy of the file under $FGLDIR/src/fgldbslib.4gl and around line 1080 add the join information to the query that fails. The code will change informix sql error from: -- Make sure this version of IDS can have shadow columns SELECT COLNAME INTO cn FROM "informix".SYSTABLES T, "informix".SYSCOLUMNS C WHERE T.TABNAME = 'syscolumns' AND C.COLNAME = 'colattr' IF SQLCA.SQLCODE == 0 THEN to -- Make sure this version of IDS can have shadow columns SELECT COLNAME INTO cn FROM "informix".SYSTABLES T, "informix".SYSCOLUMNS C WHERE T.TABNAME = 'syscolumns' AND C.COLNAME = 'colattr' AND T.TABID = C.TABID #added line IF SQLCA.SQLCODE == 0 THEN 3) recompile the file: cd $FGLDIR/lib cp fgldbslib.42m fgldbslib.42m.Original fglcomp ../src/fgldbslib.4gl 4) Apply the same changes of point (2) to the file $GSTDIR/bin/fgl/2.40.03/src/fgldbslib.4gl 5) then recompile this second file: cd $GSTDIR/bin/fgl/2.40.03/lib cp fgldbslib.42m fgldbslib.42m.Original fglcomp ../src/fgldbslib.4gl Related information fgldbsch fglcomp Document information More support for: Informix Tools Informix Genero Software version: 2.4 Operating system(s): Linux, Windows Reference #: 1621244 Modified date: 2012-12-27 Site availability Site assistance Contact and feedback Need support? Submit feedback to IBM Support 1-800-IBM-7378 (USA) Directory of worldwide contacts Contact Privacy Terms of use Accessibility
2) Programmer's Town »Databases »SQL Error (-284): A subquery has returned not exactly one row Pages Previous 1 2 You must login or register to post a reply Topic RSS feed Posts [ 26 to 38 of 38 ] 26 Reply by Jannny 2012-05-06 12:30:41 Jannny Member Offline Registered: 2012-05-02 Posts: 6,415 Re: SQL Error (-284): A subquery has returned not exactly one row wrote: 9 lines interpose Sergeevich of the order of 5-7 seconds... It is interposed long or request long?The plan give 27 Reply by Sergey Sergeevich 2012-05-06 12:43:42 Sergey Sergeevich Member Offline Registered: 2010-10-05 Posts: 361 Re: SQL Error (-284): A subquery has returned not exactly one row I precisely do not know as to check up. But if to fulfill easier request with an output to the screen it is fulfilled almost as much time, how many and with an insertion in the table.And what such the plan? 0:-) 28 Reply by Sergey Sergeevich 2012-05-06 12:44:42 Sergey Sergeevich Member Offline Registered: 2010-10-05 Posts: 361 Re: SQL Error (-284): A subquery has returned not exactly one row 9 lines select 5.907 seconds. It = \ 29 Reply by Iscender 2012-05-06 12:51:42 Iscender Member Offline Registered: 2012-05-02 Posts: 167 Re: SQL Error (-284): A subquery has returned not exactly one row Sergeevich wrote: And what such the plan? 0:-)EXPLAIN PLAN 30 Reply by alex ls 2012-05-06 12:54:43 alex ls Member Offline Registered: 2011-07-13 Posts: 4,235 Re: SQL Error (-284): A subquery has returned not exactly one row wrote: I precisely do not know Sergeevich as to check up. But if to fulfill easier request with an output to the screen it is fulfilled almost as much time, how many and with an insertion in the table.And what such the plan? 0:-)Fie you, again in vain wasted time, reading this topic... here to you at once esteem not to measure time of an output for the screen of the first 10 lines... 31 Reply by Jannny 2012-05-06 12:55:43 Jannny Member Offline Registered: 2012-05-02 Posts: 6,415 Re: SQL Error (-284): A subquery has returned not exactly one row Sergeevich wrote: And what such the plan? 0:-) explain plan for select... / select * from table (dbms_xplan.display); / wrote: 9 lines select Sergeevich of 5.907 seconds. It = \ Basically can and long, but a question not volume that at you 9 lines, and in that, how many it is necessary to shovel Oraklu... At you in request with restrictions , so... Well it simply comment How many records by the way in x1? 32