Jump 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.

Passing the SQL LIKE Wildcard Into ExecuteSQL

Featured Replies

I'm attempting to do a search for a value that was entered by a user. They want to be able to enter in part of a project number and have the system look for it. I understand the LIKE operator and I can get it to work if I pass the argument of something like %12345% but I want to pass in something that looks like the following: wildcard plus value entered by user plus wildcard. 

I've tried the following (let me try this again with the right code):

Let     (
    [
    project_id = "%" & d_tmd_tmh::zd_time_dtl_prj_num & "%" ; 
    SQL = ExecuteSQL    ( 
                    "
                    SELECT a.\"__project_id\"
                    FROM \"d_prj\" a
                    WHERE a.\"zd_prj_number\" LIKE ?
                    "
                    ; "|" ; ¶  ; 
                    project_id
                    )
    ] ; 

    SQL

    )

I'm not getting an error. I'm just not getting any results. When I manually substitute the same value I am testing by changing it to this:

Let     (
    [
    project_id = "%12345%" ; 
    SQL = ExecuteSQL    ( 
                    "
                    SELECT a.\"__project_id\"
                    FROM \"d_prj\" a
                    WHERE a.\"zd_prj_number\" LIKE ?
                    "
                    ; "|" ; ¶  ; 
                    project_id
                    )
    ] ; 

    project_id

    )

It works.

Any pointers in the right direction would be appreciated.

 

Never mind...

I reran things and it now seems to be working. 

Edited by oakbridge
Posted wrong block of code

Create an account or sign in to comment

Important Information

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

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.