Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculated SQL text / ODBC Import Script Step - Error

Featured Replies

I have a script that collects the last update date of a set of records. I set a local variable to it ($LastImport).

 

  Set Variable $LastImport  =xyz_0::MAX_LAST_UPDATE

 

I setup a Import Records script step that goes out to an ODBC database (Oracle 10g) to bring into a temp table only those records that are >= than the last update date.

 

   "SELECT * FROM xyz_LEVEL_0_DATA_V WHERE xyz_LEVEL_0_DATA_V.LAST_UPDATE_DATE >= " & $LastImport & ""

 

I get this error back:

 

    ODBC Error: [Oracle][ODBC][Ora] ORA-00936: missing expression

 

I have imported data from this Oracle database many times directly into tables but this is the first time I'm trying to filter down the import to make it execute faster (over 4,000,000 records to deal with )...

 

Any ideas?

 

Thanks

 

Scott

SQL will expect the $lastImport date to be in a certain format.  Chances are that it is not the format that you have in your FM file.  Check into that first and see how you can reformat the FM date into the SQL format that Oracle expects.

  • Author

This works fine:

 

"SELECT * FROM xyz_LEVEL_0_DATA_V WHERE xyz_LEVEL_0_DATA_V.LAST_UPDATE_DATE >= TRUNC(SYSDATE)-1"

 

The trick seems to properly indicate the variable in the calculated text.

  • Author

To help alleviate anyone else creating flat spot on their head from desk banging...

 

 

"SELECT * FROM xyz_LEVEL_0_DATA_V WHERE xyz_LEVEL_0_DATA_V.LAST_UPDATE_DATE > TO_DATE(" & $LastImport & ", 'MM/DD/YYYY')"

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.