Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to insert Oracle blob in nifi using Json

avatar
New Contributor

I have a table in Oracle DB with one column holding BLOB data.

I convert Blob field into Binary Array see example "Json Data"

I get Error in PutDatabaseRecord that show  Can't insert table wiht different data type (LONG)

how can i do ?

 

Thank you.

 

Json Data

[
{
"GCB01": "DOC-30981-20220712-110419",
"GCB02": "DOC",
"GCB03": "01",
"GCB04": "001",
"GCB05": "test",
"GCB06": "test",
"GCB07": "1.pdf",
"GCB08": "D",
"GCB09": [37,80,68,70,45,49,46,55,13,10,37,-75,-75,-75,-75,13,10,49,32,48,32,111,98,106,13,10,60,60,47,84,121,112,101,47,67,97,116,97,108,111,103,47,80,97,103,101,115,32,50,32,48,32,82,47,76,97,110,103,40,122,104,45,84,87,41,32,47,83,116,114,117,99,116,84,114,101,101,82,111,111,116,32,49,53,32,48,32,82,47,77,97,114,107,73,110,102,111,60,60,47,77,97,114,107,101,100,32,116,114,117,101,62,62,47,77,101,116,97,100,97,116,97,32,50,57,32,48,32,82,47,86,105,101,119,101,114,80,114,101,102,101,114,101,110,99,101,115,32,51,48,32,48,32,82,62,62,13,10,101,110,100,111,98,106,13,10,50,32,48,32,111,98,106,13,10,60,60,47,84,121,112,101,47,80,97,103,101,115,47,67,111,117,110,116,32,49,47,75,105,100,115,91,32,51,32,48,32,82,93,32,62,62,13,10,101,110,100,111,98,106,13,10,51,32,48,32,111,98,106,13,10,60,60,47,84,121,112,101,47,80,97,103,101,47,80,97,114,101,110,116,32,50,32,48,32,82,47,82,101,115,111,117,114,99,101,115,60,60,47,70,111,110,116,60,60,47,70,49,32,53,32,48,32,82,47,70,50,32,49,50,32,48,32,82,62,62,47,69,120,116,71,83,116,97,116,101,60,60,47,71,83,49,48,32,49,48,32,48,32,82,47,71,83,49,49,32,49,49,32,48,32,82,62,62,47,80,114,111,99,83,101,116,91,47,80,68,70,47,84,101,120,116,47,73,109,97,103,101,66,47,73,109,97,103,101,67,47,73,109,97,103,101,73,93,32,62,62,47,77,101,100,105,97,66,111,120,91,32,48,32,48,32,53,57,53,46,51,50,32,56,52,49,46,57,50,93,32,47,67,111,110,116,101,110,116,115,32,52,32,48,32,82,47,71,114,111,117,112,60,60,47,84,121,112,101,47,71,114,111,117,112,47,83,47,84,114,97,110,115,112,97,114,101,110,99,121,47,67,83,47,68,101,118,105,99,101,82,71,66,62,62,47,84,97,98,115,47,83,47,83,116,114,117,99,116,80,97,114,101,110,116,115,32,48,62,62,13,10,101,110,100,111,98,106,13,10,52,32,48,32,111,98,106,13,10,60,60,47,70,105,108,116,101,114,47,70,108,97,116,101,68,101,99,111,100,101,47,76,101,110,103,116,104,32,49,55,56,62,62,13,10,115,116,114,101,97,109,13,10,120,-100,-83,-50,-69,14,-126,64,16,5,-48,126,-109,-3,-121,91,-126,-119,-69,59,-53,107,73,8,5,15,-119,70,11,3,-58,-62,88,80,32,-107,-60,-57,-1,39,46,98,67,104,-99,-18,102,-18,76,14,100,-3,104,7,36,-119,60,-28,-37,2,74,-18,-37,-95,-121,-45,13,-21,83,-19,-90,41,-78,34,-57,-109,51,37,-44,56,-58,68,4,-123,32,14,-124,-89,97,124,18,-79,-58,-85,-29,-20,-68,-62,-64,89,-42,112,38,55,4,-46,104,110,-100,-115,85,5,66,108,-81,-75,-113,40,8,-123,-79,-101,-69,45,85,53,41,-12,111,-5,24,-3,20,-23,23,43,-50,46,-119,-14,-54,34,-67,-94,-39,113,86,-38,-97,71,-50,80,30,114,96,-114,-91,63,96,-11,2,27,10,-14,103,-40,47,113,-126,57,112,-105,-86,15,-126,-93,66,90,13,10,101,110,100,115,116,114,101,97,109,13,10,101,110,100,111,98,106,13,10,53,32,48,32,111,98,106,13,10,60,60,47,84,121,112,101,47,70,111,110,116,47,83,117,98,116,121,112,101,47,84,121,112,101,48,47,66,97,115,101,70,111,110,116,47,66,67,68,69,69,69,43,67,97,108,105,98,114,105,47,69,110,99,111,100,105,110,103,47,73,100,101,110,116,105,116,121,45,72,47,68,101,115,99,101,110,100,97,110,116,70,111,110,116,115,32,54,32,48,32,82,47,84,111,85,110,105,99,111,100,101,32,50,53,32,48,32,82,62,62,13,10,101,110,100,111,98,106,13,10,54,32,48,32,111,98,106,13,10,91,32,55,32,48,32,82,93,32,13,10,101,110,100,111,98,106,13,10,55,32,48,32,111,98,106,13,10,60,60,47,66,97,115,101,70,111,110,116,47,66,67,68,69,69,69,43,67,97,108,105,98,114,105,47,83,117,98,116,121,112,101,47,67,73,68,70,111,110,116,84,121,112,101,50,47,84,121,112,101,47,70,111,110,116,47,67,73,68,84,111,71,73,68,77,97,112,47,73,100,101,110,116,105,116,121,47,68,87,32,49,48,48,48,47,67,73,68,83,121,115,116,101,109,73,110,102,111,32,56,32,48,32,82,47,70,111,110,116,68,101,115,99,114,105,112,116,11],
"GCB10": null,
"GCB11": "O",
"GCB12": "U",
"GCB13": "Z0078",
"GCB14": "1500",
"GCB15": "1657555200000",
"GCB16": null,
"GCB17": null,
"GCB18": null
}
]

Schema define:


{
"type": "record",
"name": "gcb_file",
"fields" : [
{"name": "GCB01", "type": ["null", "string"]},
{"name": "GCB02", "type": ["null", "string"]},
{"name": "GCB03", "type": ["null", "string"]},
{"name": "GCB04", "type": ["null", "string"]},
{"name": "GCB05", "type": ["null", "string"]},
{"name": "GCB06", "type": ["null", "string"]},
{"name": "GCB07", "type": ["null", "string"]},
{"name": "GCB08", "type": ["null", "string"]},
{"name": "GCB09", "type": ["null", "bytes"]},
{"name": "GCB10", "type": ["null", "string"]},
{"name": "GCB11", "type": ["null", "string"]},
{"name": "GCB12", "type": ["null", "string"]},
{"name": "GCB13", "type": ["null", "string"]},
{"name": "GCB14", "type": ["null", "string"]},
{"name": "GCB15", "type": ["null", "string"]},
{"name": "GCB16", "type": ["null", "string"]},
{"name": "GCB17", "type": ["null", "string"]},
{"name": "GCB18", "type": ["null", "string"]}
]
}

 

Steven_Hsiao_0-1658196275654.png

 

 

 

 

 

0 REPLIES 0