Re: Function

2014-12-17 Thread shawn l.green
On 12/12/2014 2:38 PM, Alexander Syvak wrote: Hello! How is actually a function done internally in MySQL after CREATE FUNCTION statement? Why can't there be a dynamic SQL inside a function? Sorry for the delay. The answer is embedded in this description of what is or is not allowed with

Re: function INTERVAL in view

2012-09-18 Thread hsv
2012/09/17 13:11 -0500, Peter Brawley Looks like a bug. Report it? It was reported: Bug #45346 VIEW containing INTERVAL(...) can be created but does not work Submitted: 5 Jun 2009 10:00 Modified: 5 Jun 2009 10:16 Severity:S3 (Non-critical) Version:6.0, 5.4, 5.1 OS:Any Seems

RE: function INTERVAL in view

2012-09-17 Thread Steven Staples
> -Original Message- > From: Rick James [mailto:rja...@yahoo-inc.com] > Sent: September 17, 2012 3:04 PM > To: peter.braw...@earthlink.net; mysql@lists.mysql.com > Subject: RE: function INTERVAL in view > > INTERVAL is a keyword. This is probably the root of the h

RE: function INTERVAL in view

2012-09-17 Thread Rick James
INTERVAL is a keyword. This is probably the root of the hiccup. Is that your Stored Function? Or UDF? > -Original Message- > From: Peter Brawley [mailto:peter.braw...@earthlink.net] > Sent: Monday, September 17, 2012 11:12 AM > To: mysql@lists.mysql.com > Subject: Re: fu

Re: function INTERVAL in view

2012-09-17 Thread Peter Brawley
n 2012-09-17 12:58 PM, h...@tbbs.net wrote: My MySQL is of version 5.5.8-log. I find I cannot save a query with INTERVAL in a view: redundant round brackets are added. If the query is SELECT INTERVAL(1, 2, 3, 4) within the frm file there is the expression interval((1, 2, 3, 4)) which is wron

Re: function to limit value of integer

2011-02-11 Thread Riebold, Philip
log(2, no_of_jobs + 1) will give 0 for 0 jobs, 1 for 1 job, 1.58 for 2 etc. etc. On 11 Feb 2011, at 14:04, Johan De Meersman wrote: > How about the square root of the number of jobs, or some other root if you > want another coefficient? That doesn't have the limiting behaviour a > logarithmic fu

Re: function to limit value of integer

2011-02-11 Thread Johan De Meersman
How about the square root of the number of jobs, or some other root if you want another coefficient? That doesn't have the limiting behaviour a logarithmic function offers, though. On Fri, Feb 11, 2011 at 2:08 PM, Richard Reina wrote: > Hi Travis, > > This is very helpful thank you. Howev

Re: function to limit value of integer

2011-02-11 Thread Richard Reina
Hi Travis, This is very helpful thank you. However, is there a way to make it not be less than a 1. As it's written below someone with one job gets a zero and someone with no jobs gets a NULL. It would be great if someone with 1 job got a 1 and someone with zero jobs got a 0. Thanks again, R

RE: function to limit value of integer

2011-02-10 Thread Travis Ard
Maybe some sort of logarithmic expression? select no_of_jobs, 10 * log(10, no_of_jobs) as job_weight from data; Of course, you'd have to tweak your coefficients to match the weighting system you want to use. -Travis -Original Message- From: Richard Reina [mailto:gatorre...@gmail.com] S

Re: Function Question

2011-01-12 Thread mos
Have you tried: select UserName, Sum(ColB) from Table group by UserName; or select UserName, Sum(ColB) from Table group by UserName where UserName="Emily"; Mike At 11:43 AM 1/12/2011, Nicholas Moreno wrote: My issue is actually in Excel. I'm hoping someone could help me... I need to to

Re: Function call reult in a WHERE-IN clause

2008-12-17 Thread ceo
Perhaps pass in a "separator" string arg, default to '' and do: GROUP_CONCAT(DISTINCT h.hostid, separator) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

RE: Function returns null when running sql manually works

2008-11-13 Thread Cantwell, Bryan
END IF; SET filterTMP = NULL; END; END IF; UNTIL done END REPEAT; CLOSE cur1; RETURN filterSQL; END$$ DELIMITER ; -----Original Message- From: Cantwell, Bryan [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2008 5:13 PM To: mysql@lists.mysql.com Subject: RE:

RE: Function returns null when running sql manually works

2008-11-13 Thread Cantwell, Bryan
OK, I know WHY it is returning null, just not WHAT to do about it. In the inside sql, there is not always a result. So, done becomes 1 and the repeat exits. How can I keep from this happening? How could I make another 'done' like variable that would not get also set to 1 if the inner sql doesn't

Re: Function Still Not Working

2008-06-15 Thread Jesse
you not ADD Binary, you need to "remove" BINARY ... ;-) Sorry, I misunderstood. convert the string to latin1 or utf8 o.s.s. "LOWER() (and UPPER()) are ineffective when applied to binary strings (BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert the string to a non-binary s

RE: Function Still Not Working

2008-06-13 Thread Boyd, Todd M.
> -Original Message- > From: Jesse [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 12, 2008 1:40 PM > To: Martijn Tonies; MySQL List > Subject: Re: Function Still Not Working > > > Any difference in default collation? > > Not sure what that is. I'm

Re: Function Still Not Working

2008-06-12 Thread Jesse
does it work outside the function? Yes, If I run: select CONCAT(UPPER(SUBSTRING('JESSE',1,1)),LOWER(SUBSTRING('JESSE',2))); replacing cInput with 'JESSE', it returns "Jesse" as it should. did you tried SUBSTRING(cInput, 2)? Tried replacing SUBSTRING(cInput FROM 2) with SUBSTRING(cInput, 2)

Re: Function Still Not Working

2008-06-12 Thread Jesse
Any difference in default collation? Not sure what that is. I'm using a visual tool (EMS) to create my function, and it doesn't offer that option. I could update it using the command prompt, however. I may try that later. -- MySQL General Mailing List For list archives: http://lists.mys

Re: Function Still Not Working

2008-06-12 Thread Jesse
I am curious about that, as well. It brings to mind a discussion that happened on this list last week (I believe) about case sensitive/insensitive use of LIKE. I believe the synopsis was that tables are either created as case-insensitive, or the search needs to be specified as case sensitive (with

RE: Function Still Not Working

2008-06-12 Thread Boyd, Todd M.
> -Original Message- > From: Martijn Tonies [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 12, 2008 6:23 AM > To: MySQL List > Subject: Re: Function Still Not Working > > Hey, > > > Sorry for posting this again, but I got only one response last time, &g

Re: Function Still Not Working

2008-06-12 Thread Sebastian Mendel
Jesse schrieb: Sorry for posting this again, but I got only one response last time, and I'm still having the problem. I spent HOURS the other day manually going through the data and Properizing these things by hand. I don't want to do that again if I can avoid it. If anyone has any clues on

Re: Function Still Not Working

2008-06-12 Thread Martijn Tonies
Hey, > Sorry for posting this again, but I got only one response last time, and I'm > still having the problem. I spent HOURS the other day manually going > through the data and Properizing these things by hand. I don't want to do > that again if I can avoid it. If anyone has any clues on this o

Re: function/procedure error!

2008-03-06 Thread Thufir
On Thu, 06 Mar 2008 08:05:06 -0800, puntapari wrote: > And returning a list of numbers? It can be and how? A bit tangential, but this calculation could be done recursively with ruby. Are you tied to SQL for this? -Thufir -- MySQL General Mailing List For list archives: http://lists.mysql

RE: function/procedure error!

2008-03-06 Thread Rolando Edwards
Subject: RE: function/procedure error! I have a more masochistic way to do this without a table DELIMITER $$ DROP PROCEDURE IF EXISTS `test`.`sp_NumberList` $$ CREATE PROCEDURE `test`.`sp_NumberList` (LastNumber INT) BEGIN DECLARE j INT; DECLARE SQLPiece TEXT; DECLARE SQLStmt TEXT; SET j

RE: function/procedure error!

2008-03-06 Thread Rolando Edwards
END $$ DELIMITER ; The highest you can print out is 3700. Give it a try, and have fun !!! -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 11:22 AM To: puntapari; mysql@lists.mysql.com Subject: Re: function/procedure error! At 8:05 AM -0800 3/6/0

Re: function/procedure error!

2008-03-06 Thread Paul DuBois
At 9:10 AM -0800 3/6/08, puntapari wrote: Somethin like this? DELIMITER $$ DROP PROCEDURE IF EXISTS `cantidad` $$ CREATE PROCEDURE `cantidad` (in n int ) for i in 0..n loop insert into temp values(i); end loop; select * from temp; END $$ DELIMITER ; Not quite. This will still re

Re: function/procedure error!

2008-03-06 Thread puntapari
Somethin like this? DELIMITER $$ DROP PROCEDURE IF EXISTS `cantidad` $$ CREATE PROCEDURE `cantidad` (in n int ) for i in 0..n loop insert into temp values(i); end loop; select * from temp; END $$ DELIMITER ; Thanks -- View this message in context: http://www.nabble.com/function-p

Re: function/procedure error!

2008-03-06 Thread Paul DuBois
At 8:05 AM -0800 3/6/08, puntapari wrote: Hi! And returning a list of numbers? It can be and how? You cannot return a list. You could generate a result set in a procedure, but it's returned to the client, not the caller. That's why I suggested writing the numbers into a table. Then you can s

Re: function/procedure error!

2008-03-06 Thread puntapari
Hi! And returning a list of numbers? It can be and how? Thanks -- View this message in context: http://www.nabble.com/function-procedure-error%21-tp15875760p15876992.html Sent from the MySQL - General mailing list archive at Nabble.com. -- MySQL General Mailing List For list archives: http

Re: function/procedure error!

2008-03-06 Thread Paul DuBois
At 7:48 AM -0800 3/6/08, puntapari wrote: Hi everybody! I have a little problem with one function. What i want is to make a function which returns me numbers from 0 to the number that receives the function. That can't work. A function returns a single value. Perhaps you can write a procedure

Re: Function returns with NOTHING in a particular database

2007-05-08 Thread Zsolt Csillag
Hello Paul, Thank you for the fast answer. I tried your method, but the result is the same. What is very interesting, the same sql with just the same parameters works perfectly OUTSIDE of the function (I mean in an Sql window). So the same code works in sql window but not in the function. Anoth

Re: Function returns with NOTHING in a particular database

2007-05-08 Thread Paul McCullagh
Hi Zsolt, The problem probably has something to do with an exception that is not handled. Try using a cursor (for example): BEGIN DECLARE done INT DEFAULT 0; declare Akt_keszlet float(5,2) ; DECLARE cur CURSOR FOR SELECT IFNULL( (Select tr_aktualis_keszlet From `termek_raktarhel

Re: function based index

2007-03-13 Thread Jay Pipes
com Subject: Re: function based index In the last episode (Mar 13), Ananda Kumar said: Is it possible to create function based index in mysql as available in oracle. Please point me to any documentation on this. Sorry; mysql doesn't have function-based indexes. The closest you can get in

RE: function based index

2007-03-13 Thread Brown, Charles
Hello Dan. Try it and see if you can: mysql> create index indx101 on tab101(min(c1),c2) ; Answer: Its not supported. -Original Message- From: Dan Nelson [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 13, 2007 9:10 AM To: Ananda Kumar Cc: mysql@lists.mysql.com Subject: Re: funct

Re: function based index

2007-03-13 Thread Dan Nelson
In the last episode (Mar 13), Ananda Kumar said: > Is it possible to create function based index in mysql as available > in oracle. Please point me to any documentation on this. Sorry; mysql doesn't have function-based indexes. The closest you can get in mysql is if you add another column and an

RE: Function in Query has Terrible Impact on Indexes Used

2007-03-12 Thread Caplan, Michael
Hi Brent, That's the ticket! I swapped SYSDATE out for NOW. Thanks to the two of you!!! Mike -Original Message- From: Brent Baisley [mailto:[EMAIL PROTECTED] Sent: March 12, 2007 3:50 PM To: Little, Timothy; Caplan, Michael; mysql@lists.mysql.com Subject: Re: Function in

RE: Function in Query has Terrible Impact on Indexes Used

2007-03-12 Thread Caplan, Michael
dex_1 instead of Index_4 Any other ideas? Thanks! Mike -Original Message- From: Little, Timothy [mailto:[EMAIL PROTECTED] Sent: March 12, 2007 3:38 PM To: Caplan, Michael; mysql@lists.mysql.com Subject: RE: Function in Query has Terrible Impact on Indexes Used My guess, without see

Re: Function in Query has Terrible Impact on Indexes Used

2007-03-12 Thread Brent Baisley
variable in the query, then it's a constant and an index can be used. SYSDATE() is not a constant, it returns a changing value. - Original Message - From: "Little, Timothy" <[EMAIL PROTECTED]> To: "Caplan, Michael" <[EMAIL PROTECTED]>; Sent: Monday, M

RE: Function in Query has Terrible Impact on Indexes Used

2007-03-12 Thread Little, Timothy
My guess, without seeing your database CREATE TABLE statement for this particular table would be that the DATE_FORMAT returns a string, while the LAST_DAY function returns a date-time. If your TLINE_INV_DATE is a VAR/CHAR then use DATE_FORMAT around the LAST_DAY. If TLINE_INV_DATE is a DATE/TI

RE: Function problem

2006-12-08 Thread nikos
iling(x+x*0.20) when x>=100 AND x<150 then ceiling(x+x*0.15) when (x>=150 AND x<200) then (ceiling(x+x*0.10)) when (x>=200) then (ceiling(x+x*0.09)) end case; END$$ DELIMITER ; -Original Message- From: Chris White [mailto:[EMAIL PROTECTED] Sent: Thursday, December 07, 20

Re: Function problem

2006-12-07 Thread Chris White
On Thursday 07 December 2006 04:57, nikos wrote: > WHEN x<50 THEN ceiling(x+x*0.25) > > when x>=50 AND x<100 then ceiling(x+x*0.20) > > when x>=100 AND x<150 then ceiling(x+x*0.15) > > when (x>=150 AND x<200) then (ceiling(x+x*0.10)) > > when (x>=200) then (ceiling(x+x*0.09)) You've declared a ret

Re: Function problem

2006-12-07 Thread Martijn Tonies
> Can somebody tells what's wrong with this fuction? I guess that depends on what it should do, wouldn't it? Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development ques

Re: "Function Does Not Exist"

2005-11-20 Thread Pyt
Does it work if you use a standard command type, and use "call sp_InserNewCamper();" as the command string ? Pyt. On 11/18/05, Jesse Castleberry - [EMAIL PROTECTED]<+mysql+pyt+c1ac2e3ccd.JesseC#msdlg.com@ spamgourmet.com > wrote: > > I'm using the following code in my ASP

Re: "Function Does Not Exist"

2005-11-18 Thread Peter Brawley
Jesse, >I'm using the following code in my ASP.NET application to add a new record >to the database, and return the added ID: You may have persuaded dotNet that your sproc returns something, ie that it is a function, but you apparently created it as a procedure. An sproc returns nothing. PB

Re: Function to show when a field's value was last updated

2005-10-18 Thread Peter Brawley
>I need it some info to help a client defend against a legal challenge. Is there a MySQL function that will allow me to ascertain the date and time that a particular field's value was last updated. I can't find anything in the MySQL documentation. MySQL doesn't store change histories. That's th

Re: Function to show when a field's value was last updated

2005-10-18 Thread Alec . Cawley
news <[EMAIL PROTECTED]> wrote on 17/10/2005 15:45:15: > I need it some info to help a client defend against a legal challenge. > Is there a MySQL function that will allow me to ascertain the date and > time that a particular field's value was last updated. I can't find > anything in the MySQL

Re: Function to show when a field's value was last updated

2005-10-18 Thread Rich
Unfortunately that would have to be designed into the system into a field. When updated, the instructions would be to instruct that field to update. Cheers Mark: > I need it some info to help a client defend against a legal challenge. > Is there a MySQL function that will allow me to ascertain

Re: Function

2004-12-16 Thread Rhino
- Original Message - From: "Ronan Lucio" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 16, 2004 7:36 AM Subject: Function > Hello, > > Is there a way to create my own function on MySQL (4.0.18)? > > We have a site where a product can have it´s price in differents

Re: Function to multiply multiple row values

2004-08-22 Thread Leonardus Setiabudi
> > x > > --- > > 1 > > 2 > > 3 > > 4 > > > > Select sum(x) would return 10 right.. > > > > Now I need a function .. Say fx() so that when I issued > > > > Select fx(x) ... > > It would return 24 which is 1x2x3x4 > > > I assume that the function that yielded 24 was fx(4), not fx(x). In high > s

Re: Function to multiply multiple row values

2004-08-22 Thread Rhino
- Original Message - From: "Leonardus Setiabudi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 22, 2004 11:45 PM Subject: Function to multiply multiple row values > Hi All, > > Can someone point me a function that return the multiplication of query result.. > Hack.. I

Re: Function in Where clause

2004-01-22 Thread Yves Arsenault
Thanks to all those who answered Even after changing the the day() to dayofmonth(), the queries would still not pull out the request information... After a little reflection, I noticed that something had changed this DB was originally an Access DB, and it was converted to MySQL, in the con

Re: Function in Where clause

2004-01-21 Thread Tobias Asplund
On Wed, 21 Jan 2004, Yves Arsenault wrote: > Thanks for your response, > > I'm using ColdFusion along side of MySQL to server dynamic content to some > websites. > > When I run the page that this code is in, I get an SQL syntax error: > Syntax error or access violation: You have an error in your S

Re: Function in Where clause

2004-01-21 Thread Jochem van Dieten
Yves Arsenault wrote: SELECT * FROM events WHERE day(theDate) = '#dayVal#' and month(theDate) = '#session.month#' and year(theDate) = '#session.year#' Can the day() function be used in this way in the WHERE statement? Yes, but only from version 4.1.1 Use DayOfMonth() or preferably Extract() (whic

Re: Function in Where clause

2004-01-21 Thread Yves Arsenault
Thanks for your response, I'm using ColdFusion along side of MySQL to server dynamic content to some websites. When I run the page that this code is in, I get an SQL syntax error: Syntax error or access violation: You have an error in your SQL syntax near '(theDate) = '31' and month(theDate) =

Re: Function in Where clause

2004-01-21 Thread Nitin Mehta
function can b used, but value parameter seems syntactically wrong, check that. '#session.month#' to '$month' which is the language,u r using anyway? - Original Message - From: "Yves Arsenault" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 21, 2004 6:37 PM Subje

RE: Function to extract difference in Minutes from DateTime variables

2003-07-25 Thread Info
Estoy tomando el sol . q -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Function to extract difference in Minutes from DateTime variables

2003-07-25 Thread Info
Estoy tomando el sol . q -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Function to extract difference in Minutes from DateTime variables

2003-07-24 Thread Dathan Vance Pattishall
Use UNIX_TIMESTAMP or TIME_TO_SEC -->-Original Message- -->From: C.F. Scheidecker Antunes [mailto:[EMAIL PROTECTED] -->Sent: Thursday, July 24, 2003 1:43 PM -->Cc: 'MySQL Users' -->Subject: Function to extract difference in Minutes from DateTime -->variables --> -->Hello all, --> -->I need

Re: function question

2003-06-22 Thread Paul DuBois
At 18:23 +0200 6/22/03, Anthony W. wrote: Hi, I'm just wondering is there a function instead of update to overwrite data that has expired?? Or can mysql automatically deletes records or rows that has expires just like cookies delete themselves after expiring. Cookies don't "delete themselves" afte

re: function as default value

2002-09-30 Thread Egor Egorov
Daya, Friday, September 28, 2001, 10:36:30 AM, you wrote: DKD> Can anybody tell me is it possible in the my sql to set the function as DKD> default value, for example can i set the now() function for the date column DKD> field. No, you can't: http://www.mysql.com/doc/en/CREATE_TABLE.html

RE: function call ????

2002-06-29 Thread Cal Evans
wrong mailing list. (This is abuse, you want arguments...down the hall, to your left.) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: toby - [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 29, 2002 6:05 AM To: [EMAIL PROTECT

Re: Function in index

2001-12-22 Thread Carl Troein
Kittiphum Worachat writes: > Is it possible to use function such as year() in index key (like use subpart > for string field that it work) Nope, you'll have to have a column with just the information that you wish to index (except in the case of strings, of course). Also, you yourself will have