When you wrote: "do not know how to incorporate [allocation functions] with an actual SQl statement" and "would like to use malloc with inserting data", I inferred that you do not yet know what the functions are for. I suggest you do a web search for "malloc and free". This will turn up a plethora of sites where you can learn all about their purposes and usages.