Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Basi di dati ~ informatica triennale > Social network 2010/2011
Pages (11): « First ... « 4 5 6 7 [8] 9 10 11 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
fcaridi
dsy newser

User info:
Registered: Feb 2004
Posts: 51 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno: II
Time Online: 1 Day, 5:45:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Sviluppo Php

Qualcuno sa suggerire eventuali tools di supporto allo sviluppo in php?
Cakephp puo' tornare utile?
Ve ne sono altri ...?
Grazie

25-05-2011 16:43
Click Here to See the Profile for fcaridi Click here to Send fcaridi a Private Message Find more posts by fcaridi Add fcaridi to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
*°§_-???
-.-''

User info:
Registered: Oct 2005
Posts: 383 (0.05 al dì)
Location: Milan (again)
Corso: Comunicazione Digitale
Anno: (3+x) | x>0
Time Online: 10 Days, 4:34:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: Sviluppo Php

Originally posted by fcaridi
Qualcuno sa suggerire eventuali tools di supporto allo sviluppo in php?
Cakephp puo' tornare utile?
Ve ne sono altri ...?
Grazie


Se hai familiarità con eclipse io mi ero trovata bene con PDT http://www.eclipse.org/pdt/

__________________
:pccrash::pccrash:

29-05-2011 11:46
Click Here to See the Profile for *°§_-??? Click here to Send *°§_-??? a Private Message Find more posts by *°§_-??? Add *°§_-??? to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
blue_tech
.fedelissimo.

User info:
Registered: Feb 2011
Posts: 47 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 9:09:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ho un problema... ho una procedura che esegue due comandi:

fa il DROP di una tabella se esiste;
Crea la tabella precedentemente eliminata;

poi ho il trigger che richiama la procedura quando accade un evento.

Il problema è che a fronte dell'evento io ottengo l'errore:

"Explicit or implicit commit is not allowed in stored function or trigger. "

Cosa c'è che non va? La procedura è così:

code:
DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `procedura`() BEGIN drop table if exists tabella; CREATE TABLE tabella SELECT a FROM b WHERE c AND d; END


help :(

08-09-2011 18:31
Click Here to See the Profile for blue_tech Click here to Send blue_tech a Private Message Find more posts by blue_tech Add blue_tech to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Se sposti il codice della procedura dentro il trigger che la chiama?

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

08-09-2011 18:46
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
blue_tech
.fedelissimo.

User info:
Registered: Feb 2011
Posts: 47 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 9:09:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

non mi permette nemmeno di crearlo segnalandomi lo stesso errore... :/

08-09-2011 18:49
Click Here to See the Profile for blue_tech Click here to Send blue_tech a Private Message Find more posts by blue_tech Add blue_tech to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Credo che il problema sia la drop nel trigger che non vuole.
Col truncate e la insert hai provato?

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

08-09-2011 19:02
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
blue_tech
.fedelissimo.

User info:
Registered: Feb 2011
Posts: 47 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 9:09:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

mi da l'errore anche solo con la create table...

io devo eliminare la tabella se già esiste e subito dopo crearla.

truncate e insert non agiscono sulla tabella ma sulle righe... sbaglio?
e poi ho letto questo che sconsiglia il truncate http://inderpreetsingh.com/2010/09/...ion-or-trigger/

08-09-2011 19:14
Click Here to See the Profile for blue_tech Click here to Send blue_tech a Private Message Find more posts by blue_tech Add blue_tech to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Credo si riferisca a myisam, visto che su innodb la truncate non cancella la tabella e la ricrea.

Intendevo qualcosa del tipo:
CREATE TABLE tabella SELECT a FROM b WHERE c AND d if not exists tabella;
truncate table tabella;
INSERT INTO tabella SELECT a FROM b WHERE c AND d;

Edit: nella create potresti usare il like o l'as (controlla)

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

Last edited by number15 on 08-09-2011 at 19:19

08-09-2011 19:17
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Se rompe ancora il cazzo, prova a creare la tabella fuori dal trigger e dentro al trigger metti solo la truncate e la insert

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

08-09-2011 19:21
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
blue_tech
.fedelissimo.

User info:
Registered: Feb 2011
Posts: 47 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 9:09:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

provo così e vediamo cosa succede per ora grazie ;)

08-09-2011 19:36
Click Here to See the Profile for blue_tech Click here to Send blue_tech a Private Message Find more posts by blue_tech Add blue_tech to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Nel caso puoi usare REPLACE al posto di truncate+insert.

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

08-09-2011 19:44
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
blue_tech
.fedelissimo.

User info:
Registered: Feb 2011
Posts: 47 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 9:09:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

dunque confermo che la TRUNCATE provoca lo stesso messaggio di errore...

Per risolvere basta seguire il consiglio dell'articolo che ho linkato sopra

in sostanza al posto di:

TRUNCATE TABLE nometabella

bisogna mettere:

DELETE FROM nometabella
(senza l' * )

In sostanza:
1) creo la tabella la prima volta a mano
2) creo la procedura che svuota la tabella e la riempie di nuovo con i dati aggiornati

Così sembra funzionare tutto.

Grazie :D

08-09-2011 19:44
Click Here to See the Profile for blue_tech Click here to Send blue_tech a Private Message Find more posts by blue_tech Add blue_tech to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ottimo.

Ma è innodb la tabella su cui esegui la truncate?
Perché truncate = delete from senza where, quindi non capisco perché non vada.

Edit: ecco la spiegazione:
For an InnoDB table before version 5.0.3, InnoDB processes TRUNCATE TABLE by deleting rows one by one. As of MySQL 5.0.3, row by row deletion is used only if there are any FOREIGN KEY constraints that reference the table. If there are no FOREIGN KEY constraints, InnoDB performs fast truncation by dropping the original table and creating an empty one with the same definition, which is much faster than deleting rows one by one.

Si vede che non hai fk allora.

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

Last edited by number15 on 08-09-2011 at 20:09

08-09-2011 20:05
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
blue_tech
.fedelissimo.

User info:
Registered: Feb 2011
Posts: 47 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 9:09:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

si è innodb... il problema stando all'articolo nasce da questa osservazione:

Depending on version and storage engine, TRUNCATE can cause the table to be dropped and recreated. This provides a much more efficient way of deleting all rows from a table, but it does perform an implicit COMMIT. You might want to use DELETE instead of TRUNCATE.


In pratica la TRUNCATE fa una commit implicita mentre la delete no e quindi ecco la differenza.

09-09-2011 12:05
Click Here to See the Profile for blue_tech Click here to Send blue_tech a Private Message Find more posts by blue_tech Add blue_tech to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Si si, infatti ti ho postato la spiegazione. Dalla versione 5.0.3 la truncate è diventata una drop + una create, mentre prima era una semplice delete.

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

09-09-2011 12:08
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 07:49.    Post New Thread    Post A Reply
Pages (11): « First ... « 4 5 6 7 [8] 9 10 11 »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.047 seconds (80.15% PHP - 19.85% MySQL) con 26 query.