I am trying to filter out non-working URLs from my SQLite table using http_get methods. Here's what I attempted and the challenges I encountered:
1. Fetching Body Content:
I tried fetching the body content of some URLs using the http_get_bodymethod but encountered the following error:
Error: Get "http://emailer.sbicard.com/TrackableURL/Confirmation.html": dial tcp: lookup emailer.sbicard.com on 192.168.128.1:53: no such host
2. Filtering by Status Code:
To handle this issue, I decided to filter URLs based on their HTTP status code (e.g., 404). Here's the query I used:
select
iif(
response_status_code not between 200 and 299,
'An error happened!',
null
) as status,
response_body
from http_get("http://emailer.sbicard.com/TrackableURL/Confirmation.html");
However, this resulted in another error:
Error: SQL logic error
Steps to Reproduce:
Use the following URL: http://emailer.sbicard.com/TrackableURL/Confirmation.html
Run the query:
select
iif(
response_status_code not between 200 and 299,
'An error happened!',
null
) as status,
response_body
from http_get("http://emailer.sbicard.com/TrackableURL/Confirmation.html");
Expected Outcome:
A mechanism to identify and filter non-working URLs directly within SQL.
Actual Outcome:
Errors when trying to fetch or filter URLs.
Additional Information:
Any alternative approach or workaround to achieve this goal is welcome.
I am trying to filter out non-working URLs from my SQLite table using
http_get
methods. Here's what I attempted and the challenges I encountered:1. Fetching Body Content:
I tried fetching the body content of some URLs using the
http_get_body
method but encountered the following error:2. Filtering by Status Code:
To handle this issue, I decided to filter URLs based on their HTTP status code (e.g., 404). Here's the query I used:
However, this resulted in another error:
Error: SQL logic error
Steps to Reproduce:
http://emailer.sbicard.com/TrackableURL/Confirmation.html
Expected Outcome:
Actual Outcome:
Additional Information: