I am working on a project that deal with ORACLE DATABASE. My project has two functionality, one is fetching content of table into a flat file aka backup and second one is take that flat file to restore that data back to blank table having same structure aka restore.
I can backup and restore oracle database data for all datatype object except RAW|LONG RAW. I have an issue regarding it. for example I backup the database data into flat file in the from of string. like
1,"Name", "Class",12.00
Now if any table has RAW or LONG RAW datatype then at the time of insertion into table it may be inserted from any datatype to raw type using RAWTOHEX method. To understand the case better we takes two table for now.
one table say TBLNUM and their column ID NUMBER, RAWINT RAW(2000)
second table say TBLCHAR and their column ID NUMBER, RAWCHAR RAW(2000)
So we insert the data into TBLNUM for the num value to raw using numbers only and TBLCHAR for string only.
I am not very much known about this type. But I can get back the inserted data as following ways If I insert number for RAW column by RAWTOHEX(1), it saved the 1 in the form of 'C102' and I can get back 1 using following method utl_raw.cast_to_number('C102')
Same I can do for STRING RAWTOHEX('7D') -> 3744 and get back that by ult_raw.cast_to_varchar2('3744') -> 7D
first, please correct me if I am wrong second if I am correct then my question is how can I identify from flat file that the given RAW column value is created from INTEGER VALUE OR STRING VALUE
I want to find the solution, using that I can insert the same data back to different database table using that backup file. And data should be inserted as it was in source table from where I did create flat file.