So I've been searching for a way to do this and I just can't seem to find it. I have a list of 3 pieces of data tag, time, and type. there are multiple records (like 280+) in a text (csv) file.
In PL/SQL developer I have a command file, in which i want to declare an array, and fill it from the values in the text file, but since I can't put the file on the server, I can't use the file as an external data source. I need to copy/paste the values into the PL\SQL block file that I'm working with. Something like the following
declare
type v_data is RECORD (tag number, time varchar2(12), type varchar2(15)) ;
type v_data_table is table of v_data index by binary_integer;
v_list v_data_table := v_data_table(v_data(1,'6:00 am','ONE'), v_data(240,'11:00 am', 'TWO'));
But i am getting an error that function v_data does not exist in the current scope when declaring the v_list variable. I've even tried moving the v_list initialize statement into the PL/SQL block, after the begin, like so;
declare
type v_data is RECORD (tag number, time varchar2(12), type varchar2(15)) ;
type v_data_table is table of v_data index by binary_integer;
v_list v_data_table ;
begin
v_list := v_data_table(v_data(1,'6:00 am','ONE'), v_data(240,'11:00 am', 'TWO'));
same error... any help is appreciated!
RECORDtype as though it were anOBJECTtype. If your type were an object, then you get a default constructor that does exactly what you are attempting. Second, you are using a table type indexed by binary_integer. Any table type with an index type declared cannot be built in bulk like this. You need to remove that piece of the declaration.binary_integeris the old name forpls_integer.