PRO*C and sqlca.sqlcode PROBLEM...
Date: Wed, 15 Mar 1995 18:01:48 GMT
Message-ID: <KEN.95Mar15110148_at_stealth.photcan.com>
Help! Help! Help!
I am having a real pain-in-the-butt problem using PRO*C under Windows. In a PRO*C module within a Windows program, the program crashes on a specific line of code every time. The GPF occurs (Address of GPF #0004:1a53) in a function in which I am examining the "sqlca.sqlcode" variable.
Here is the context in which I am using the "sqlca.sqlcode":
- cut here ------------------------------ EXEC SQL DECLARE getwell CURSOR FOR SELECT operator, status_date, onprod, crstatus, plot_symbol, field, fldpoolwild, spud_date, rigrel, prov_st, drillers_td, tvd, ground_elevation, kb_elevation, well_name, n.latitude, n.longitude FROM well_hdr w, nodes n WHERE uwi = :u AND w.base_node_id = n.node_id ;
EXEC SQL OPEN getwell; if( sqlca.sqlcode < 0 ) /* <<<<<---- ERROR HERE */ return fetch_oracle_error(); EXEC SQL FETCH getwell INTO
:operator_code, :statdate, :onprod, :status_code, :plot_symbol,
:field_code, :pool_code, :spudate, :rrlsdte, :prov_code, :td, :tvd,
:grd, :kb, :wellname,
:lat, :lon ;
------------------------------ cut here ------------------------------
This variable is referenced elswhere in the same source file without problems. However in this one function, any attempt to reference the "sqlca.sqlcode" variable crahses the program. I can examine this variable from within my debugger without a problem. If I comment out the offending line, the same GPF occurs a few lines later when the "sqlca.sqlcode" variable is referenced again.
When the same program is compiled under Unix, the codes works fine.
This program is running on a Windows machine that is connected to Novell and Unix. The Oracle server is on a unix machine and the server is Version 6.
Thanks,
Ken Stauffer.
Kenneth Stauffer ken_at_photcan.com Photon Systems Ltd. (403) 750-3535 Calgary, Alta. CANADA Fax: (403) 750-3536 ----------------------------------------------------------------------Received on Wed Mar 15 1995 - 19:01:48 CET