1

I am receiving the following error in Terminal when copy/pasting code from my code editor to Terminal:

mismatched input ')' expecting ( near 'VARCHAR' in primitive type specification

Here is the SQL code in question:

left outer join order_history b
ON CAST(substr(a.order_id__c, 2)AS VARCHAR) = CAST(b.order_id AS VARCHAR)

The reason I am using the "substr" clause is because there is a letter in front of the number I am trying to join with in one table:

e.g. P123456 and 123456

Dharman
  • 30,962
  • 25
  • 85
  • 135
user11031121
  • 19
  • 1
  • 2

1 Answers1

2

VARCHAR can be used in a CAST.

The error is because the length of VARCHAR isnt mentioned.

Sai Astro
  • 113
  • 1
  • 7