mssql curcor

Дед Анвирыч

Новичок
mssql curcor

PHP:
DECLARE @aс_id int(4), @sub_id int(4)
DECLARE cursor427 CURSOR FOR 
SELECT aс_id, sub_id
FROM #acnsub

OPEN cursor427

FETCH NEXT FROM cursor427
INTO @ac_id, @sub_id

WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO #test
           (ac_id, sub_id, cn_id, price, tax, qty, t_month, p_month, is_rent, started, man, status)
VALUES     (@ac_id, @sub_id, 0, 0, 0, 1, 1, 0, 0, '01 feb 2003', 0, 0)

   FETCH NEXT FROM cursor427
   INTO @ac_id, @sub_id
END
говорит:

Server: Msg 137, Level 15, State 1, Line 9
Must declare the variable '@ac_id'.
Server: Msg 137, Level 15, State 1, Line 15
Must declare the variable '@ac_id'.
Server: Msg 137, Level 15, State 1, Line 18
Must declare the variable '@ac_id'.


в чем бага?
 

pegas

Guest
а причем тут PHP?
иди лучше на http://www.sql.ru/ или иже с ними.
 
Сверху