Connect to remote server using sftp with password define within command/script

I am trying to connect to remote server in hp-ux, using sftp command (using sftp username@ip and password ) able to connect to remote server but, in this case sftp prompt for password and user need to manually enter it.
I want sftp can read a password define in script or from file, so it can remotely fetch data from server without asking for password.

NOTE:- with my server no public private key define, no export command works, even sudo is not define

Facing error with -password option in sftp

sftp --password="password" "userid"@"servername"
                 ksh: 8: parameter not set 

Please suggest is there any optional command i can use to do the same.
In any case command/script should not prompt for password and get the data from remote server.even perl script is ok for me..:mad:

"interactive password authentication" means "password typed by a human being in realtime authentication" -- no substitutes for human are acceptable when a plaintext password is involved. sftp is designed to prevent what you are trying to do, because what you are trying to do is a very bad idea. It's nearly impossible to keep stored plaintext passwords safe. Passing it in as --password, for example, would proudly display your password to every user on the system...

You say public/private keys do not work? Take a look at file permissions in ~/.ssh/, ssh is very particular about them. Also try ssh -v -v to get a closer look at where it decides to give up. (ssh/scp/sftp are all the same protocol fundamentally.)