Re: Cursor Issue??
От | DracKewl |
---|---|
Тема | Re: Cursor Issue?? |
Дата | |
Msg-id | 1122991109.837662.306080@g44g2000cwa.googlegroups.com обсуждение исходный текст |
Ответ на | Re: Cursor Issue?? (Roman Neuhauser <neuhauser@sigpipe.cz>) |
Список | pgsql-general |
Hey Roman, Thanks for your reponse's! I made it happen in MicrosoftSQL using the first code below. The only difference is I had to create variables. Which I'm having a hard time trying to replicate it in psql. __________Microsoft Code___________ USE test GO DECLARE @qty INT, @Length varchar(20), @Width varchar(40) DECLARE cursor1 SCROLL CURSOR FOR SELECT * from Parts OPEN cursor1 FETCH FIRST FROM cursor1 INTO @qty, @Length, @Width INSERT INTO PartsTemp (qty, Length, Width) VALUES (@qty, @Length, @Width) CLOSE cursor1 DEALLOCATE cursor1 GO __________psql Code___________ (These declaration of vaiables don't work) DECLARE c_qty INT; DECLARE c_Length FLOAT; DECLARE c_Width FLOAT; BEGIN; DECLARE cursor1 CURSOR FOR SELECT * FROM Parts; FETCH FIRST FROM cursor1 INTO c_qty, c_Length, c_Width; INSERT INTO partstemp VALUES (c_qty, c_Length, c_Width); CLOSE cursor1; COMMIT; Got any ideas using variable to transfer singular rows?
В списке pgsql-general по дате отправления: