Script to fetch data from BD