Hello, I want my code function to convert the JSON data to BYTEA and then inserts into the table. Following is the code, CREATE OR REPLACE FUNCTION INS_BLOB() RETURNS VOID AS $$
DECLARE
v1 "TBL1"."COL1"%TYPE;
v2 "TBL1"."COL2"%TYPE;
BEGIN
v1 := utl_raw.cast_to_raw('{
"APPLICATION": {
"MEMORY": {
"OPTIONS" :{
"SOMETHING" : "SOMETHING",
"format" : "SOMETHING",
"System" : "",
"IP" : "",
"Port" : "",
"template" : "",
"Path" : "" ,
"Name" : "QUEUE",
"URL" : ""
}');
v2 := utl_raw.cast_to_raw('{
"APPLICATION": {
"MEMORY": {
"OPTIONS" :{
"SOMETHING" : "SOMETHING",
"format" : "SOMETHING",
"System" : "",
"IP" : "",
"Port" : "",
"template" : "",
"Path" : "" ,
"Name" : "QUEUE",
"URL" : ""
}');
INSERT INTO "TBL1" ("SN","COL1","COL2") values(1,v1, v2);
END;
$$
LANGUAGE 'plpgsql';
COMMIT;
... View more