Ver Mensaje Individual
  #1  
Antiguo 01-12-2008
Avatar de look
look look is offline
Miembro
 
Registrado: sep 2007
Ubicación: The Shire
Posts: 656
Reputación: 17
look Va camino a la fama
Ayuda con Consulta, Declarar Variables

Hola amigos, tengo la siguiente consulta en SQL, esta me trabaja muy bien en MSSQL, pero me gustaria Pasarla a Firebird.
Código Delphi [-]
Q_CxC.SQL.Text:=' DECLARE @num_regs int; set @num_regs=( select num_regs from CU0N01 )+1 ; '+
'insert into cuen01 (NUM_REG,CCLIE,STATUS,TIPO_MOV,NO_FACTURA,DOCTO,REFER,IMPORTE,FECHA_APLI,FECHA_VENC,COB,AFEC_COI,OBS  _CXCCXP,BANK_COM,STRCVEVEND,NUM_MONED,TCAMBIO,IMPMON_EXT,CCONREFER,FECHAELAB,USUARIO,CTLPOL) '
+'Values(@num_regs'+','+QuotedStr(FORM2.showcli.Text)+','+QuotedStr('A')+',1,'+QuotedStr(NF)+','+Quo  tedStr(NV)+','+QuotedStr(NV)
+','+FormatFloat('0.####',form2.tot.Value*FORM2.MONEDA.FieldBYNAME('TCAMBIO').asfloat)+','+QuotedStr  (FORM2.Edit1.Text)+','+QuotedStr(FORM2.Edit1.Text)
+','+QuotedStr(USR2)+','+QuotedStr('A')+',0,0,'+QuotedStr(CVVD)+','+QuotedStr(FORM2.numo.Text)+','+F  ormatFloat('0.####',FORM2.moneda.FieldBYNAME('TCAMBIO').asfloat)+','+FormatFloat('0.####',form2.tot.  Value*FORM2.moneda.FieldBYNAME('TCAMBIO').asfloat)
+','+QuotedStr('N')+','+QuotedStr(FORM2.Edit1.Text)+','+FORM13.Table1.FieldBYNAME('USSAAE').Text+',0  )'
+'update CU0N01 set num_regs=@num_regs ';
Q_CxC.ExecSQL;

me da problema aqui:

Código SQL [-]
DECLARE @num_regs int; set @num_regs=( select num_regs from CU0N01 )+1 ; '+

el problema es que firebird no trabaja de esta manera, obviamente!...
me gustaria que me echaran una manito si!.
__________________
all your base are belong to us
Responder Con Cita