MySQL Forums
Forum List  »  Oracle

Pro*C to Mysql C API
Posted by: sean lo
Date: September 25, 2006 07:35PM

Hi,
 In recently, I have a mission for porting a source code from Pro*C. And the database is changed from Oracle to Mysql. The part of original source code(Pro*C) is shown below:

char i_id_no[13+1];
char accn_name[16+1], account[7+1], b_no[20+1], code_type[1];
int ii;

:
:
EXEC SQL DECLARE cursor_1 CURSOR FOR
SELECT accn_name, account, b_no, code_type
FROM ACCOUNTINFO
WHERE id_no = :i_id_no;
EXEC SQL OPEN cursor_1;

for(ii=0;
{
EXEC SQL FETCH cursor_1
INTO :accn_name, :account, :b_no, :code_type;
if (sqlca.sqlcode == 1403)
break;
:
:
}
:
:
EXEC SQL CLOSE cursor_1;

how could I make the same functions by mysql C API?

ps.
compiler: gcc
os: RH Linux AS 4.0
Mysql: 5.0

Options: ReplyQuote


Subject
Views
Written By
Posted
Pro*C to Mysql C API
11527
September 25, 2006 07:35PM
4231
February 26, 2007 02:28PM
3938
March 17, 2007 07:48PM
4081
June 13, 2007 07:24AM
3742
August 29, 2007 12:09AM
4213
October 27, 2007 05:00PM
5841
November 04, 2007 02:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.