#mysql
11 October 2007
Total 31 pages. You are browsing page 3/31.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
01:55 <****> Annihilation: and It's not possible to make it more seamless than that? There's no concept of a derived field in a table, except for views?
01:55 <****> lgbr: I'm not sure i understand what you're getting on. You're creating a view, and this isn't seamless enough?
01:57 <****> Annihilation: a view isn't a field in a table with data
01:57 <****> create view inventory.value as select itemnumber, description, price, qty, (price*qty) as value
01:59 <****> CREATE VIEW test.value AS SELECT price, qty, (
01:59 <****> price * qty
01:59 <****> ) AS value
01:59 <****> FROM ssn
01:59 <****> just worked for me
01:59 <****> Ok, thanks for your help. I'm just being nit picky, I suppose, since I have to insert data and read data from different places
02:00 <****> If that's not going to work for you, I have no problem finding an alternate solution, but I don't understand how that's not seamless enough?
02:02 <****> Annihilation: What I'd like is to be able to do INSERT INTO t (qty, price) VALUES(2, 100); and have SELECT * FROM t; return qty 2, price 100, value 200
02:04 <****> Why not add a field value and store value on insert?
02:04 <****> hello folks
02:04 <****> is it possible to undo an UPDATE operation?
02:05 <****> Annihilation: I have more complex things to calculate?
02:05 <****> robboplus, perhaps with another UPDATE
02:05 <****> or backup, thats all i know
02:05 <****> Annihilation, foo*bar
02:05 <****> no way to undo?
02:05 <****> from daily backup
02:05 <****> \o/
02:06 <****> no data in some temporary file or table or anything?
02:06 <****> robbo, it depends on what you did - but generally not, no.
02:06 <****> click the blue arrow that looks like a half circle facing left
02:06 <****> i changed 3000+ rows instead of ONE...
02:06 <****> ^
02:06 <****> some column in there that is...
02:06 <****> robboplus, you've learned a valuable lesson
02:06 <****> let's say that 3000 customers got the same name now lol
02:06 <****> olinux oh yes.
02:07 <****> no robbo, there's not.
02:07 <****> fascinating
02:07 <****> ok so backup and some manual work then
02:07 <****> i think 200 names to correct...
02:07 <****> lgbt: select *, (price*qty) as value from table
02:07 <****> try running your query as a SELECT before DELETE or UPDATE
02:07 <****> make sure you see what you expect
02:07 <****> olinux hm very nice trick in fact
02:07 <****> now, find that backup
02:07 <****> btw it was fast - like 0.20sec
02:08 <****> olinux i have a BIG problem, even with the backup
02:08 <****> let's say 200 phone calls tmw
02:08 <****> UPDATE customers SET name = 'Sir/Madam';
02:08 <****> that's what i did.. forgot WHERE
02:09 <****> let me take it straight: fucking hell :)
02:09 <****> robboplus: Everyone has an update story... I once gave several hundred thousand users of an online game the equivilent of 50,000,000 dollars of currency because I forgot my where clause.
02:09 <****> Annihilation oh lol...
02:09 <****> ok i feel better now :)
02:10 <****> btw what did you do next?
02:10 <****> restored from backup
02:11 <****> because I didn't catch the error until the next day. had i noticed it right away, I could have reversed the math "update users set money=money-50000000"
02:11 <****> but that was an arithmetic mistake.
02:11 <****> update users set name="steve"
02:11 <****> there's no way to undo from that without restoring from backup.
02:11 <****> lgbr: any luck?
02:11 <****> hm.
02:12 <****> well in my case i updated SHA1'ed column
02:12 <****> robboplus you have backup?
02:12 <****> yes but it's like 3 days old
02:12 <****> that db isn't backed up daily
02:12 <****> restore it elsewhere and then fix the rows that you can
02:12 <****> i'm really shocked now
02:12 <****> prolly most of your database
02:12 <****> can't even imagine this work
02:13 <****> robboplus: what column did you update?
02:13 <****> or else - i can imagine it but what do i tell all those people that can't authorise themselves tmw..
02:13 <****> Annihilation password one
02:13 <****> i was playing with one damn acc and just updated everyone instead of 1 guy
02:13 <****> robboplus: so you changed everyones password to "apple" or some other?
02:13 <****> Annihilation yes
02:13 <****> even worse
02:14 <****> it's SHA1'ed and login name is used there together with pass
02:14 <****> i'm thinking of a reverse operation but it just can't work
02:14 <****> robboplus: is there a recover lost password function?
02:14 <****> i don't even know those passes
02:15 <****> nope
02:15 <****> not in this case
02:15 <****> those people will just go paranoid tmw :)
02:15 <****> how do the users set their password?
02:15 <****> we do that
02:15 <****> robboplus, see multi table syntax http://dev.mysql.com/doc/refman/5.0/en/update.html
02:15 <****> olinux hm.
02:15 <****> restore your customers table as customers_backup
02:16 <****> hm.
02:16 <****> now update passwd col with the correct passwd from the backup
02:16 <****> understand?
02:16 <****> you can match your live table to the backup using ID
02:16 <****> hm i think i did even though i'm so nervous now that i hardly know what is 2+2 :)
02:17 <****> oh yes got ID and some other data to match with, so that shouldn't be a prob
02:17 <****> so if i'm a user and i want to change my password, i have to call you and tell you what i want it changed to?
02:17 <****> you are going to update your table by selecting the correct password from the backup
02:17 <****> do these users know each others user names?
02:17 <****> so at least i will be able to recover 90% od the data fast
02:17 <****> so the only prob you have is any changes to the pasword in the past 3days
02:17 <****> Annihilation no, you don't change it.. we do it for you and we call you :)
02:17 <****> does your system have sendmail capability?
02:18 <****> nope
02:18 <****> olinux yes, exactly.
02:18 <****> olinux and that is impossible to handle other than calling everyone or receiving their calls
Total 31 pages. You are browsing page 3/31.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
