[SQL] Complete instruction in a trigger

2005-01-27 Thread Wilton
Hi...
People, i wanna know how can i know inside of a function whar the 
trigger called, i mean which instruction SQL it called.

I do not wanna know if it´s a insert, update or delete (tp_op), i need 
to know the complete instruction.

For example, i need to know something like this:
update phones set number = '-';
Do you know if maybe exists a tg_stantement?
Thanks very much... see ya
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 25/1/2005
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [SQL] Complete instruction in a trigger

2005-01-27 Thread Wilton




Sorry
if i´m sendind this question to the wrong place... it´s because i´m new
here and i didn´t found the place in the web to send my question over
the same that i already did.

But let´s see if you can help me. The situation is like this. 

I have a
table "customers", then a user go there and change the customer record,
for example he changes the zip code column. Then I can know that
something changed into the "customer table", and send a full update of
that record through the web to the database that i want, but i need to
know what column had changed to send a update just for that column. But
i do not know in which column his has made that change. So, i need to
know the instruction to do this. Something like a specific update for
that column modified by the user.

Thanks very much.

Wilton Ruffato Wonrath



No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.6 - Release Date: 27/1/2005

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[SQL] Function Doubt

2005-01-27 Thread Wilton
Inside a function of trigger type, i have:
Declare
   qCampos record;
   StrCampo string;
   StrInsert string;
Begin
   StrCampo = '''';
   StrInsert = '''';
   For qCampos in select pga.attname from pg_class pgc, pg_attribute pga
  where pgc.relname = '''' || tg_relname || '''' and
  pgc.oid = pga.attrelid and pga.attnum > 0 and
  attisdropped <> ''t'' Loop
  StrCampo = ''new.'' || qCampos.attname;
  StrInsert = StrInsert || virgula || StrCampo || '' - '';
   End Loop;
   Return new;
End;
What i need to do for the variable StrCampo returns to me "SP", "RJ", i 
mean, return a value inserted into the field.
I do not want to use static command new.campo1, new.campo2

Thanks,
Wilton Ruffato Wonrath

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.6 - Release Date: 27/1/2005
---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


[SQL] Postgresql number of command

2005-01-31 Thread Wilton
Hi... People
   I would like to know if inside of a function that has been called by 
a trigger, what instruction the SQL called, i do not wanna know if it´s 
a insert or a update or a delete (tg_op)... i need the full instruction.

For example:
I wanna know the number of the instruction:
update telefone set numero = '-';
Thanks, and sorry if it´s not here to put the message... just say me 
where i need to write this question... Thank you very much

Wilton Ruffato Wonrath

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 25/1/2005
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


[SQL] Range of caracters

2007-08-07 Thread Wilton Wonrath
Hello,

I have a doubt about a query using a range of caracters. Example:

Data Table

Inicial  -  Final
9C2HB02107R008000 9C2HB02107R008200
FAIXA1FAIXA100

I´m doing the following query:

SELECT recallfxchassi.* FROM recallfxchassi 
LEFT JOIN recall ON recallfxchassi.idrecall = recall.id WHERE 
('FAIXA2' BETWEEN chassiinicial AND chassifinal);

This is not returning anything. I believe that is because it´s check´s caracter 
by caracter and 2 is bigger than 1. But in a real situation  I will need that 
return something (FAIXA2 is between FAIXA1 and FAIXA100).

Does anyone knows if exists some way or command in PostgreSQL that could solve 
this "problem" ?

Thanks.




  Alertas do Yahoo! Mail em seu celular. Saiba mais em 
http://br.mobile.yahoo.com/mailalertas/