Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
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.

Contains clause in query giving trouble

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


    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,858 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