@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info


Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20



Comments:

<sal> is there a way or a trick to change the decimal poit with the comma from the format() string function?
<speedbird> Hi all, can someone please tell me if there is a way to "include" a separate file in another file, i.e. I want to read (pipe) the contents of my schema.sql into my DB, but I want the schema.sql to include other .sql files I have in my directory.. :\
<mhillyer> Add SOURCE ./silename.sql; to the first file perhaps?
<speedbird> mhillyer: Thanks much that is what I just needed, thanks a bunch
<sal> is there a way to write my own function and then use it in a query?
<mhillyer> !man stored functions
<SQL> (Stored Procedures and Functions) : http://dev.mysql.com/doc/mysql/en/Stored_Procedures.html
<sal> i need to change format("123.321",2) = 123.32 to format("123.321",2) = 123,32
<sal> is there another function that formats numbers or that cuts decimal positions rounding
<mhillyer> The ROUND() function perhaps?
<sal> mhillyer: but will it replace the , with the . ?
<Sonderblade> how do you translate a table join to using the subquery syntax?
<mhillyer> sal: Wrap the call in a REPLACE() function
<sal> mhillyer: in 3 replace() functions
<mhillyer> Three?
<mhillyer> You just want to replace . with , no?
<sal> yep, replace , to x, replace . to , and replace x to .
<sal> need to change . to , and , to .
<Julian|Work> !man lost connection to mysql server during query
<SQL> Nothing found.
<mhillyer> Not following you but as long as you know what you want.
<Julian|Work> Anybody received a "MySQL error 2013: Lost connection to MySQL server during query" before?
<sal> ok, thanks
<Darkstar> if i wanted a column to hold a bunch of keys to another table, what would be the best datatype to do that?
<archivist> Julian|Work, http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
<Darkstar> is it possible to store an array in a column?
<mhillyer> I strongly recommend you do not.
<Darkstar> i cannot figure out how to do this then
<mhillyer> And what is 'this'?
<sal> hello again
<sal> is there a function that converts a string to a number?
<Darkstar> ive got a table of members, and a table of characters, and each member can have multiple characters that somehow need to be stored
<sal> the problem is that round() and format() transform the number into a string
<mhillyer> sal: What kind of string?
<mhillyer> !tell us about normalization
<SQL> mhillyer asked me to tell you this: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html
<mhillyer> Read it Darkstar.
<Darkstar> i did, it says it will talk about a lot of stuff in the next version...
<sal> mhillyer: round(123.321, 2) returns "123.32"
<mhillyer> It answers what you need in this version.
<sal> a string
<mhillyer> sal: the round( is part of the string?
<sal> mhillyer: replace(round(field, 1),'.',',') as field
<sal> that returns a string
<sal> i need it to rturn a number
<inviso> sal: yes, replace returns a string
<mhillyer> You throw a command in there and you have a string according to MySQL, not a number.
<mhillyer> s/command/comma
<mhillyer> Darkstar: Specifically re-read the many-to-many part.
<Darkstar> ok, thanks
<sal> mhillyer: but if i only use field, without any function, i get the comma!!!!
<archivist> sal The return type is the same type as that of the first argument
<sal> archivist: ok, but now way to get back a number?
<archivist> cast it
<sal> oh
<sal> how
<sal> dec() ?
<sal> cast(...) as decimal ?
<sal> could i use that?
<archivist> http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html
<Darkstar> shouldnt my situation be a one-to-many relationship because one member can have several characters?
<mhillyer> sal: Why are you trying to get a comma in there? If you cast it to decimal the comma is gone.
<inviso> sal: sure, but it will clip after the , as , isn't a valid character for a "number"
<sal> hmmm
<sal> so there's no way to do it???
<sal> do i have to return to mssql?
<inviso> sal: if you want a number, . is appropriate. If you want formatting, just use a string.
<mhillyer> You have to clarify what you are trying to do.
<sal> is it possibile that mysql doesn't have a way to change the . with ,?
<sal> mhillyer: need to return a number that uses the comma for a decimal position separator
<mhillyer> It has plenty of ways, what do you want to do with the output?
<sal> mhillyer: ok?
<mhillyer> Return it to what?
<inviso> sal: but why?
<sal> because i need to dispaly the number in a grid
<mhillyer> Then who cares if it is a string?
<sal> and i need it inthe european way
<sal> mhillyer: if it's a string it doesn't get right aligned
<sal> i need it as a number
<inviso> sal: does your grid support 123,45?
<mhillyer> Then send it in as a number
<sal> inviso: yes
<mhillyer> Localization in your grid tool should format the number any way it likes.
<sal> mhillyer: but that measn to leave the .
<inviso> sal: as an input option? That seems rather unlikely. It's a formating thing
<sal> its the vb mshflexgrid
<mhillyer> MySQL p***es raw numbers or it p***es strings. The end tool is responsible for what the number looks like.
<sal> ok... i'll find another way then
<sal> if a can't do it with mysql
<sal> thanks for your time
<sal> bye
<mhillyer> MySQL essentailly says 'here is a number, the integer part is 123 and the decimal part is 45, deal with it.
<inviso> wow, cl***y dude
<mhillyer> That is a VB issue.
<archivist> its normal in some languages to use , instead of .
<mhillyer> Oh sure, archivist, but that is not the server's problem.
<inviso> and it sounded like 123.45 worked fine. It just didn't "display" like he wanted. learn2readdocs.com
<mhillyer> Why do people threaten to go to MSSQL? Why threaten to stop using a free product in favor of a commercial one?
<inviso> I'm convinced some people in life exist only to serve very specific purposes. They serve as warnings, entertainment and even tests of our patience.
<archivist> hehe the french way of writing/speaking numbers is different we english writers just cant understand
<jjb_lyceum> greetings. i just found out that i have to make my project work on 4.0x instead of 4.1x. all this means to me is i have to not use subqueries. can anyone think of a cute way to scan all my code for subqueries?
<archivist> grep
<inviso> jjb_lyceum: grep -Ri "\(select " *
<jjb_lyceum> bam
<firewire> "\(\s+select
<inviso> yeah, good call
<inviso> I'd use ? rather than + though
<xing23> i'm having a problem starting ndb_mgmd on debian can someone help me?
<xing23> i'm getting: ndb_mgmd: error while loading shared libraries: libndbclient.so.0: cannot open shared object file: No such file or directory
<xing23> which is indeed true the .so files are not there, but i dont see them in the max-tarball from the mysql stie either
<m> how to del a foreign key from a table, without dropping the table?
<mhillyer> ALTER TABLE xxx DROP FOREIGN KEY yyy;
<m> hrm
<xing23> so where can i get libndbclient.so.0? or am i missing something?
<jjb_lyceum> inviso and firewire: thanks
<firewire> sure
<jjb_lyceum> i'm reading the docs closer now and it seems like some subqueries are indeed supported in 4.0... but it's very, very unclear... http://dev.mysql.com/doc/refman/4.1/en/rewriting-subqueries.html
<firewire> inviso (\n\t\tselect
<jjb_lyceum> anyone have experience with this?
<b3nw> mhillyer - ty :)
<jjb_lyceum> (inviso firewire : i went with \(\s*select )
<firewire> bam
<firewire> jjb_lyceum show me an example of a sub query that's supported in 4.0?
<mhillyer> b3nw: No Prob. Did I help you?
<b3nw> yep, i figured it out from there
<jjb_lyceum> firewire: that link seems to suggest that some subqueries are supported
<mhillyer> I meant that I don't see a message to you from me in the scrollback ;)
<mhillyer> What link, what text?
<jjb_lyceum> "The IN() construct can be used in other contexts to test membership in a set of values." what the hell does that mean?
<mhillyer> That means SELECT FROM TABLE WHERE id_column IN(1,4,9)
<jjb_lyceum> mhillyer: are you talking to me? i meant this link: http://dev.mysql.com/doc/refman/4.1/en/rewriting-subqueries.html
<mhillyer> That page says 'no subqueries before 4.1, rewrite them this way so you don't need them'.
<jjb_lyceum> mhillyer: well i guess i wouldnt' consider that a subquery... or maybe they were just being redundant
<firewire> jjb_lyceum the in() construct is normally related to sub queries. In mysql it can also be used with a list of numbers
<jjb_lyceum> right...
<mhillyer> You know, other contexts.
<jjb_lyceum> okay okay
<jjb_lyceum> fine.
<jjb_lyceum> : )
<cheeser> if just run "create table blah ..." everything is fine. but I say "create table blah ... TYPE=InnoDB;" i get an error about can't create table
<cheeser> any ideas on how to fix that?
<mhillyer> Not without the specific error message.
<xing23> is there anyone here that can help me with a ndb_mgmd issue?
<mhillyer> Have you tried the NDB FAQ, mailing list, forum?
<cheeser> ERROR 1005 (HY000) at line 11: Can't create table '.\cortrac\lsir_answers.frm' (errno: 150)
<alphablue> hi
<mhillyer> Try SHOW INNODB STATUS, look for a section on last error.
<firewire> MySQL error code 150: Foreign key constraint is incorrectly formed


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

#fedora
#web
pppoa3 suse 10
#perl
#gentoo
lowkey site:www.quotesdb.info
ubuntu mount ftp
gentoo xorg.conf alt_r
Can't use function return value in write context in
genkernel marvell 88E8053



Home  |  disclaimer  |  contact  |  submit quotes