dbTalk Databases Forums  

Getting input to SQLCHAR

mailing.database.myodbc mailing.database.myodbc


Discuss Getting input to SQLCHAR in the mailing.database.myodbc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
stainboy
 
Posts: n/a

Default 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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.