cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Escape characters in String in cypher statement

nitinjkt
Node Link

Dear Team,

I am facing some challenges while trying to call multiple apoc procedure within one another.

call apoc.custom.asProcedure('RIL_ODU_PATH_TERMINATION_V1',
'call apoc.bolt.execute("bolt://user:password@10.144.97.90:7070",
"match (a:inventoryObjects{type : $param11})-[r:INSTANCE_OF]->(c:classes{name:'gPath'})
where ((a.name = $param22 and $param22 is not null) or (1=1 and $param22 is null))
with a
optional match (b:inventoryObjects{site_inst_id : a.a_side_site_id})-[r:INSTANCE_OF]->(c:classes{name : 'gFacility'})
with a,b
optional match (d:inventoryObjects{site_inst_id : a.z_side_site_id})-[r:INSTANCE_OF]->(c:classes{name : 'gFacility'})
with a,b,d
CALL apoc.cypher.run(
"call custom.path_element_v('gPath' ,'"+ a.name +"') yield path_element_parent_equip as path_element_parent_equip,
path_element_equip as path_element_equip,path_element_shelf as path_element_shelf,
path_element_par_slot as path_element_par_slot,path_element_par_card as path_element_par_card,path_element_child_slot as path_element_child_slot,
path_element_child_card as path_element_child_card,path_element_port as path_element_port,path_element_port_name as path_element_port_name,
path_pkey as path_pkey,path_element_no as path_element_no
RETURN path_element_parent_equip as path_a_equip_slte,path_element_equip as path_a_equipment, path_element_shelf as path_a_shelf,
path_element_par_slot as path_a_par_slot,path_element_par_card as path_a_par_card,path_element_child_slot as path_a_child_slot,
path_element_child_card as path_a_child_card,path_element_port as path_a_port,path_element_port_name as path_a_equip_to_port
ORDER BY path_element_no ASC
LIMIT 1",{}
) yield value
CALL apoc.cypher.run(
"call custom.path_element_v('gPath' ,'"+ a.name +"') yield path_element_parent_equip as path_element_parent_equip,
path_element_equip as path_element_equip,path_element_shelf as path_element_shelf,
path_element_par_slot as path_element_par_slot,path_element_par_card as path_element_par_card,path_element_child_slot as path_element_child_slot,
path_element_child_card as path_element_child_card,path_element_port as path_element_port,path_element_port_name as path_element_port_name,
path_pkey as path_pkey,path_element_no as path_element_no
RETURN path_element_parent_equip as path_z_equip_slte,path_element_equip as path_z_equipment, path_element_shelf as path_z_shelf,
path_element_par_slot as path_z_par_slot,path_element_par_card as path_z_par_card,path_element_child_slot as path_z_child_slot,
path_element_child_card as path_z_child_card,path_element_port as path_z_port,path_element_port_name as path_z_equip_to_port
ORDER BY path_element_no DESC
LIMIT 1",{}
) yield value as value1
return a.name AS path_name,
a.type AS path_type,
a.status AS path_status,
a.bandwidth AS path_bandwidth,
b.name AS path_aside_site,
d.name AS path_zside_site,
value.path_a_equip_slte as path_a_equip_slte,
value1.path_z_equip_slte as path_z_equip_slte,
value.path_a_equipment as path_a_equipment,
value1.path_z_equipment as path_z_equipment,
value.path_a_shelf as path_a_shelf,
value1.path_z_shelf as path_z_shelf,
value.path_a_par_slot as path_a_par_slot,
value1.path_z_par_slot as path_z_par_slot,
value.path_a_par_card as path_a_par_card,
value1.path_z_par_card as path_z_par_card,
value.path_a_child_slot as path_a_child_slot,
value1.path_z_child_slot as path_z_child_slot,
value.path_a_child_card as path_a_child_card,
value1.path_z_child_card as path_z_child_card,
value.path_a_port as path_a_port,
value1.path_z_port as path_z_port,
value.path_a_equip_to_port as path_a_equip_to_port,
value1.path_z_equip_to_port as path_z_equip_to_port", {param11:$param ,param22:$param2},{virtual:true}) yield row
with row as map return apoc.map.get(map,"path_name") as path_name ,
apoc.map.get(map,"path_type") as path_type ,
apoc.map.get(map,"path_status") as path_status ,
apoc.map.get(map,"path_bandwidth") as path_bandwidth ,
apoc.map.get(map,"path_aside_site") as path_aside_site ,
apoc.map.get(map,"path_zside_site") as path_zside_site ,
apoc.map.get(map,"path_a_equip_slte") as path_a_equip_slte ,
apoc.map.get(map,"path_z_equip_slte") as path_z_equip_slte ,
apoc.map.get(map,"path_a_shelf") as path_a_shelf ,
apoc.map.get(map,"path_z_shelf") as path_z_shelf ,
apoc.map.get(map,"path_a_par_slot") as path_a_par_slot ,
apoc.map.get(map,"path_z_par_slot") as path_z_par_slot ,
apoc.map.get(map,"path_a_par_card") as path_a_par_card ,
apoc.map.get(map,"path_z_par_card") as path_z_par_card ,
apoc.map.get(map,"path_a_child_slot") as path_a_child_slot ,
apoc.map.get(map,"path_z_child_slot") as path_z_child_slot ,
apoc.map.get(map,"path_a_child_card") as path_a_child_card ,
apoc.map.get(map,"path_z_child_card") as path_z_child_card ,
apoc.map.get(map,"path_z_port") as path_a_port ,
apoc.map.get(map,"path_z_port") as path_z_port ,
apoc.map.get(map,"path_a_equip_to_port") as path_a_equip_to_port ,
apoc.map.get(map,"path_z_equip_to_port") as path_z_equip_to_port
',
'read',[['path_name','String'],['path_type','String'],['path_status','String'],['path_bandwidth','String'],['path_aside_site','String'],
['path_zside_site','String'],['path_a_equip_slte','String'],['path_z_equip_slte','String'],['path_a_shelf','String'],['path_z_shelf','String'],
['path_a_par_slot','String'],['path_z_par_slot','String'],['path_a_par_card','String'],['path_z_par_card','String'],['path_a_child_slot','String'],
['path_z_child_slot','String'],['path_a_child_card','String'],['path_z_child_card','String'],['path_a_port','String'],['path_z_port','String'],
['path_a_equip_to_port','String'],['path_z_equip_to_port','String']],[['param','String'],['param2','String']],'ODU Path Termination');

while i am executing above statement, custom procedure is created but when i executed this procedure by using statement
call custom.RIL_ODU_PATH_TERMINATION_V1('ODU',null)

Its showing error as

I understnad its string concatenation or escaping character but not able to resolve it.

It would be grateful If any one can help to resolve this issue.

0 REPLIES 0