Catalyzes the ATP-dependent amidation of deamido-NAD to form NAD. Uses L-glutamine as a nitrogen source. In vitro, can also use ammonia with comparable specific activity. ATP + deamido-NAD(+) + H2O + L-glutamine = AMP + diphosphate + H(+) + L-glutamate + NAD(+) The formation of the intermediates complex at the synthetase domain stimulates the glutaminase activity. kcat is 0.55 sec(-1) for glutamine-dependent activity. kcat is 2.8 sec(-1) for ammonia-dependent activity. Cofactor biosynthesis; NAD(+) biosynthesis; NAD(+) from deamido-NAD(+) (L-Gln route): step 1/1. Homooctamer; composed of two stacked homotetramers that form a ring-like structure. An ammonia tunnel 40 Angstroms long allows transfer of ammonia from the glutaminase active site, where it is produced, to the synthetase active site, where it is used for the ATP-dependent formation of NAD(+). In the C-terminal section; belongs to the NAD synthetase family.