You have the right idea, the selection from the inserted selectInput is stored in input$ciclo. But in your query it's inside quotes so it's just a string. Use paste() to access the string directly.
Note that because you control the options in the selectInput it's generally safe to send the results into a query, but that you should consider using a more safe method such as DBI::sqlInterpolate(). (I'm not familiar with sqldf() so not sure what the analogue there would be.)