Conflicts while using the ORACLE 116 commands.

Using ORACLE 11G, the output should be “123@456@789.” The command is; if the input is constant, apply Pl/SGL Developer or return correctly by Java. But if it’s "var||constant||var||constant||var," it should only return the constant. However, my function only produces “@@.” What should I do to have the ideal result?
