Re: [SQL] Trigger with Stored Procedure [Client Points]

2006-08-31 Thread Aaron Bono
On 8/31/06, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: Bono,I must check each insert on my Points(each shop generate a new line on Points table).When I insert  the  record  on points  I must  see the field Value(on points table already) and update the Client.Points field based in some

[SQL] How to get the row that start a trigger

2006-08-31 Thread Ezequias Rodrigues da Rocha
Hi,I need make a trigger that update a table each time another table has a insert. but this insert has on this row all the items to pass to my function on the trigger.How to retrieve this information. Please I need this answare.RegardsEzequias-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Re: [SQL] Trigger with Stored Procedure [Client Points]

2006-08-31 Thread Aaron Bono
On 8/30/06, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: Hi list,I have a table like this:Points-Idoperationvalueand another two tables like thisClient    Rule    -

Re: [SQL] ERROR: SELECT query has no destination for result data

2006-08-31 Thread Joe
Ezequias Rodrigues da Rocha wrote: Hi list, I have a function like this: Create OR REPLACE Function base.inserirPontos(char(1), varchar(255), numeric(12,2), int8, int8, int8 ) returns int4 as $$ declare Operacao alias for $1; Numero_nota alias for $2; Valor_nota alias for $3;

Re: [SQL] Trigger on Insert to Update only newly inserted fields?

2006-08-31 Thread Aaron Bono
On 8/28/06, Henry Ortega <[EMAIL PROTECTED]> wrote: Here's what I am doing:I have this table:employee   payrate     effective     tstamp   end_date (to be updated by trigger)jdoe   1000 04-01-2006    2006-03-10 13:39: 07.614945jdoe

Re: [SQL] ERROR: SELECT query has no destination for result data

2006-08-31 Thread John DeSoi
Sorry, try select into numRegistros count(*) from base.emissor_ponto_venda where id = PontoVenda_Emissor; The thing you are selecting into needs to match what you are selecting. So in your examples below, record is needed when you use "* from ...". If you just need to look at one value:

Re: [SQL] ERROR: SELECT query has no destination for result data

2006-08-31 Thread 2000 Informatica
  Ezequias,   Declare a variavel  numRegistros dentro da funcao e altere o SELECT p/   select count(id) INTO numRegistros from base.emissor_ponto_venda where id = PontoVenda_Emissor;   q vai dar certo, OK ??     SPS 2000Info   - Original Message - From: Ezequias Rodrig

[SQL] Checking types

2006-08-31 Thread Ezequias Rodrigues da Rocha
Hi list,I would like to check if the types passed are of the same time of my declaration and not report an error.Is that possible ?How to do that ?is there any statement like is numeric or is varchar(12) ? RegardsEzequias

Re: [SQL] ERROR: SELECT query has no destination for result data

2006-08-31 Thread John DeSoi
On Aug 31, 2006, at 9:00 AM, Ezequias Rodrigues da Rocha wrote: select count(id) as numRegistros from base.emissor_ponto_venda where id = PontoVenda_Emissor; declare numRegistros as an integer in the declarations section and rewrite the select: select into numRegistros count(id) from ba

[SQL] ERROR: SELECT query has no destination for result data

2006-08-31 Thread Ezequias Rodrigues da Rocha
Hi list,I have a function like this:Create OR REPLACE Function base.inserirPontos(char(1), varchar(255), numeric(12,2), int8, int8, int8 ) returns int4 as $$declare     Operacao alias for $1;    Numero_nota alias for $2;     Valor_nota alias for $3;    PontoVenda_Emissor alias for $4;     Cardpass