Re: TADOQuery and assign null value to the parameter
- From: "Vitali Kalinin" <vitkalinin@xxxxxxxxx>
- Date: Fri, 24 Mar 2006 17:59:52 +0200
"vverdenga" <vverdenga@xxxxxxxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:4422e87f@xxxxxxxxxxxxxxxxxxxxxxxxx
hi i have the following query:Please note that ADO will create 2 parameters with name equal to "codeypal"
select yliko.SERIAL_NUMBER,
yliko.PERIGRAFH,yliko.CODE_YPALLHLOY,yliko.CODE_KATASTASHS,
YPALLHLOI.NAME, KATASTASH_YLIKOY.PERIGRAFH, ypallhloi.code
from yliko, ypallhloi, katastash_ylikoy
where (yliko.CODE_YPALLHLOY = ypallhloi.code)
and (yliko.CODE_KATASTASHS = KATASTASH_YLIKOY.code)
and (YPALLHLOI.code= :codeypal or :codeypal is null)
order by ypallhloi.name
the only thing i want to do is to assing values to the parameter using the
folling code:
if ComboYpallhlos.KeyValue<>null then
MhtrvoPagivn.repYlikaYpallhloi.Parameters[0].Value:=FrmYlika_ypallhlo.ComboYpallhlos.KeyValue
else
MhtrvoPagivn.repYlikaYpallhloi.Parameters[0].Value:=null;
my problem is that when my parameter don't have value i get no result...
so i am asking how can i clear my parameter
when i delete the parameter from the sql i get the right results
select yliko.SERIAL_NUMBER,
yliko.PERIGRAFH,yliko.CODE_YPALLHLOY,yliko.CODE_KATASTASHS,
YPALLHLOI.NAME, KATASTASH_YLIKOY.PERIGRAFH, ypallhloi.code
from yliko, ypallhloi, katastash_ylikoy
where (yliko.CODE_YPALLHLOY = ypallhloi.code)
and (yliko.CODE_KATASTASHS = KATASTASH_YLIKOY.code)
order by ypallhloi.name
thank's in advance
for yours SQL, so you either have to change yours sql or parameter
assignment. Also why do you think that:
if ComboYpallhlos.KeyValue<>null then
MhtrvoPagivn.repYlikaYpallhloi.Parameters[0].Value:=FrmYlika_ypallhlo.ComboYpallhlos.KeyValue
else
MhtrvoPagivn.repYlikaYpallhloi.Parameters[0].Value:=null;
differs form just:
MhtrvoPagivn.repYlikaYpallhloi.Parameters[0].Value:=FrmYlika_ypallhlo.ComboYpallhlos.KeyValue;
Regards,
Vitali
.
- References:
- TADOQuery and assign null value to the parameter
- From: vverdenga
- TADOQuery and assign null value to the parameter
- Prev by Date: Re: Currency Fields In Dynamic ADO Queries
- Next by Date: Oracle IsolationLevel
- Previous by thread: Re: TADOQuery and assign null value to the parameter
- Next by thread: ExecuteOptions := [eoExecuteNoRecords];
- Index(es):
Relevant Pages
|