I am trying to write a sp, which adjust the number of columns based on the IN Parameter for the raw file.
Raw (Id Int,RawData varchar2(5000))
RawData has actual data with delimiter, this column has all the raw file imported as is.
e.g. data in RawData Column
Here above you can see the max number of delimiter are 5 for a 6 column table, however for some records there are less delimiter, here comes the problem
For such records I want to add the extra delimter and take values for missing column as NULL or best would be''
plz help me in writing Generic SP to clean this.
We can pass the source & target table name and column names as a parameter, and create a clean table dynamically by name CleanedRaw etc.
here the file is | delimited, actually It can have any single char delimiter or space or tab also. I am ok if we need to pass the delimiter also as a parameter to this sp
I mean padd extra delimiters to make up to the max of 6 for this file, it can vary for other file
would be some thing like
such that target cleaned table will have values as below