The UNIX and Linux Forums  
Ciao e benvenuto da parte degli Stati Uniti al UNIX e Linux Forum! Grazie per la visita ed unirsi alla nostra Comunità Globale.

Go Back   UNIX e Linux Forum > Special Forum > UNIX e Linux Applicazioni
.
google unix.com



UNIX e Linux Applicazioni Discuti UNIX e Linux, un software per le applicazioni. Ciò include SQL, database, middleware, MOM, SOA, EDA, CEP, BI, BPM e argomenti simili.

Più di UNIX e Linux Forum Argomenti potreste trovare utili
Filo Thread Starter Forum Risposte Ultimo Post
la definizione di variabili em23 Shell scripting e di programmazione 12 01-04-2009 02:49 PM
definizione di una stampante in qconfig matheeq AIX 0 03-18-2008 11:55 AM
Definizione di coordinate X e Y all'interno di una finestra lesnaubr Shell scripting e di programmazione 1 08-16-2007 08:19 AM
Definizione Variabili sailorliones UNIX for Dummies Domande & Risposte 4 07-21-2006 03:09 PM
Definire le variabili al momento del boot ianf UNIX for Dummies Domande & Risposte 7 01-07-2002 01:03 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Cerca in questo Thread Rate Thread Modalità di visualizzazione
  #1 (permalink)  
Old 06-11-2009
figaro figaro is offline
Utente Registrato
  
 

Iscriviti Data: gennaio 2007
Interventi: 267
Problemi con la definizione di trigger

Sono in esecuzione l'esempio dalla seguente pagina Web:
MySQL:: MySQL 5.0 Reference Manual:: 12.1.11 Sintassi CREATE TRIGGER
e il problema è che attiva non può essere definito, per qualche motivo:
Codice:
CREATE DATABASE IF NOT EXISTS triggertest;
USE triggertest;
CREATE TABLE test1(a1 INT);
CREATE TABLE test2(a2 INT);
CREATE TABLE test3(a3 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
CREATE TABLE test4(
  a4 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  b4 INT DEFAULT 0
);

delimiter |

CREATE TRIGGER testref BEFORE INSERT ON test1
  FOR EACH ROW BEGIN
    INSERT INTO test2 SET a2 = NEW.a1;
    DELETE FROM test3 WHERE a3 = NEW.a1;
    UPDATE test4 SET b4 = b4 + 1 WHERE a4 = NEW.a1;
  END;
|

delimiter ;
e il risultato è il seguente:
Codice:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter | CREATE TRIGGER testref BEFORE INSERT ON test1 FOR EACH ROW BE' at line 1
La banca dati è inizialmente vuota, non altre tabelle o trigger. Qual è l'esatto problema e come posso risolverlo? Grazie in anticipo.

Codice:
# mysql -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 164
Server version: 5.1.28-rc FreeBSD port: mysql-server-5.1.28_1
 

Segnalibri

Thread Tools Cerca in questo Thread
Cerca in questo Thread:

Ricerca Avanzata
Modalità di visualizzazione Vota questo thread
Vota questo thread:

Distacco regolamento
Tu non può post nuovo thread
Tu non può inviare una risposta
Tu non può postare allegati
Tu non può modificare i tuoi post

BB codice è Su
Smilies sono Su
[IMG] codice Su
Codice HTML è Chiuso
Trackbacks sono Su
Pingbacks sono Su
Refbacks sono Su




Tutti gli orari sono GMT -4. La data di oggi è 06:48 PM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Traduzioni Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
UNIX e Linux Forum Content Copyright © 1993-2009. Tutti i diritti Reserved.Ad di gestione da RedTyger

Contenuti pertinenti URL da vBSEO 3.2.0