hello everyone
I want to add data into an exsiting table in mysql database.But the table has an item “UUID”.
So how can I create the UUID in KNIME?
Thank you!
Hi @vzzw
Although I don’t believe KNIME has a node to generate UUIDs for you automatically, there are several other ways you might do it:
- package
UUID()
in R using the R Snippet node - import
uuid
in Python using the Python Snippet node - online tools (https://www.uuidgenerator.net/) that create files you could then import
Then it’s just a matter of combining the UUID with the rest of your dataset.
thank you four your help!
I 'm not good at R or Python,could you show me some clear details,please?
That’s great.It worked! I have installed python3.7 and found some code,such as:
import uuid
print uuid.uuid1()
But it dosn’t work. So how to do it with"python snippet"? I’m a beginner and very interested in it,thanks again
Here’s an updated workflow that should work, assuming your Python environment is setup to work with KNIME properly (more on that here: https://docs.knime.com/2018-12/python_installation_guide/index.html)
GenerateUUIDExample3.knwf (13.6 KB)
Thank you very much!