Montag, 26. September 2016

@ => Unrecognized token in source text.

Error

At P:\My Roaming Documents\west-3325\west_3325.ps1:12 char:48
+ $Result=sqlplus SDM_DATA/SDM_DATA_DEV@D52PMDWH @ west_3325.sql
+                                                ~
Unrecognized token in source text.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnrecognizedToken

Problem

@ is a special character in PowerShell:
 @(...)                 Force an expression to be evaluated as an array

Solution

Use a tic to escape it:
$Result=sqlplus SDM_DATA/SDM_DATA_DEV@D52PMDWH `@ west_3325.sql

1 Kommentar: