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 > progetto da consegnare a settembre.
Pages (4): « 1 [2] 3 4 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ERROR 1064 (42000): 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 'end'
at line 7

xo' forse ho trovato ke sia il delimiter ke mi sono dimenticata e poi cn end if.

ho anche un'altra domanda, scusa ke t sto subissando d domande ma è la prima volta ke metto mano su mysql:
in un campo posso aggiungere una percentuale? ossia x esempio:
set new.ab=old.ab+10%;
??
grazie ancora...

08-09-2009 09:18
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darkshadow
Are You From The Past?

User info:
Registered: Jul 2007
Posts: 485 (0.08 al dì)
Location: Milano
Corso: Informatica Magistrale
Anno: 1
Time Online: 13 Days, 13:38:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

direi di no.. penso ke la percentuale la devi calcolare. o al massimo se esiste usare una funzione ke te le calcola.

cmq io non sto usando mysql.

__________________
by Ð@rk§h@ÐØw

08-09-2009 09:24
Click Here to See the Profile for darkshadow Click here to Send darkshadow a Private Message Find more posts by darkshadow Add darkshadow to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ma quindi tu x fare gli aumenti metti direttamente il numero?!?!
Io volevo usare la percentuale xke volevo aumentare i valori in base a quanti pi spostava...

08-09-2009 09:31
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darkshadow
Are You From The Past?

User info:
Registered: Jul 2007
Posts: 485 (0.08 al dì)
Location: Milano
Corso: Informatica Magistrale
Anno: 1
Time Online: 13 Days, 13:38:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

anchio uso le percentuali.. quello che volevo dire è che non si può fare...
colonna = colonna + 10%

quel 10% lo devi calcolare

non so per esempio dichiari una funzione che ti calcola la percentuale

e quindi fai : colonna = colonna + funzionePercentuale()

__________________
by Ð@rk§h@ÐØw

08-09-2009 09:40
Click Here to See the Profile for darkshadow Click here to Send darkshadow a Private Message Find more posts by darkshadow Add darkshadow to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

o sono diventata pazza o nn arrivo a determinate cose..

delimiter //
create function percentuale(integer val, integer percento) return integer as
begin
declare risultato integer;
risultato = (val*percento)/100;
return risultato;
end;
//

cosa c'è d sbagliato? x qaunto ho cercato su internet (in cui nn ci sono esempi concreti ma parla solo d sintassi..) dovrebbe essere giusto..

08-09-2009 10:25
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darkshadow
Are You From The Past?

User info:
Registered: Jul 2007
Posts: 485 (0.08 al dì)
Location: Milano
Corso: Informatica Magistrale
Anno: 1
Time Online: 13 Days, 13:38:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by carla86
o sono diventata pazza o nn arrivo a determinate cose..

delimiter //
create function percentuale(integer val, integer percento) return integer as
begin
declare risultato integer;
risultato = (val*percento)/100;
return risultato;
end;
//

cosa c'è d sbagliato? x qaunto ho cercato su internet (in cui nn ci sono esempi concreti ma parla solo d sintassi..) dovrebbe essere giusto..


delimiter //
create function percentuale(integer val, integer percento) returns integer as
begin
declare risultato integer;
SET risultato = (val*percento)/100;
return risultato;
end
//

__________________
by Ð@rk§h@ÐØw

08-09-2009 10:37
Click Here to See the Profile for darkshadow Click here to Send darkshadow a Private Message Find more posts by darkshadow Add darkshadow to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

mysql> create function percentuale(integer val,integer percento) returns integer
as
-> begin
-> declare risultato integer;
-> set risultato=(val*percento)/100;
-> return risultato;
-> end;
-> //
ERROR 1064 (42000): 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 'integ
er val,integer percento) returns integer as
begin
declare risultato integer' at line 1

questo è ciò ke faccio in mysql tralatro cn l'utente root quindi proprio nn capisco dov'è l'errore...
mi sa ke mi toccherà inviare una mail a montanelli e chiedergli un colloquio,altrimenti me lo sogno d consegnare il progetto..
spero tu sia messo meglio..
grazie dell'aiuto!

08-09-2009 10:55
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darkshadow
Are You From The Past?

User info:
Registered: Jul 2007
Posts: 485 (0.08 al dì)
Location: Milano
Corso: Informatica Magistrale
Anno: 1
Time Online: 13 Days, 13:38:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

 

delimiter //
create function percentuale(integer val, integer percento) returns integer as
begin
declare risultato integer        -> Il ; non ci va nella declare
SET risultato = (val*percento)/100;
return risultato;
end
//

__________________
by Ð@rk§h@ÐØw

08-09-2009 11:16
Click Here to See the Profile for darkshadow Click here to Send darkshadow a Private Message Find more posts by darkshadow Add darkshadow to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

niente da fare anche togliendo il punto e virgola nn funziona uguale... sempre stesso errore..

08-09-2009 11:28
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
R1cky`
dsy developer

User info:
Registered: Oct 2007
Posts: 218 (0.04 al dì)
Location:
Corso: Informatica Magistrale
Anno: Secondo
Time Online: 1 Day, 13:11:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Che editor usi?
Ti consiglio di scaricare http://www.webyog.com/en/downloads.php#sqlyog, è molto comodo.

Comunque se vai da montanelli non dirgli che hai fatto prima la parte web e poi la parte db altrimentti tin inforca :D

08-09-2009 11:28
Click Here to See the Profile for R1cky` Click here to Send R1cky` a Private Message Find more posts by R1cky` Add R1cky` to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

no beh
cmq prima d andare faccio anke gli altri trigger
cosi gli chiedo xke nessuno va..

cmq come editor uso scite..
l'errore ke mi da è sempre questo.. ma nn è ke ce da mettere qualche cosa tra apici??

ERROR 1064 (42000): 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 'integ
er val,integer percento) returns integer as
begin
declare risultato integer' at line 1

08-09-2009 11:34
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

EVVAIIIII
C'E' L'HO FATTAAAAA
era un problema d parametri..
la pubblico in caso possa servire a qualcuno..

create function percentuale (val integer,percento integer) returns integer
begin
declare risultato integer;
set risultato=((val*percento)/100);
return risultato;
end;

08-09-2009 11:48
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Sacratix
.illuminato.

User info:
Registered: Jun 2008
Posts: 154 (0.03 al dì)
Location: Lago d'Iseo - Bergamo
Corso: Informatica
Anno: 3
Time Online: 1 Day, 4:47:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by carla86
scusami ti scrivo un trigger che ho provato a inserire e ke mysql mi da errore d sintassi:
(ho una tabella citta e una tabella nazione)

create trigger prova
before update on citta
for each row
begin
declare diff integer
declare nome varchar(20)
if new.vi>old.vi then
diff=new.vi-old.vi
nome=nazione
update nazione set pi=pi-diff where nomenazione=nome
update citta set new.ab=old.ab+3 and new.ra=old.ra-3 and new.rn=old.rn-3
endif
end;

mi sai dire se è corretto? grazie


premetto che ho usato plpgsql
e che mysql non l'ho proprio preso in considerazione
(phpPgAdmin è molto meglio di phpMyAdmin >_> )

sei sicura che si possano usare conteporaneamente NEW e OLD?
perchè con postgres se il trigger è in UPDATE o INSERT, solo NEW viene riempito (solo OLD per la DELETE)

dai un'occhiata che è meglio

__________________
I wish for this night-time to last for a life-time

09-09-2009 18:07
Click Here to See the Profile for Sacratix Click here to Send Sacratix a Private Message Find more posts by Sacratix Add Sacratix to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carla86
.illuminato.

User info:
Registered: Dec 2006
Posts: 219 (0.03 al dì)
Location: Milano
Corso: Informatica
Anno: Terzo
Time Online: 6 Days, 21:40:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

la new la puoi usare x la insert e x l'update.
la old la puoi usare x l'update e x la delete.

09-09-2009 18:23
Click Here to See the Profile for carla86 Click here to Send carla86 a Private Message Find more posts by carla86 Add carla86 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Sacratix
.illuminato.

User info:
Registered: Jun 2008
Posts: 154 (0.03 al dì)
Location: Lago d'Iseo - Bergamo
Corso: Informatica
Anno: 3
Time Online: 1 Day, 4:47:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ok, buono a sapersi che lì funziona

come non detto, funziona così anche qui, ora mi chiedo
"cosa diavolo avrò fatto per farmi credere che non fosse così?" >_<

__________________
I wish for this night-time to last for a life-time

Last edited by Sacratix on 09-09-2009 at 19:04

09-09-2009 18:42
Click Here to See the Profile for Sacratix Click here to Send Sacratix a Private Message Find more posts by Sacratix Add Sacratix to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 18:10.    Post New Thread    Post A Reply
Pages (4): « 1 [2] 3 4 »   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.105 seconds (80.23% PHP - 19.77% MySQL) con 27 query.