我有Oracle存儲過程中,我有一個varible插入逗號分隔散裝串入表
ids = '409065,93254,1000493402,133485,1002200674,1002686682,1000933402,1001671843,73164,1000480564,1002739956,1002228048,502731,1005114779,1004490734,1000830271,1000736038,1002728806,1007286917,1017655201,433535,1000416343,1001961884,178764,1000386274,1000392797,75272,282774,385409,1002759663,1002759515,1002862987,1005408942,1002945068,1004186393,1004273792,1002796666,1010443861,1002542001,1002933043,1000583061,1003171856,102229,1003485036,480827,1002365185,1001444669,149055,1002737902,1006296285,1005911768,478164,163635,1000760087,1003407655,1000285184,466212,1005094662,1006186285,1001345121,1003980207,1002760459,1000284633,1002591304,1001733016,1002736035,1002173855,1001954063,1002286714,201057,1000364289,1002003097,19542,16594,1004457516,1003280442,1002455699,1002541005,1004433471,642932,1000286571,1000633786,1002881698,1001961388,537829,1005411854,1013084048,1014240809,389536,232068,65951,1001579289,286176,1002584197,1002692879,1001673714,1002609262,1002745255,1002763229,1004692175,1001889555,1002752278,1001386316,1013052324,1000368098,279633,80896,1002743147,1000675179,1000284102,58017,1001630012,1000485329,1003438356,1004912086,1003460394,1012132693,409065,93254,1000493402,133485,1002200674,1002686682,1000933402,1001671843,73164,1000480564,1002739956,1002228048,502731,1005114779,1004490734,1000830271,1000736038,1002728806,1007286917,1017655201,433535,1000416343,1001961884,178764,1000386274,1000392797,75272,282774,385409,1002759663,1002759515,1002862987,1005408942,1002945068,1004186393,1004273792,1002796666,1010443861,1002542001,1002933043,1000583061,1003171856,102229,1003485036,480827,1002365185,1001444669,149055,1002737902,1006296285,1005911768,478164,163635,1000760087,1003407655,1000285184,466212,1005094662,1006186285,1001345121,1003980207,1002760459,1000284633,1002591304,1001733016,1002736035,1002173855,1001954063,1002286714,201057,1000364289,1002003097,19542,16594,1004457516,1003280442,1002455699,1002541005,1004433471,642932,1000286571,1000633786,1002881698,1001961388,537829,1005411854,1013084048,1014240809,389536,232068,65951,1001579289,286176,1002584197,1002692879,1001673714,1002609262,1002745255,1002763229,1004692175,1001889555,1002752278,1001386316,1013052324,1000368098,279633,80896,1002743147,1000675179,1000284102,58017,1001630012,1000485329,1003438356,1004912086,1003460394,1012132693,409065,93254,1000493402,133485,1002200674,1002686682,1000933402,1001671843,73164,1000480564,1002739956,1002228048,502731,1005114779,1004490734,1000830271,1000736038,1002728806,1007286917,1017655201,433535,1000416343,1001961884,178764,1000386274,1000392797,75272,282774,385409,1002759663,1002759515,1002862987,1005408942,1002945068,1004186393,1004273792,1002796666,1010443861,1002542001,1002933043,1000583061,1003171856,102229,1003485036,480827,1002365185,1001444669,149055,1002737902,1006296285,1005911768,478164,163635,1000760087,1003407655,1000285184,466212,1005094662,1006186285,1001345121,1003980207,1002760459,1000284633,1002591304,1001733016,1002736035,1002173855,1001954063,1002286714,201057,1000364289,1002003097,19542,16594,1004457516,1003280442,1002455699,1002541005,1004433471,642932,1000286571,1000633786,1002881698,1001961388,537829,1005411854,1013084048,1014240809,389536,232068,65951,1001579289,286176,1002584197,1002692879,1001673714,1002609262,1002745255,1002763229,1004692175,1001889555,1002752278,1001386316,1013052324,1000368098,279633,80896,1002743147,1000675179,1000284102,58017,1001630012,1000485329,1003438356,1004912086,1003460394,1012132693,19542,232068,16594,286176,1004433471,1001444669,1002759515,1000830271,1006186285,1002945068,1003001411,1006631785,1012132693,1012272096,1017655201,433535,93254,1000368098,1001961884,1001733016,133485,1002286714,149055,466212,1001889555,1000285656,1002760459,1000284633,1000583061,1003171856,178764,1001954063,1002455699,1000386274,1000285184,1002745255,1002759663,1002003097,1000284102,58017,1002455699,1002365185,1003407655,1002609262,1002686682,537829,19542,1006186285,409065,1002862987,1000933402,478164,1002945068,1002173855,1002200674,1007286917,1014240809,1001954063,1004273792,1001444669,1002728806,1002743147,1002286714,1001630012,286176,1017655201,178764,1012132693,1002736035,1005114779,1012272096,1003171856,1004912086,1005408942,102229,133485,163635,1006631785,1013052324,1002752278,1000285656,1005411854,80896,1003438356,1001733016,1000493402,1000583061,389536,433535,1000368098,1003460394,1000633786,1001671843,480827,1003485036,1002692879,1001673714,1004490734,1000830271,279633,1000284633,149055,16594,642932,1002003097,65951,466212,1001386316,1002737902,1002763229,1000480564,1000364289,1002745255,1000285184,1002759663,1002739956,1000760087,1002591304,1013084048,385409,1000286571,1002228048,1002796666,232068,1002881698,1004692175,1002759515,1000416343,1010443861,282774,73164,75272,1004457516,1002760459,1001579289,1005911768,1001889555,1000736038,1003001411,1001961388,1005094662,1001961884,1000485329,1002542001,201057,1003280442,1003980207,502731,1002933043,1004186393,93254,1001345121,1000675179,1002584197,1000392797,1000386274,1004433471,1002541005'
它可以包含1000名以上的條目。現在我有表格TEMP_HI(ID VARCHAR2(200))
,我想分割每個由逗號分隔的條目,並將其插入表TEMP_HI中。 我該怎麼做?
你需要使用一種編程語言來做到這一點 – 2014-12-02 10:32:15
我是PL SQL新手,你能告訴我該怎麼做嗎? – 2014-12-02 10:34:27
'PL/SQL'不一定是必需的。看看我的答案。 – 2014-12-02 10:53:47