Getting input to SQLCHAR -
12-11-2007
, 02:44 PM
Hello, I'm a lamer in programming and i have this problem in my odbc
interface.
I would like to get input from keybord and send it as a parameter in
querry. This is part of my code and function i would like to use:
RETCODE get_char_input(SQLCHAR *character)
{
char ch_input[10];
printf("Enter the order ID number: ");
scanf("%s", ch_input);
character = ch_input; // here is error because i dont know how to
make
conversion between SQLCHAR* and char*
return 0;
}
SQLCHAR customerid;
printf("\n Choose the customer by giving his or her ID:");
get_char_input( &customerid );
printf("customerID: %s", customerid);
char QuerryShowChosenCustomer[512] =
{"SELECT customerid, companyname
FROM customers
WHERE customerid = ?"};
statement_handle =
statement(connection_handle, statement_handle,
QuerryShowChosenCustomer, customerid);
Can you give ma some suggestion how i should solve this problem
Thank you very much for any help
Regards.
Jakub P. |