I am trying to generate a random character string of length 8 in Netezza, any suggestions?

1 Answer 1


If you're happy with a hex string, you could do:

select to_hex(round(random() * 2^32 - 1)::BIGINT) AS randchars;

You could also write a user-defined function if you want a very specific type of string. For this, you would need SSH access on the Netezza appliance and some basic knowledge of C++. It may be simpler for you to write these functions in Lua if you're not comfortable with C++ or if you don't have an account on the appliance, but this requires Netezza Analytics to be installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.