From: javad bakhshi Date: September 2 2011 9:51am Subject: Re: Arrays List-Archive: http://lists.mysql.com/mysql/225634 Message-Id: <1314957088.24731.YahooMailNeo@web125720.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1913014913-1314957088=:24731" --0-1913014913-1314957088=:24731 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi again,=0A=0AThanks for the tips. My problem is:=0AI have a Function in M= ysql that has some arguments in the signature as=A0follows:=A0=0A=0ACREATE = FUNCTION Myfunction( type TINYINT, sec SMALLINT, vid INTEGER,=0A=A0 way TIN= YINT, quid INTEGER, day TINYINT )=0ARETURNS CHAR(50)=0ABEGIN =A0=0ADECLARE = result CHAR(50);=0ADECLARE Temp DECIMAL(9,1);=0A=A0 =A0 SELECT Table1( vid,= day, way) INTO Temp;=0A=A0 =A0 IF Temp IS NOT NULL THEN=0ASELECT CONCAT_WS= (',',sec, 0, quid, Temp) into result; =A0=0A=0A=A0 =A0 ELSE=0A=0ASELECT CON= CAT_WS(',',sec, 0, quid, 0 ) into result; =A0=0A=0A=A0 =A0 END IF;=0ARETURN= result; =A0 =A0 =A0=0AEND;=0A=0A=0AThe problem seems to be solved by using= CHAR but I really want to have a sequence of Integers as the result not CH= AR. The reason that I dont use a table to insert the result into it and ret= rieve it later is that this=A0process takes more time that It should.=A0=A0= Any thoughts?=A0=0ABest regards,=0AJavad=0A=0A=0A=0A_______________________= _________=0AFrom: Shawn Green (MySQL) =0ATo: =0AC= c: javad bakhshi ; Johan De Meersman ; "mysql@stripped" =0ASent: Monday, Aug= ust 29, 2011 4:51 PM=0ASubject: Re: Arrays=0A=0AOn 8/27/2011 11:18,=A0 wrot= e:=0A>>>>> 2011/08/26 13:58 -0700, javad bakhshi>>>>=0A>=A0 Thanks guys fo= r the help. but my problem seems to stand unsolved.=0A> <<<<<<<<=0A> Right,= no arrays. Nothing is left but table. I used a temporary table, but note t= hat MySQL also does not let table be returned, or passed in. The table-name= will be *sigh* global.=0A> =0A> =0A=0AIf the table remains an active part = of the connection, you always have access to it. It is possible to pass the= name of the table into a stored procedure and use a prepared statement to = do nearly anything you want to do with the data.=0A=0AWhat is it you are tr= ying to do with this array in the first place?=A0 It sounds as though tryin= g to process this data using the set-oriented functions of the SQL language= is causing you more of a problem than the fact that the language doesn't h= ave an array data type.=0A=0AThere are normally many ways to solve any prob= lem. Perhaps if you shared the problem you are trying to solve, you can see= how many different ways the members of the list can solve it without resor= ting to an array?=0A=0A-- Shawn Green=0AMySQL Principal Technical Support E= ngineer=0AOracle USA, Inc. - Hardware and Software, Engineered to Work Toge= ther.=0AOffice: Blountville, TN=0A=0A-- MySQL General Mailing List=0AFor li= st archives: http://lists.mysql.com/mysql=0ATo unsubscribe:=A0 =A0 http://l= ists.mysql.com/mysql?unsub=3Djavadbakhshi@stripped --0-1913014913-1314957088=:24731--