We demonstrate second-harmonic generation for various discrete input wavelengths by a controllable quasiphase matching method. This is done by forming ferroelectric domain gratings in SrxBa1-xNb2O6 crystals. The method allows flexible preparation of tailored quasiphase matching for prespecified wavelengths over prespecified bandwidths. Conversion efficiencies of 5% were achieved.