Blockage - are you eating fibrous or hard foods you shouldn't?
If you get that sharp stabbing pain, how soon after eating is it?
It could be a stomach ulcer if you're vomiting, or an intestinal ulcer.
Does the pain occur 10-15 minutes after eating, or 1-2 hours after eating?
If it's 5-15 minutes, it's a stomach ulcer. If it's 1-2 hours after, it's an intestinal ulcer.
Try eating very alkaline, clean, non-processed foods with no sugar.
Then see 24-48 hours later if you're still getting the sharp pains.
Then eat processed or unhealthy sugary food, then wait and see if you get the pain again.
If you do, it's an ulcer for sure and you know you're going to need a minimum of 6-8 weeks of very clean healing food to repair the mucus and cell wall. Try to get some soursop, a South American fruit.
If it's not that at all and too random, I'd recommend getting an ultrasound on the area. If that doesn't show anything, get an x-ray. It can show a bowel blockage instantly.
Avoid CT scans unless you really have to. They're very dangerous long term. Get a gastroscopy scope. They're quick and can show stomach and intestinal ulcers in the upper small intestine only. There's then a bowel camera, the size of a pill, that you ingest and it takes pictures all the way through your insides to show what's going on.
If none of the above shows what's happening and it's still going on, Chinese medicine and acupuncture may help. You may have a blocked channel causing cramping, stabbing pain, among other issues.
I'm sure there are many more causes for these symptoms, but these are off the top of my head for now.