I have a .pc (proc program) with a function that should select from the database a student's email address and put it in a variable.

This works correctly, except everytime, the first email address is blank,...I have double checked this and there is an email address for this person. Am I missing something silly?'
Code: C
int getGoremalEmailAddress()
{
        printf("Campus ID<%s>\n",campus_id);
        login_oracle();
        EXEC SQL SELECT goremal_email_address
                 INTO :email_address
                 FROM goremal
                 WHERE goremal_pidm = :campus_id;
        email_address.arr[email_address.len] = '\0';
        printf("E_MAIL<%s>\n",email_address.arr);
        logout_oracle();
        return 1;
}

Outputs:
Campus ID<75799>
E_MAIL<>
Campus ID<2003142>
E_MAIL<kabdull1@test.edu>
Campus ID<2241834>
E_MAIL<iabramek@test.edu>

thanks in advance

Last edited by shabbir; 5Aug2006 at 14:32.. Reason: Code formating.