Using sqlda structures...
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I am hoping someone out there can help me. I am trying to use the dynamic SQL structures in ESQL/C and am getting very frustrated with the Informix manuals. As usual, either the demo code they provide seg faults or they have contradictory examples or both. Can some one enlighten me with either some real code snippets or examples. Thanks. Bryan Hughes Healtheon Corporation bryan@healtheon.com
Bryan Hughes wrote: > > I am hoping someone out there can help me. I am trying to use the dynamic > SQL structures in ESQL/C and am getting very frustrated with the Informix > manuals. As usual, either the demo code they provide seg faults or they > have contradictory examples or both. Can some one enlighten me with either > some real code snippets or examples. > > Thanks. > > Bryan Hughes > Healtheon Corporation > > bryan@healtheon.com Hi, I think, as long as you use the described SQL data types, the demo file "unload.ec" must work properly. Best regards, -- Stefan Weideneder Phone: +49 89/3565478-2 --------------- --- Fax: +49 89/3565478-3 ------------- ------ mailto:/stefan@weideneder.de --- -------- http://www.weideneder.de -----
Hi, What is the objective of the code. Accordingly , I could try to send you some test app's. PK. Bryan Hughes wrote: > I am hoping someone out there can help me. I am trying to use the dynamic > SQL structures in ESQL/C and am getting very frustrated with the Informix > manuals. As usual, either the demo code they provide seg faults or they > have contradictory examples or both. Can some one enlighten me with either > some real code snippets or examples. > > Thanks. > > Bryan Hughes > Healtheon Corporation > > bryan@healtheon.com
Actually I found my problem. I created a C++ class the fetches all the rows into a big buffer. This class needed to be able to handle small selects as well as massive ones very quickly. The manuals hint to the correct solution which is to allocate large blocks of memory and word align the pointers of each column based upon the data types into the big buffer. The problem I was having was when I would try to access the data I was receiving a SIGBUS bus error due to the fact that some of the columns where not indeed word aligned even though I was using the function rtypalign(). There is a bug in the function that does not properly align SMALLINTS (aka 2 byte shorts). Sometimes it would align them in the middle of the word. The solution is that after each call to rtypalign() I do another check to make sure it is on a word boundary. After doing this everything worked. OS: Solaris 2.5.1 Online: 7.24 UC5 Compiler: SparcWorks 4.0 Thank you. Cheers, Bryan Hughes Healtheon bryan@healtheon.com ============================================================= "Imagination is the one weapon in the war against reality." -- Jules de Gaultier ============================================================= Pradeep Kutty wrote in message <36F6549F.97FEF568@informix.com>... >Hi, > What is the objective of the code. Accordingly , I could try to send you >some test app's. > >PK. > > >Bryan Hughes wrote: > >> I am hoping someone out there can help me. I am trying to use the dynamic >> SQL structures in ESQL/C and am getting very frustrated with the Informix >> manuals. As usual, either the demo code they provide seg faults or they >> have contradictory examples or both. Can some one enlighten me with either >> some real code snippets or examples. >> >> Thanks. >> >> Bryan Hughes >> Healtheon Corporation >> >> bryan@healtheon.com >