         values (@ime, @prezime, @email, @telefon, @idgrad)
         set @idkupac = SCOPE_IDENTITY()
         
-        print 'Novi Kupac(' + cast(@idkupac as nvarchar(50)) + '), postojeci grad(' + cast(@idgrad as nvarchar(50)) + '), postojeca drzava(' + cast(@iddrzava as nvarchar(50)) + ').'
+        return 'Novi Kupac(' + cast(@idkupac as nvarchar(50)) + '), postojeci grad(' + cast(@idgrad as nvarchar(50)) + '), postojeca drzava(' + cast(@iddrzava as nvarchar(50)) + ').'
     END
     ELSE
         BEGIN
-        print 'Postojeci Kupac(' + cast(@idkupac as nvarchar(50)) + '), postojeci grad(' + cast(@idgrad as nvarchar(50)) + '), postojeca drzava(' + cast(@iddrzava as nvarchar(50)) + ').'
+        return 'Postojeci Kupac(' + cast(@idkupac as nvarchar(50)) + '), postojeci grad(' + cast(@idgrad as nvarchar(50)) + '), postojeca drzava(' + cast(@iddrzava as nvarchar(50)) + ').'
     END
-
+go
 -- Declare a variable to return the results of the function. 
 DECLARE @ret nvarchar(50);   
 
 -- Execute the function while passing a value to the @status parameter
-EXEC @ret = dbo.p1("Ivan", "Ivanovic", "ivan@example.com", "056067253", "zagreb", "hrvatska") 
+EXEC @ret = dbo.p1 "Ivan", "Ivanovic", "ivan@example.com", "056067253", "zagreb", "hrvatska"
 
 -- View the returned value.  The Execute and Select statements must be executed at the same time.  
-SELECT N'Function returned: ' + @ret; +SELECT N'Function returned: ' + @ret; 

        values (@ime, @prezime, @email, @telefon, @idgrad)
        set @idkupac = SCOPE_IDENTITY()
        
        print 'Novi Kupac(' + cast(@idkupac as nvarchar(50)) + '), novi grad(' + cast(@idgrad as nvarchar(50)) + '), nova drzava(' + cast(@iddrzava as nvarchar(50)) + ').'
    END
    ELSE IF @idkupac is null and @idgrad is null and @iddrzava is not null
    BEGIN

        values (@ime, @prezime, @email, @telefon, @idgrad)
        set @idkupac = SCOPE_IDENTITY()
        
        return 'Novi Kupac(' + cast(@idkupac as nvarchar(50)) + '), novi grad(' + cast(@idgrad as nvarchar(50)) + '), postojeca drzava(' + cast(@iddrzava as nvarchar(50)) + ').'
    END
    ELSE IF @idkupac is null and @idgrad is not null and @iddrzava is not null
    BEGIN
