Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alter procedure zad3a (@login varchar(30))
- as
- declare
- @tytul varchar (20),
- @imie varchar (30),
- @nazwisko varchar (30),
- @data_wypozyczenia date
- IF @login IS NULL OR @login != -1
- begin
- print 'Brakuje ci paramteru'
- end
- else
- begin
- declare kursor cursor for
- select tytul, imie, nazwisko, dataWypozyczenia
- from ksiazka
- left outer join wypozyczenie on wypozyczenie.idKsiazka = ksiazka.IdKsiazka
- left outer join klient on klient.IdKlient = wypozyczenie.idKlient
- open kursor
- fetch next from kursor into @tytul, @imie, @nazwisko, @data_wypozyczenia
- WHILE @@FETCH_STATUS = 0
- begin
- if @data_wypozyczenia is null
- print 'dupa'
- else
- print convert(varchar(15),@tytul) + '-' +convert(varchar(15),@imie) + '- '+ convert(varchar(15),@nazwisko) + '-' + convert(varchar(15),@data_wypozyczenia)
- fetch next from kursor into @tytul, @imie, @nazwisko, @data_wypozyczenia
- end
- close kursor
- deallocate kursor
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement