ok also SELECT funktionierte... meine StoredProc scheint es auch zu tun... so sieht sie nun aus:
SQL-Code:
ALTER PROCEDURE [dbo].[p_bb_ignore_folder]
@username varchar(30),
@ignore_dir varchar(255),
@date_time datetime
AS
DECLARE
@size bigint,
@id_user int
SET @size = -1;
SET @id_user = (SELECT [t_bb_user].[id_user] FROM [t_bb_user] WHERE [t_bb_user].[username] = @username);
SET @size = ( SELECT SUM([t_bb_folder_info].[folder_size]) FROM [t_bb_folder_info]
WHERE (
[t_bb_folder_info].[id_user] = @id_user
AND [t_bb_folder_info].[folder] LIKE @ignore_dir
AND dbo.DateOnly([t_bb_folder_info].[date_time]) = dbo.DateOnly(@Date_Time)
AND [t_bb_folder_info].[date_time] BETWEEN DateAdd(millisecond, -1, @Date_Time) and DateAdd(millisecond, 1, @Date_Time)
)
);
UPDATE t_bb_logon
SET
[t_bb_logon].[ignore_dir_size] = @size
WHERE (
[t_bb_logon].[id_user] = @id_user
AND dbo.DateOnly([t_bb_logon].[date_time]) = dbo.DateOnly(@Date_Time)
AND [t_bb_logon].[date_time] BETWEEN DateAdd(millisecond, -1, @Date_Time) and DateAdd(millisecond, 1, @Date_Time)
);
RETURN @size
mit dem aufruf direkt vom Server funktioniert das so:
SQL-Code:
declare
@result bigint
EXEC @result = p_bb_ignore_folder 'th21498', 'C:\Dokumente und Einstellungen\th21498\Lokale Einstellungen\%', '20080507 15:16:32.000'
print CAST(@result AS CHAR(255));
alles palleti...
wie befürchtet funktioniert der Aufruf aus meiner Delphi-Applikation leider nicht. Meine Vermutung -> eben das angesprochene ydm <-> ymd Problem...
meint Aufruf in Delphi:
Delphi-Quellcode:
procedure TSisterWatch.IgnoreDir(Date_Time: TDateTime);
var
tmp_igp: String;
begin
tmp_igp := GetIgnoreDir;
if tmp_igp <> '' then
begin
with ADOStoredProc8 do
begin
Parameters.ParamValues['@username'] := Username;
Parameters.ParamValues['@ignore_dir'] := tmp_igp;
Parameters.ParamValues['@date_time'] := Date_Time;
ExecProc;
end;
end;
end;
wie stelle ich das nun an...