Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. KarveR

    INTO OUTFILE Directory

    if you have mysql installed locally, you can use that to connect to the remote host and achieve the desired result from a command line: c:\>mysql -h<host> -u<user> -p -e"Select statement" database [table optionally] > c:\tmp\myfile.csv the password will be requested before the query will...
  2. KarveR

    routine issue

    When using @ variables they are set using @variable:=value Note the colon, everything should work ;) mysql> select @this:=curdate(); +------------------+ | @this:=curdate() | +------------------+ | 2013-02-15 | +------------------+ 1 row in set (0.00 sec) mysql> select @this...
  3. KarveR

    Select record where field contains a specific IP - mysql

    Yes, sorry, I used IP addresses I had in stock, check the numbers :) -- you should change 101 in my query for 100 as in yours. ______________________________________________________________________ There's no present like the time, they say. - Henry's Cat.
  4. KarveR

    Effective programming

    Would it be more prudent to use a stored procedure to do an "after insert" update for the location of the call? This will save you doing an additional lookup back to your app, and just leaves the database to do its thing on simple inserts...
  5. KarveR

    Insert DISTINCT records into an existing table

    Can you use a view instead, create it as a select statement with a rolling date? eg : create view V_TRANSACTION_TYPES as select distinct transaction_type from table where yourdate >= date_sub(curdate(), interval 30 day); ______________________________________________________________________...
  6. KarveR

    Select record where field contains a specific IP - mysql

    select d07 from service where if(instr(d07,' ') > 0, left(d07,instr(d07,' ')),d07) = '10.101.1.1' ; ______________________________________________________________________ There's no present like the time, they say. - Henry's Cat.
  7. KarveR

    Newbie question, trying to query a table with column names like Transaction Date

    I Totally agree with Ian, don't use spaces in table names, you will find a world of pain in the future with coding/using tables with spaces in the names. ______________________________________________________________________ There's no present like the time, they say. - Henry's Cat.
  8. KarveR

    Email my output, for every option I choose

    Not sure I'm totally on the same page, but mutt likes to sit and wait for input for the message body. I normally avoid that by reding body contents from dev/null when just sending attachmets: mutt -s"subject line" -a attachment recipient@somewhere.com </dev/null Cheers K...
  9. KarveR

    Something limiting BLOB size besides max_allowed_packet?

    This is one of 2 other settings you have to consider. 1)apache (guessing you're using this) this has a LimitRequestBody [size in bytes] which can affect what you can upload, this option can be removed. 2) php.ini change teh value set by upload_max_filesize...
  10. KarveR

    CHAR_LENGTH slowering query

    Just out of curiosity, what do your tables indexes show, I had a table recently where the indexes were showing as "NULL" and a quick anaylze table <tablename> fixed these and corrected my speed issue. Alternatively I guess you could set up a char_length field and populate it from a trigger on...
  11. KarveR

    Best way to select records by what they begin with?

    A table with 1.77 million records returns all results in a maximum of 0.02 seconds, the field is non indexed. The server is quad core xeon with 8gb of ram all laid over to mysql. ______________________________________________________________________ There's no present like the time, they...
  12. KarveR

    Subtracting groups of rows

    no temp table required, use localised variables. haven't had a huge chance to look, they do somthing odd on the second execution but look ok on the first: SELECT * FROM `test` where `main`='sales' union select ' ','Total Sales',@s1:=sum(month1) as s1,@s2:=sum(month2) as s2,' ' from...
  13. KarveR

    Connecting to outside MySQL Server

    you will need to use an account which has been set up on the remote server, and that account should have its "host" value set to either: a) xxx.xxx.xxx.xxx //the IP you are connecting from b) '%' // any address. This account will need appropriate priviliges for select, insert, update etc. A...
  14. KarveR

    Multiple Rows to Single Row

    If you have a linux box, I'd have a look at AWK to format this into a suitable insert statement, rather than trying to do anything in the database. ______________________________________________________________________ There's no present like the time, they say. - Henry's Cat.
  15. KarveR

    Send report to email input

    do you have mutt installed, mutt -s "subject line" -a /path/to/filename someone@somewhere.com </dev/null This will send the report for you. ______________________________________________________________________ There's no present like the time, they say. - Henry's Cat.
  16. KarveR

    Stored proc

    much simplified to start you off then , mysql> delimiter // mysql> CREATE PROCEDURE procedure1(IN param1 INTEGER) -> LANGUAGE SQL -> NOT DETERMINISTIC -> BEGIN -> select -> IF(param1="17",'birds','beasts'); -> END; -> // Query OK, 0 rows affected (0.00 sec)...
  17. KarveR

    Stored proc

    I'd drop all the comments and see if you get further, also you may need to change teh delimiters as you load stored procs. heres a sample. DELIMITER // CREATE PROCEDURE do_thing(Field_ID varchar(15)) LANGUAGE SQL NOT DETERMINISTIC COMMENT 'Undo Exported date and time' BEGIN...
  18. KarveR

    Remote mySQL problem

    flushed priviliges? ______________________________________________________________________ There's no present like the time, they say. - Henry's Cat.
  19. KarveR

    Cannot access Mysql from command line

    Once you find and can access mysql, mysql> create database newdb; mysql> \. /path/to/file.sql mysql should start reading the file and loading it, provided the create info is also in the file. ______________________________________________________________________ There's no present like the...
  20. KarveR

    Emails not presenting mysql data.

    Oh, I was expecting something more than just a variable, more like a whole report. ______________________________________________________________________ There's no present like the time, they say. - Henry's Cat.

Part and Inventory Search

Back
Top