• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Data source SQL error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data source SQL error

    Hello,
    I'm trying to add a vvin_virtual statement to SQL data source and I get "Invalid SQL statement" when I add the following to the data source. (WHERE vvin_virtual('TerrFilt',' 1+1=2', 'char', 30, NULL, 'true') My aim was to have an RPG program put the text for the where statement into the TerrFilt variable and to default to a statement that would include all records. If I type out the "Where" statement and eliminate the vvin_virtual part, it works fine. How can I see what the error is?
    Thanks,
    Bruce
    ?

  • #2
    Take a look at the Errors app to see the full SQL statement it's trying to run. I can't say for sure, but I suspect the problem may be that the string is being wrapped in quotes, in which case changing the 'true' parameter to 'false' should fix it.

    Comment


    • #3
      I believe it's because the vvIn_Virtual is defined to wrap in quotes: vvin_virtual('TerrFilt',' 1+1=2', 'char', 30, NULL, 'true'). Changing it to false should fix the issue.

      Code:
      vvin_virtual(
        'TerrFilt',
        '1=1',
        'char',
        30,
        NULL,
        'false'
      )

      Comment


      • #4
        That fixed it.. Thanks!

        Comment

        Working...
        X