Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.06.26;
Скачать: CL | DM;

Вниз

DataBaseError -    Найти похожие ветки 

 
Инна   (2003-06-03 18:09) [0]

две хп на сервере
1. СREATE PROCEDURE correctlec;1
@gr int, @dis int, @color int, @prepod int
AS
SET NOCOUNT ON
declare @potok int
set @potok =(select code_of_potok from groups where ID=@gr)
declare curs cursor local scroll read_only
for select ID from groups where code_of_potok=@potok
open curs
fetch first from curs into @gr
while @@fetch_status = 0
begin
if not exists (select * from lection where code_of_group=@gr and code_of_dis=@dis and color=@color)
insert into lection (code_of_group, code_of_dis, color, code_of_prepod)
values (@gr, @dis, @color, @prepod )
else
update lection set code_of_prepod=@prepod where code_of_group=@gr and code_of_dis=@dis and color=@color
fetch next from curs into @gr
end
close curs
deallocate curs
GO


2 - CREATE PROCEDURE correctlec2;1
@gr int, @dis int, @color int, @hours int
AS
SET NOCOUNT ON
declare @potok int
set @potok =(select code_of_potok from groups where ID=@gr)
declare curs cursor local scroll read_only
for select ID from groups where code_of_potok=@potok
open curs
fetch first from curs into @gr
while @@fetch_status = 0
begin
if not exists (select * from lection where code_of_group=@gr and code_of_dis=@dis and color=@color)
insert into lection (code_of_group, code_of_dis, color, hours)
values (@gr, @dis, @color, @hours )
else
update lection set hours=@hours where code_of_group=@gr and code_of_dis=@dis and color=@color
fetch next from curs into @gr
end
close curs
deallocate curs
GO

из проги определяется абсолютно одинаково:
1 - correct3.Parameters.ParamByName("@gr").Value:=group;
correct3.Parameters.ParamByName("@dis").Value:=ADODataSet1.FieldByName("code_of_dis").AsInteger;
correct3.Parameters.ParamByName("@color").Value:=1;
correct3.Parameters.ParamByName("@prepod").Value:=p1;
correct3.Execute;

2- correct4.Parameters.ParamByName("@hours").Value:=edit_l_h.Text;
correct4.Parameters.ParamByName("@dis").Value:=ADODataSet1.FieldByName("code_of_dis").AsInteger;
correct4.Parameters.ParamByName("@color").Value:=1;
correct4.Parameters.ParamByName("@gr").Value:=group;
correct4.Execute;


первая проходит отлично, вторая никакие парметры не находит (в проге меняла местами). почему? может, вы увидите, я уже не вижу.....


 
Zelius ©   (2003-06-03 18:42) [1]

А попробуй перед присвоением параметров поставить что-то типа correct4.Parameters.Refresh;



Страницы: 1 вся ветка

Текущий архив: 2003.06.26;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.023 c
14-84706
nick-from
2003-06-04 23:01
2003.06.26
Зачем убили мой вопрос про dbf?


3-83982
Ренат
2003-05-30 08:29
2003.06.26
Некорректная запись в базе


3-83868
DBDev
2003-05-30 15:11
2003.06.26
Почему ХП возвращает ReadOnly рекордсет??? ПОМОГИТЕ ПЛЗ!


14-84542
Soft
2003-06-04 18:35
2003.06.26
Преодоление и смирение


14-84537
linker
2003-06-04 10:53
2003.06.26
PDF?????????????????????????????????????