I have the following table
id | p_key | col3 | col4
------------------------
1 | pr1 | c1 | co1
2 | pr2 | c2 | co2
3 | pr3 | c3 | co3
Now I have to create partition on project key, something like
If partition partpr1 not exist
alter table create partition partpr1
I want to create partition with p_key
but want to check if it exist or not before inserting record, if it exist it will insert in that partition else it will first create partition then insert.
Not posting any code. because I'm able to create simple partition, but could not getting any logic to implement desired scenario.