here is my code where there i need to select records on the basis of some passd value and when no value is pass it should return all value . i dont want dynamic sql.i want to do this by conditionig query.

So if a user selects 1,2,3,..., N (N could in a thousands figure too), you would need to explicitly handle all of them in the case statment which is not the good way to do it.. but if the IDs are in specific pattern with respect to the input value, then you can simplify it using the logic proposed by Visakh. But if there is no pattern then it would be better to have the input (@vid) as ID value and use following query