Help Logs Database

Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Ircnet  |  Dalnet
Page: 1 2 3 4

<frugal> first I need to do a SELECT
<frugal> then find out the value of the field
<frugal> then reduce it by one
<frugal> then do an UPDATE
<lokus> frugal: field = field - 1
<nickg> you can reference the current value of a column in the update query.
<frugal> well I'll be damned
<frugal> it worked
<frugal> thanks!
<brooksie> Does a file that your loading have to be in a certain folder
<nickg> readable by the mysql user
<brooksie> I dont entirly understand the format that a notepad file should be in
<brooksie> in order to be inserted into ta table
<brooksie> Does anyone have a URL for the format a text file should be in in order to be undestood;l
<lokus> brooksie: any format as long as you can separate the fields and records with proper separator
<brooksie> If i have a table already created, and i have several rows to insert
<brooksie> What should it look like
<lokus> brooksie: see load data infile
<brooksie> should it be insert into countries ('blah','blah')
<brooksie> for everyline
<lokus> brooksie: can use any csv like file
<lokus> brooksie: you mean insert statement, that is another way too
<brooksie> yes using the instert statement
<lokus> brooksie: the manual has the full syntax
<brooksie> i have a list that for each row says insert into countries ('blah','blah'); for each row
<brooksie> would that work
<lokus> brooksie: syntax not correct
<brooksie> I dont understand this
<brooksie> I understand completely how to invoke a text file to be read and put into a table, what i dont understand is how i go about making the text file properly readable
<brooksie> The documentation doesnt make much sence to me, and seems like a free for all
<frugal> hey
<frugal> whats the syntax for doing an update under multiple conditions?
<frugal> Like, I said: "UPDATE `productSizes` SET `qty` = `qty` -1 WHERE `productPkey` =77 AND `colourPkey` =34 AND `packType` = '1:2:2:1' AND `peice` = 'top'"
<frugal> and its saying syntax error
<nickg> debug where it says the error is.
<frugal> #1064 - You have an error in your SQL syntax near 'UPDATE `productSizes` SET `qty`= `qty`-1 WHERE `productPkey` = 77 AND `colourPke' at line 1
<frugal> not very discriptive, line one.... the whole thing is line one
<nickg> haha um it says the error is in the beginning, are you sending a " infront of the UPDATE?
<frugal> nope
<lokus> brooksie: read carefully, even examples are provided http://dev.mysql.com/doc/refman/5.0/en/insert.html
<nickg> there has to be something in the beginning if it thikns the error starts at UPDATE
<frugal> no, it just says UPDATE `productSizes`
<frugal> should I use some brackets or something for SET?
<nickg> no
<nickg> the error starts at UPDATE
<frugal> Is update the correct command?
<nickg> yes
<frugal> when one queries by muiltple fields
<frugal> it shouldn't be select set or some****?
<nickg> frugal its not even attempting ot parse anything after UPDATE
<nickg> so dont worry about that
<nickg> the error starts at UPDATE, figure out why.
<frugal> ok
<frugal> can you update without naming the primary key?
<nickg> yes
<nickg> ignore all of that
<nickg> its starting at update, there has to be something incorrect before that
<frugal> weird
<frugal> its working
<pimpwell> should the status of an account (wether confirmed or unconfirmed) (through email confirmation) be handled in a seperate table?
<nickg> do you have a reason to handle it in a separate table?
<pimpwell> #I **** at NF
<pimpwell> just wondering
<pimpwell> so then I guess I just make a column called is_confirmed
<nickg> usually you only place data in another table if it does not have a row to row entry for the current table OR if its for speed.
<JFDionne> hi
<JFDionne> is there a way for doing this?: I want a field named serverid, inside that field I have soething like "4,6,2,98,23" .. it's some id with "," between them ... is there a way for do something like if "4" is inside serverid ...
<nickg> JFDionne create another table.
<nickg> pimpwell there is a simple exampleof why you would need a separate table. one to many relation.
<JFDionne> nickg don't wanna use "join" my table have too many record...
<nickg> JFDionne no, it is not easily possible to determine what you want.
<JFDionne> ?
<nickg> JFDionne think about it
<JFDionne> about what?
<nickg> what it would take to do what you want
<JFDionne> normaly, I'm using a table with 2 fields, my 2 id for link them ...
<nickg> JFDionne c1 = '4' OR c1 LIKE '4,%' OR c1 LIKE '%,4' OR c1 LIKE '%,4,%'
<nickg> i think that woudl cover all options, but you migth want to double check
<sickdm> Q: i've enabled slow query logging,
<sickdm> and in the logs it tells me how many rows were examined in a given query
<sickdm> but if i do EXPLAIN <same query>
<sickdm> the number of rows is dramatically different
<sickdm> like 98,000 VS 20,000
<JFDionne> nickg oh, that the only way.. hmm okay, thanks
<nickg> sickdm explain and slow query logging logs a different value
<brooksie> Anyone have any idea as to why mysqldump wont keeps denying my acsess even though i used my msql user and p***?
<nickg> sickdm explain doesnt do each individual join to see how many rows each row in the first table will find in the second table
<nickg> sickdm the slow log shows that
<sickdm> yeah, this table has a few joins
<sickdm> er *query
<nickg> brooksie the user doesnt have the proper privileges to execute the query. i dont know exactly what you have wrong, that could be anything.
<brooksie> awesome
<nickg> brooksie manually take it a step at a time, first attempt to log in, then attempt to issue the first query, and so on.
<nickg> remember user auth is done on 3 levels: username, p***word AND remote host.
<brooksie> does mysqldump usually take long?
<brooksie> beacuse i just used my root instead of my personal sn
<brooksie> and it didnt throw any errors but it just went down a line and hung
<brooksie> and is still hung
<brooksie> dude how annoying is this ****
<nickg> i would recommend using the --opt or it may eat up needless amounts of ram
<Lebowski> is there a way to reverse the order for a select statement ?
<Lebowski> ie ive got a list of items and i want the newest to display first but theres no date added column
<Archetype> Will any host that lets you run mysql run maxdb?
<mwa1> What text other than varchar can have a default title, if any?
<mwa1> default value*
<nickg> in theory, every string based column type should support a default, why?
<mwa1> Well, I need a default value, longer than 255 characters.
<lokus> mwa1: why so long
<mwa1> Because...that's just what I need?
<lokus> mwa1: encoutered problem :)
<lokus> mwa1: you will likely to waste lots of space
<mwa1> Lokus, alright. I just need a default value, but sometimes I need the value to be longer than 255 characters.
<mwa1> Not the default, but changed.
<lokus> mwa1: is there a limit of 255 chars in default ?
<mwa1> No.
<mwa1> I just can't find any type other than varchar that allows default..
<lokus> mwa1: all types should allow default
<mwa1> "BLOB column 'descr' can't have a default value"
<mwa1> It's column type is text.
<lokus> ops, looks like it is not allowed
<mwa1> I tried other types, same thing.
<lokus> what other types?
<mwa1> longtext, and such.
<lokus> i guess all the text and blob will be the same, not allowed
<lokus> even tiny.
<nickg> mwa1 if the text types do not support it, you have no choice but to code the default into your application
<zeldar> evening all, does anyone have any good links really outlining the pros and cons to storing images in a database?
<Oshcha> Hi
<Oshcha> I have a question about mysql cahracter set problem
<Oshcha> I have 2 DB both MySQL development and production
<Oshcha> I have JAVA application that gets XML from remote webservice ... parse it, and inserts data into DB
<Oshcha> DATA iz UTF-8
<Oshcha> table encodings are utf8
<Oshcha> but problem is that on development DB I see special baltic symbols but on production all of them are replaced with "?"
<Oshcha> where could be the problem?
<Oshcha> anybody? :)
<salle> Oshcha: Doesn't sound like MySQL problem
<flupps> Oshcha: make sure your connection uses UTF8 too
<Oshcha> salle :) if on one db same app works on other not ... where is your arguments that it isnt MySQL problem?
<flupps> Oshcha: Operating system may be configured differently
<Oshcha> flupps hmmm... that`s what I`m thiniking about too
<Oshcha> I dod show variables like '%ch%' and there is some differences in character sets
<salle> Oshcha: If on one db same app works on other not this is enough argument that the problem is not in MySQL, but somewhere in configuration
<Oshcha> salle there is no configuration fot that app it just reads xml ... takes necessary nodes and makes SQL INSERTs and via JDBC executes them
<salle> Oshcha: Come on. If you have two different Character sets configurations you can't expect same results
<Oshcha> I guess this is not the place where to as if it is possible in JDBC session change variables that I see using show variables in mysql console
<Oshcha> salle ... :) Thats what I think too ... but there is lot of different variables for charecters
<Oshcha> and what I wanted to know if these variables could be the case
<Oshcha> problem with that production DB is that there is not just DB for my application, there is DBs for other applications too ... and if I globally change these variables they could affect other applications
<Oshcha> salle do you know anything about those session variables, which means what, etc? :)
<salle> Oshcha: Yes I know a lot.


Return to mysql
or
Go to some related logs:

harta oraj timisoara
MagikMan undernet

Copyright © 2005 www.irclogs.ws. All rights reserved. » disclaimer » contact