Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Базы";
Текущий архив: 2003.06.26;
Скачать: [xml.tar.bz2];

Вниз

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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.133 c
3-84040
mao
2003-06-01 12:28
2003.06.26
БД, языки и кодировки


14-84635
NewN
2003-06-10 08:31
2003.06.26
Деятельность Луны в длинной фазе.


1-84249
nevalex
2003-06-13 17:26
2003.06.26
Как програмно отличить папку от файла.


3-83854
KIR
2003-05-29 10:28
2003.06.26
Перенос данных из одной БД в аналогичную (IB)


11-84050
ZZ
2002-06-27 19:04
2003.06.26
KOL и Unicode





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский