Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 7 of 7 total |
sql not working |
Tue, Jul 11 2006 5:42 AM | Permanent Link |
Paul Waegemans | sql.add('UPDATE selectietest a SET a.lic=true,a.licentie=b.licentie FROM selectietest a ');
Sql.add('JOIN licenties b ON (a.lid_ID=b.lid_ID) '); sql.add('WHERE b.seizoen_ID=12 '); works correct but if i change the code using a parameter sql.add('UPDATE selectietest a SET a.lic=true,a.licentie=b.licentie FROM selectietest a '); Sql.add('JOIN licenties b ON (a.lid_ID=b.lid_ID) '); with params.CreateParam(ftinteger, 'Seizoentest', ptInput) do Asinteger:=Dmref.TblSeizoenSeizoen_ID.value; sql.add('WHERE b.seizoen_ID=:seizoentest'); DOES NOT WORK... What could be the problem. DBISAM VER 3.30 Paul. |
Tue, Jul 11 2006 10:16 AM | Permanent Link |
Chris Erdal | Paul Waegemans <paul.waegemans@imseuro.be> wrote in
news:3D81DDBB-176E-4984-99D0-0B64F761E4B5@news.elevatesoft.com: > DOES NOT WORK... > > What could be the problem. > What IS the problem, exactly? -- Chris |
Tue, Jul 11 2006 11:14 AM | Permanent Link |
Paul Waegemans | The update does not work when using the parameter
Chris Erdal <chris@No-Spam-erdal.net> wrote: Paul Waegemans <paul.waegemans@imseuro.be> wrote in news:3D81DDBB-176E-4984-99D0-0B64F761E4B5@news.elevatesoft.com: > DOES NOT WORK... > > What could be the problem. > What IS the problem, exactly? -- Chris |
Tue, Jul 11 2006 11:37 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Paul
try sql.add('UPDATE selectietest a SET a.lic=true,a.licentie=b.licentie FROM selectietest a '); Sql.add('JOIN licenties b ON (a.lid_ID=b.lid_ID) '); sql.add('WHERE b.seizoen_ID=:seizoentest'); sql.parambyname('seizoentest').Asinteger := Dmref.TblSeizoenSeizoen_ID.value; Roy Lambert |
Tue, Jul 11 2006 11:55 AM | Permanent Link |
Paul Waegemans | That seems not to be the solution.
In my example the update works correctly with the vaue 12. But I want the value to be the value of Dmref.TblSeizoenSeizoen_ID.value so I want to use a parameter. BUT IT DOES NOT UPDATE correctly. Maybe it does not update at all but that i cannot see. Paul. Roy Lambert <roy.lambert@skynet.co.uk> wrote: Paul try sql.add('UPDATE selectietest a SET a.lic=true,a.licentie=b.licentie FROM selectietest a '); Sql.add('JOIN licenties b ON (a.lid_ID=b.lid_ID) '); sql.add('WHERE b.seizoen_ID=:seizoentest'); sql.parambyname('seizoentest').Asinteger := Dmref.TblSeizoenSeizoen_ID.value; Roy Lambert |
Tue, Jul 11 2006 1:47 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Paul
with DBISAMQuery1 do begin sql.Add('select * from eln'); sql.add('where _fkcompanies = :fred'); parambyname('fred').asinteger := DBISAMTable1.fieldbyname('_id').asinteger; execsql; end; Works here (ok its V4 but that shouldn't make any difference) Roy Lambert |
Tue, Jul 11 2006 2:11 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Paul,
<< works correct but if i change the code using a parameter sql.add('UPDATE selectietest a SET a.lic=true,a.licentie=b.licentie FROM selectietest a '); Sql.add('JOIN licenties b ON (a.lid_ID=b.lid_ID) '); with params.CreateParam(ftinteger, 'Seizoentest', ptInput) do Asinteger:=Dmref.TblSeizoenSeizoen_ID.value; sql.add('WHERE b.seizoen_ID=:seizoentest'); DOES NOT WORK... What could be the problem. >> Did you try letting the query do the parameter population (TDBISAMQuery.ParamCheck=True) and just setting the parameter after: sql.add('UPDATE selectietest a SET a.lic=true,a.licentie=b.licentie FROM selectietest a '); Sql.add('JOIN licenties b ON (a.lid_ID=b.lid_ID) '); sql.add('WHERE b.seizoen_ID=:seizoentest'); ParamByName('Seizoentest').Asinteger:=Dmref.TblSeizoenSeizoen_ID.value; ExecSQL; -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |