क्या आप इसे एसक्लप्लस में निष्पादित कर रहे हैं? एक्सट्रेक्ट एक XMLType इंस्टेंस देता है, और के अनुसार प्रदर्शित होता है। लंबा वेरिएबल, जो डिफ़ॉल्ट रूप से 80 है। यदि आप मान बढ़ाते हैं तो आप पूरा URL देख सकते हैं।
SQL> with x(contact_data) as (
select '<?xml version="1.0" encoding="UTF-8"?>
<service_orders count="1">
<service_order order_number="fakefakefake" id="fakefakefake">
<images count="2">
<image src="https://s3.amazonaws.com/some_subfolder/deeper/deeper_still/ever_deeper/really_big_long_url_goes_here"/>
</images>
</service_order>
</service_orders>' from dual
)
select
length(extract(xmltype(contact_data),'/service_orders/service_order/images/image/@src')) as url_length,
extract(xmltype(contact_data),'/service_orders/service_order/images/image/@src') as url
from
x;
URL_LENGTH
----------
URL
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
101
https://s3.amazonaws.com/some_subfolder/deeper/deeper_still/ever_deeper/really_b
लंबे चर के लिए मान बढ़ाने के बाद,
SQL> set long 120
SQL> with x(contact_data) as (
select '<?xml version="1.0" encoding="UTF-8"?>
<service_orders count="1">
<service_order order_number="fakefakefake" id="fakefakefake">
<images count="2">
<image src="https://s3.amazonaws.com/some_subfolder/deeper/deeper_still/ever_deeper/really_big_long_url_goes_here"/>
</images>
</service_order>
</service_orders>' from dual
)
select
length(extract(xmltype(contact_data),'/service_orders/service_order/images/image/@src')) as url_length,
extract(xmltype(contact_data),'/service_orders/service_order/images/image/@src') as url
from
x;
URL_LENGTH
----------
URL
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
101
https://s3.amazonaws.com/some_subfolder/deeper/deeper_still/ever_deeper/really_big_long_url_goes_here
आप XMLType को varchar2 में बदलने के लिए getStringVal फ़ंक्शन का उपयोग कर सकते हैं, जो लंबे चर पर निर्भर नहीं करता है।
SQL> set long 80
SQL> with x(contact_data) as (
select '<?xml version="1.0" encoding="UTF-8"?>
<service_orders count="1">
<service_order order_number="fakefakefake" id="fakefakefake">
<images count="2">
<image src="https://s3.amazonaws.com/some_subfolder/deeper/deeper_still/ever_deeper/really_big_long_url_goes_here"/>
</images>
</service_order>
</service_orders>' from dual
)
select
length(extract(xmltype(contact_data),'/service_orders/service_order/images/image/@src')) as url_length,
extract(xmltype(contact_data),'/service_orders/service_order/images/image/@src').getStringval() as url
from
x;
URL_LENGTH
----------
URL
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
101
https://s3.amazonaws.com/some_subfolder/deeper/deeper_still/ever_deeper/really_big_long_url_goes_here