Hi MySQLians! I have clearly mentioned my objective and the portion of work i have finished in my last mail. unfortunatly I don't find any reply for the past weekdays. Tii I have a trust, some one would take time to read this and sent me the suggestion to this list.
My current issue is from mysql_init function of MySQL in libmysql.lib library file. i.e., MYSQL* mysql_init(MYSQL *mysql), here actually this function require a parameter of MYSQL type NULL pointer and return back the MYSQL handle. >From COBOL, If I pass a NULL pointer to this function, it wouldn't agree with that >and produce runtime ERROR as "RDB010E: Interrupt trapped: Illegal storage access". The error says that, the function trying to access some invalid location other than MySQL - right? To resolve this I try to frame the MYSQL datatype NULL Pointer in COBOL, for that when I look the Datatype used in "mysql.h" header file, I found that it has number of decalarations using standard datatypes and some user defined data types. see below; typedef struct st_mysql { NET net; gptr connector_fd; char *host, *user, *passwd, *unix_socket, *server_version, *host_info, *info, *db; struct charset_info_st *charset; MYSQL_FIELD *fields; MEM_ROOT field_alloc; my_ulonglong affected_rows; my_ulonglong insert_id; my_ulonglong extra_info; unsigned long thread_id; unsigned long packet_length; unsigned int port, client_flag, server_capabilities; unsigned int protocol_version; unsigned int field_count; unsigned int server_status; unsigned int server_language; struct st_mysql_options options; enum mysql_status status; my_bool free_me; my_bool reconnect; char scramble_buff[9]; my_bool rpl_pivot; struct st_mysql * master, *next_slave; struct st_mysql* last_used_slave; struct st_mysql* last_used_con; } MYSQL; - I want to confirm that Is this much lengthy decalration of pointer needed? (OR) - We can just find the length and given it to COBOL pointer declaration? - Incase Length does the needs how to fix the length for each dataitem in C? If it succeed we all, as MySQL user can proud of put a mile stone for the support to COBOL. I would be wonder if any one read this clearly and suggest me. thanks Arun. --- Arunachalam <[EMAIL PROTECTED]> wrote: > Hi! > > I am trying to connect MySQL Database to COBOL. I have made it possible to some > stages by the > way > as follows; I have developed this under; > Client: Microsoft Windows 2000 Service pack 4. > CA-Realia COBOL Compiler Version 6.0.45 > Microsoft (R) Incremental Linker Version 6.00.8168 > MySQL server 4.0.17-max in SUSE Linux, > > MySQL provides set of C API to interact with MySQL database, to link the functions > to the > compiler > it provides a library file "libmysql.lib". COBOL has the External subroutine featurs > to CALL the > program written in other languages. > > When I try to link existing libmysql.lib file directly to the COBOL compiler it > won’t recognize > it. So I have prepared a COBOL compiler specific library file from the corresponding > libmysql.dll > file, in such a way. (The libmysql.dll I have used to create COBOL compiler specific > libmysql.lib > is gathered from Mysql 4.0.17-max-debug for windows, in my localhost) > > The COBOL compiler specific libmysql.lib is linked successfully to the COBOL > Compiler and I have > written some subroutine call to the function related to database connection from > COBOL. Such > that > mysql_init, mysql_real_connect, mysql_real_query, mysql_error and mysql_close. > > Here mysql_init requires a Null pointer argument and return the MySQL handle back. > > mysql_real_connect use that MySQL handle with additional arguments host name, > userid, password, > DB > name, port number, socket and flag to establish connection to the specified database. > > In my case mysql_init return a handle to mysql_real_connect, but instead of > connection > establishment to MySQL it shows runtime error in COBOL as > RDB0104E: Interrupt trapped: Illegal storage access. > > And store an error message in variable’s memory space as; > Unknown MySQL Server host > > So I want to have suggestion regarding the following; > 1. ‘Unknwon MySQL server host’ means it could not able to recognize the > particular Host what I > have mentioned or anything else? > 2. For the socket parameter in mysql_real_connect I have passed NULL value. Is it > correct? > 3. I have prepared the COBOL compiler specific libmysql.lib from libmysql.dll > which I have taken > from Windows as per the suggestions read from MySQL documentation. – is this correct? > 4. From my client machine i.e., windows platform I can able to connect to MySQL > by writing > simple > C program using that C APIs. Then why it does not work with COBOL? > > Thanks , any suggestion or help would be greatly appreciated. > > Arun. > > > ________________________________________________________________________ > Yahoo! India Mobile: Download the latest polyphonic ringtones. > Go to http://in.mobile.yahoo.com > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > ________________________________________________________________________ Yahoo! India Mobile: Download the latest polyphonic ringtones. Go to http://in.mobile.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]