User Profile

Collapse

Profile Sidebar

Collapse
Megi
Megi
Last Activity: Dec 13 '07, 06:45 PM
Joined: Dec 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Megi
    started a topic regexp in mysql5

    regexp in mysql5

    I need a pattern for an expression:
    "on"apostroph"n umber" fg:on'1

    / (on)\'([0-9]) / what is wrong in the reg expr.?thanks
    See more | Go to post

  • Megi
    replied to how to create MUL keys in mysql
    I used myadmin:) and it works..less difficult...
    See more | Go to post

    Leave a comment:


  • Megi
    replied to how to create MUL keys in mysql
    I have mysql server 5
    See more | Go to post

    Leave a comment:


  • Megi
    replied to how to create MUL keys in mysql
    Hi,

    I have deleted the apostrophs from code, but the error still is.
    [code=sql]
    mysql> CREATE TABLE smoke (
    -> smoke varchar(5) NOT NULL default '0',
    -> time datetime NOT NULL default '0000-00-00 00:00:00',
    -> node_nr int(10) unsigned NOT NULL default '0',
    -> KEY time (time),
    -> KEY node (node_nr);
    [/code]
    ERROR 1064 (42000):...
    See more | Go to post

    Leave a comment:


  • Megi
    replied to how to create MUL keys in mysql
    sorry, here is the code I have:

    [code=sql]
    CREATE TABLE table1 (
    value int(11) NOT NULL DEFAULT '0',
    time datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    nr int(10) UNSIGNED NOT NULL DEFAULT '0',
    KEY `time` (`time`),
    KEY `node` (`nr`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
    [/code]

    it does not work ...mayby any...
    See more | Go to post

    Leave a comment:


  • Megi
    started a topic how to create MUL keys in mysql

    how to create MUL keys in mysql

    Helo,

    I have problem in finding right tutorial how to create multi key in DB.
    I have 4 tables. in each I have
    TIME datatime
    Nr int
    I want them as a MUL key, could You help me in creating the right code to create such a tables.The code has a bug in sql syntax, can You see
    [code=sql]
    CREATE TABLE table1 (
    value int(11) NOT NULL default '0',
    time datetime NOT NULL default...
    See more | Go to post

  • Megi
    replied to putting data from file to mysql...
    in Perl
    Yes, I was saying about re-writing.
    Nobody answerd on Mysql , so I have to change my way of work...now for perl..

    I have a file temp1.txt and I open it and write it's content into temp1b1.txt - it would be my backup. the whole script is relading each 10s becouse file temp1.txt will be getting new values constantly..

    now I need to delete or truncate data from file tem1.txt which are written to temp1b.txt , I have...
    See more | Go to post

    Leave a comment:


  • Megi
    replied to putting data from file to mysql...
    in Perl
    I did as You told me,

    so I have a different question, I hope You could help me out with that...the same problem but different way...how about using perl ..
    1. open file read the data
    2. insert it into mysql table
    3. after inserting data into mysql table delete data form file which are sended
    than new data ocurrs in the file and I would avoid inserting the same, but how know which data has been inserted?...
    See more | Go to post

    Leave a comment:


  • what more...the code:

    [code=mysql]
    LOAD DATA INFILE '$temp1'
    IGNORE INTO TABLE .......;
    [/code]

    dosen't work... to ignor repeating values...
    what can I do ...please help...
    thanks!
    See more | Go to post

    Leave a comment:


  • mysql perl - load data local infile...re-writes whole file when I need only updats;/

    welcome,

    I input data form file to mysql with command: load data local infile..
    The efect is that the data are duplicated or trippled..etc with every re-loading the script, but I need to load there only new values from file.

    here is the code:
    [code=perl]
    #!/usr/bin/perl -w
    use CGI qw(:standard);
    use CGI::Carp qw(warningsToBr owser fatalsToBrowser );
    use...
    See more | Go to post

  • Megi
    replied to putting data from file to mysql...
    in Perl
    Thanks anyway, I will follow Your tips about the code tags.
    By the way how can I contact with the experts:)...
    See more | Go to post

    Leave a comment:


  • Megi
    replied to putting data from file to mysql...
    in Perl
    Helo Jeff,

    You are completly right! I have corrected the errors and it works like almost like I wanted to..

    here is the script:

    [code=perl]
    #!/usr/bin/perl -w
    use CGI qw(:standard);
    use CGI::Carp qw(warningsToBr owser fatalsToBrowser );
    use DBI;
    $foo = new CGI;

    my @row;
    print $foo->header;
    $temp1 = 'temp1.txt';

    # BD connection----------------------------------------...
    See more | Go to post
    Last edited by numberwhun; Dec 4 '07, 03:15 PM. Reason: add code tags

    Leave a comment:


  • Megi
    replied to putting data from file to mysql...
    in Perl
    aaaaaaaa what more:

    I put the script in /usr/lib/cgi-bin/ as all my perl and cgi scripts...so where to put a file temp1.txt ???I have put it in the same directory as script...

    my errors form command line:

    Code:
    madzia@madzia-laptop:/usr/lib/cgi-bin$ perl loader.pl
    [Tue Dec  4 14:51:15 2007] loader.pl: Name "main::temp1" used only once: possible typo at loader.pl line 13.
    [Tue Dec  4
    ...
    See more | Go to post
    Last edited by eWish; Dec 4 '07, 02:13 PM. Reason: Added Code Tags

    Leave a comment:


  • Megi
    started a topic putting data from file to mysql...
    in Perl

    putting data from file to mysql...

    Helo,

    I found at forum somebodys post:
    I'm trying to parse an input file and then take data from that file and enter it into a MySQL database. I'm separating the fields with tabs '\t' and ending the records with a newline '\n'. I'm using the LOAD DATA function (see the code snippet below).

    [CODE=perl]# Load the data into the history table
    my $sql_statmnt2 = "LOAD DATA LOCAL INFILE \'$history_file \'...
    See more | Go to post
    Last edited by eWish; Dec 4 '07, 02:12 PM. Reason: Added Code Tags
No activity results to display
Show More
Working...