我正图从图表中找到所有可能的路线来编写代码。该代码应使用单个输入值。例如,我想找到它A点到B点的所有可能路线。 ' Q" u/ F N: v: J我认为一个过程可能会解决问题,但我得到了错误的消息。 6 u* M1 Q1 w |( U3 w( n图形表格(所有路线的概述)为" w1 D, w1 B: }: k) r2 E: k& j- J
P_FROM P_TO DISTANCEA B 44444 A C B C C D 1555 B D 17717A D B E C E 程序是 2 E/ m" @: C# o- K0 b6 r) [4 ~) YCREATE OR REPLACE PROCEDURE p_find_all_routes ( p_start IN VARCHAR2 DEFAULT , p_end IN VARCHAR2 DEFAULT , p_via IN VARCHAR2 DEFAULT '%')ASBEGIN -- ======================================================================= -- Author: Coilin P. Boylan Jeritslev (CTBJ) -- Description: Find all possible routes between two different points -- "p_start" and "p_end" via the choosen point "p_via" in a graph-tabel. -- ======================================================================= WITH multiroutes (p_from,p_to,full_route,total_distance) AS (SELECT p_from, p_to, p_from || '->' || p_to full_route, distance total_distance FROM graph WHERE p_from LIKE p_start UNION ALL SELECT M.p_from, n.p_to, M.full_route || '->' || n.p_to full_route, M.total_distance n.distance total_distance FROM multiroutes M JOIN graph n ON M.p_to = n.p_from WHERE n.p_to ALL (M.full_route)) SELECT * FROM multiroutes WHERE p_to LIKE p_end AND ( full_route LIKE ('%->' || p_via || OR full_route LIKE .|| p_via || '->) ORDER BY p_from,p_to,total_distance ASC;END;/当我使用以下输入执行过程时:! Y: `6 H4 X& F# X% |/ X
EXEC p_find_all_routes('A','E我希望程序已经编译好了,我得到了结果 ( Q: z& W1 ]/ S) H, t8 C- c9 gP_FROM P_TO FULL_ROUTE TOTAL_DISTANCEA E A->B->E A E A->C->E A E A->B->C->E 43但是我收到PLS-关于00428的错误消息。INTO。 / f. r( c! X6 x* T: }9 f. e: o, O我不想把输出值插入表格。我只想检查输出值。我该怎么办? 9 v }* O, m& A ' i2 R o; R, d( H# V/ z解决方案: