Hi everybody.
I have a stored procedure that doesn't appear to be working. Here's the juicy details.
I am trying to move data from a DBF file to an InterBase table with the following Delphi code:
I've stepped through it and the loop runs correctly and it appears to execute the stored procedure. But when I check the table in IBConsole after running it there is no data!
Here is my stored procedure:
[tt]
CREATE PROCEDURE EMPL_DATA_MOVER
(
Prempl CHAR(9),
LastName CHAR(25),
FirstName CHAR(20),
ClinicId CHAR(6),
PayCycle CHAR(1),
Hourly CHAR(1),
HireDate DATE
)
AS
BEGIN
INSERT INTO MO_EMPL_INFO (PREMPL, EMPL_LAST, EMPL_FIRST, DEPT_ID, PAY_CYCLE, HOURLY, HIRE_DATE)
VALUESPrempl, :LastName, :FirstName, :ClinicId, ayCycle, :Hourly, :HireDate);
END^
[/tt]
I must admit this is my first time using a stored proc in Delphi, so if I'm missing something, please let me know.
Thanks.
I have a stored procedure that doesn't appear to be working. Here's the juicy details.
I am trying to move data from a DBF file to an InterBase table with the following Delphi code:
Code:
procedure TForm1.BitBtn1Click(Sender: TObject);
var
prempl : string;
last_name: string;
first_name: string;
clinic_id : string;
pay_cycle : string;
hourly : string;
begin
db_prempl.First;
while not db_prempl.Eof do
begin
prempl := db_premplprempl.AsString;
last_name := db_prempllast.AsString;
first_name := db_premplfirst.AsString;
clinic_id := db_prempldeptid.AsString;
pay_cycle := db_premplpaycycl.AsString;
hourly := db_premplhourly.AsString;
with IBStoredProc1 do
begin
ParamByName('PREMPL').AsString := prempl;
ParamByName('LASTNAME').AsString := last_name;
ParamByName('FIRSTNAME').AsString := first_name;
ParamByName('CLINICID').AsString := clinic_id;
ParamByName('PAYCYCLE').AsString := pay_cycle;
ParamByName('HOURLY').AsString := hourly;
ParamByName('HIREDATE').AsDate := db_premplhiredt.AsDateTime;
ExecProc;
end;
db_prempl.Next;
end;
ShowMessage('Data Updated!');
end;
I've stepped through it and the loop runs correctly and it appears to execute the stored procedure. But when I check the table in IBConsole after running it there is no data!
Here is my stored procedure:
[tt]
CREATE PROCEDURE EMPL_DATA_MOVER
(
Prempl CHAR(9),
LastName CHAR(25),
FirstName CHAR(20),
ClinicId CHAR(6),
PayCycle CHAR(1),
Hourly CHAR(1),
HireDate DATE
)
AS
BEGIN
INSERT INTO MO_EMPL_INFO (PREMPL, EMPL_LAST, EMPL_FIRST, DEPT_ID, PAY_CYCLE, HOURLY, HIRE_DATE)
VALUESPrempl, :LastName, :FirstName, :ClinicId, ayCycle, :Hourly, :HireDate);
END^
[/tt]
I must admit this is my first time using a stored proc in Delphi, so if I'm missing something, please let me know.
Thanks.