On a database level I am able to retrieve correct entries for the
contents of for example the User table.
However, when I attempt to do the same in our main program wI get some
garbage data.
I believe that it might because the entries are not null terminated.
The way I do null termination at the moment is this:
EXEC SQL FETCH c3 INTO :all_user;
EXEC SQL VAR all_user.user_name IS STRING(40);
EXEC SQL VAR all_user.user_email IS STRING(20);
EXEC SQL VAR all_user.user_role IS STRING(10);
Am I doing something wrong? Please advise.
struct ALL_USER
{
int user_id[100];
char user_name[100][40];
char user_email[100][20];
int role_id[100];
char user_role[100][10];
} all_user;
contents of for example the User table.
However, when I attempt to do the same in our main program wI get some
garbage data.
I believe that it might because the entries are not null terminated.
The way I do null termination at the moment is this:
EXEC SQL FETCH c3 INTO :all_user;
EXEC SQL VAR all_user.user_name IS STRING(40);
EXEC SQL VAR all_user.user_email IS STRING(20);
EXEC SQL VAR all_user.user_role IS STRING(10);
Am I doing something wrong? Please advise.
struct ALL_USER
{
int user_id[100];
char user_name[100][40];
char user_email[100][20];
int role_id[100];
char user_role[100][10];
} all_user;