Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Contains clause in query giving trouble

  • 11-03-2014 05:34PM
    #1
    Registered Users, Registered Users 2 Posts: 5,763 ✭✭✭


    Im running the following query to use the CONTAINS clause in my database table.
    printf "Use ourdb_1_1\ngo\nSelect count(*) from persons_list where Rec_count=0 AND text LIKE '%Profile id%'\ngo\nexit" | isql -Usa -Psybase11
    
    bash: printf: `P': invalid format character
    
    

    I cant understand why it gives the error (doesnt like the P in Profile id). Maybe this is something obvious but im stumped :mad:


Comments

  • Technology & Internet Moderators Posts: 28,863 Mod ✭✭✭✭oscarBravo


    The printf command is interpreting the %P as a format character. You need to "escape" the percentage signs by doubling them up: "... LIKE '%%Profile id%%'\ngo..."


Advertisement