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

Contains clause in query giving trouble

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


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