Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: MySQL insert via DBI

by moritz (Cardinal)
on Sep 19, 2011 at 15:24 UTC ( #926761=note: print w/replies, xml ) Need Help??


in reply to MySQL insert via DBI

Please show us the schema for $table, it's hard to tell what's going on without knowing that.

It's also a good idea to enable tracing and then run the script, see the TRACING section in DBI.

Replies are listed 'Best First'.
Re^2: MySQL insert via DBI
by AlexTape (Monk) on Sep 20, 2011 at 08:47 UTC
    heres the trace:
    DBI::db=HASH(0x348da4c) trace level set to 0x0/1 (DBI @ 0x0/0) in DBI +1.616-ithread (pid 3144) <- do(\'INSERT INTO table_1(version,filename,release_notes,rec_level,o +s_type) VALUES(1, 2, 3, 4, 5)\')= ( undef ) [1 items] at sql.pl line +21 <- prepare(\'SELECT * FROM table_1\')= ( DBI::st=HASH(0x34bb204) ) + [1 items] at sql.pl line 23 <- execute= ( 1 ) [1 items] at sql.pl line 24 !! ERROR: 2000 CLEARED by call to fetch method <- fetchrow_hashref= ( HASH(0x34bea74)16keys ) [1 items] row1 at s +ql.pl line 25 !! ERROR: 2000 CLEARED by call to fetch method <- fetchrow_hashref= ( undef ) [1 items] row1 at sql.pl line 25 <- finish= ( 1 ) [1 items] at sql.pl line 28 <- disconnect= ( 1 ) [1 items] at sql.pl line 29
    perhaps this is the problem?
    table_1(version,filename,release_notes,rec_level,os_type) VALUES(1, 2, 3, 4, 5)\')= ( undef ) [1 items] at sql.pl line 21
    VALUES = (undef) ?!
    $perlig =~ s/pec/cep/g if 'errors expected';

      Are you using a fork or threads somewhere in your code (in the part that you don't show us)?

      Also please provide the schema for the table, so that we can actually run the script and reproduce your problem.

        im not using fork e.g.
        there is no code excluded. because its not necessary to implement not working code ;-)
        CREATE TABLE `table_1` (<br> `ID` int(11) NOT NULL AUTO_INCREMENT,<br> `version` varchar(200) NOT NULL,<br> `filename` varchar(200) NOT NULL,<br> `size` int(11) DEFAULT NULL,<br> `MD5_checksum` varchar(200) DEFAULT NULL,<br> `release_notes` varchar(200) NOT NULL,<br> `remark` varchar(2000) DEFAULT NULL,<br> `rec_level` int(11) NOT NULL,<br> `date_rec_green` date DEFAULT NULL,<br> `date_rec_yellow` date DEFAULT NULL,<br> `date_rec_red` date DEFAULT NULL,<br> `date_compl_green` date DEFAULT NULL,<br> `date_comp_yellow` date DEFAULT NULL,<br> `date_compl_red` date DEFAULT NULL,<br> `os_type` int(11) DEFAULT NULL,<br> `feature_set` int(11) DEFAULT NULL,<br> PRIMARY KEY (`ID`),<br> UNIQUE KEY `ID_UNIQUE` (`ID`),<br> KEY `fk_firmware_rec_level` (`rec_level`),<br> KEY `fk_firmware_os_type` (`os_type`),<br> KEY `fk_firmware_feature_set` (`feature_set`),<br> CONSTRAINT `fk_firmware_feature_set` FOREIGN KEY (`feature_set`) REF +ERENCES <br>`nl_firmware_feature_set` (`ID`) ON DELETE NO ACTION ON U +PDATE NO ACTION,<br> CONSTRAINT `fk_firmware_os_type` FOREIGN KEY (`os_type`) REFERENCES +<br>`nl_firmware_os_type` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACT +ION,<br> CONSTRAINT `fk_firmware_rec_level` FOREIGN KEY (`rec_level`) REFEREN +CES <br>`nl_firmware_rec_level` (`ID`) ON DELETE NO ACTION ON UPDATE +NO ACTION<br> ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8$$<br>

        im completly new to this topic for this i hope that this is the scheme that helps a lil...
        $perlig =~ s/pec/cep/g if 'errors expected';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://926761]
help
Chatterbox?
[Eily]: sorry, got interrupted
[Eily]: so he left from Nancy
[Eily]: and my point was, he met some monks yesterday in Italy who offered him a place for the night
[Eily]: and since he was meating eatalian monks I wondered if I should tell him to say hi to Discipulus for me :D
[erix]: Nancy-Bari: 1320 km ... He'll need some time :)
[LanX]: he was "meating" Italian monks oO?
[erix]: then again, there are people who do 10 full triathlons on 10 consecutive days, so it must be doable
choroba's friend has done the Pacific Crest Trail, it's 4200 km

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-12-13 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (369 votes). Check out past polls.

    Notices?