ls via sftp

Hi to all!

I'm new to unix and I looking for a solution for a shell I'm developing.

In this shell I have a list of filename (get from a database).
For each filename I must connect to another server via sftp connection in order to verify if there is a file with that filename.

After the filename, I must check also the modified date of the file on the remote server, to choose If get the file or not (if it's newer than the last I get ).

I'm doing some test: I connect to the remote server via sftp but, for example, the ls -a doesn't work. Only the ls command without options works. So I didn't find a command to get the filename and the modified date.

I'm in difficulty because I didn't find a solution since today.
Thanks in advance to all.
Bye.

Check out this link.. http://www.unix.com/unix-dummies-questions-answers/197231-remote-server.html\#post302690513