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
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Contains clause in query giving trouble

Options
  • 11-03-2014 6:34pm
    #1
    Registered Users Posts: 5,531 ✭✭✭


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