So with a little help from Tim Hall [ blog | twitter ], I shall do a quick example.
I'm trying to integrate these 2 posts, PL/SQL: Split URL Parameters and PL/SQL: Split Key-Value Pairs. I don't want to store the parsed response or request string just yet, just the string. But in the off chance I want it parsed, I don't want to load it up into excel or something and begin the arduous task of breaking it down. I will (just remembered) have to parse the response string when I receive it though to figure out whether or not the transactions was Approved or Declined.
Let's start with the types:
CREATE OR REPLACE TYPE r_key_value_record IS OBJECTThe simple function, just for demonstration purposes:
CREATE OR REPLACE TYPE t_key_value_table AS TABLE OF R_KEY_VALUE_RECORD
CREATE OR REPLACEThis will definitely be expanded in the days to come to include those previous posts mentioned above. I will post the final result and link it up here as well.
FUNCTION get_key_value_pairs RETURN T_KEY_VALUE_TABLE PIPELINED
FOR i IN 1..10 LOOP
PIPE ROW ( R_KEY_VALUE_RECORD( i, i, i ) );