well, seems to be oracle, or?
i would advice you to create a sequence for your StundentID and a before-insert-trigeger on the table for supplying this field with the sequence-value
but anyway try this
Clear;
Add('DECLARE');
Add('varStudentID NUMBER;');
Add('BEGIN');
Add('SELECT NVL(MAX(STUDENTID),0) + 1 INTO varStudentID FROM ');
Add(' STUDENT.STUDENTABLE');
Add('INSERT INTO');
Add('STUDENT.STUDENTTABLE'
Add('VALUES');
Add('(varStudentID,:studen
Add('END;');
ParamByName('studentNAme')
Execute;
ID := ParamByName('outParam').As
guess the real-field is StudentID
using a sequence/trigger pair only the insert statement is needed
not tested
meikl ;-)
Main Topics
Browse All Topics





by: Geert_GruwezPosted on 2008-09-11 at 23:35:58ID: 22457545
Select allOpen in new window