1

I have the following query:

SELECT 'curl -s http://www.mde.operator.com/MRE/api?profile=CANCEL_AUTH&mode=assync-oneway&Auth='||json_extract_path_text(external_reference_id,'transactionIdAuth') + '&NUM=' + phone  FROM dbo.cancelled WHERE id like '%Auth%';

It will bring more than 60 thousands results, but the json is broken and I cannot manage to delete the broken lines.

Is there any way to skip the rows which shows any kind of errors?

Note: It isn't null rows.

I've already try:

json_extract_path_text(regexp_replace(event_properties,'\\\\.',''),'someValue')
1
  • Hi, anyone can give me a clue about this problem? Commented Feb 4, 2018 at 13:06

1 Answer 1

3

You can make them null rows though, by setting the null_if_invalid argument of the json_extract_path_text function to true.

Source: https://docs.aws.amazon.com/redshift/latest/dg/JSON_EXTRACT_PATH_TEXT.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.