Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

RE: MaxDB fetch into problem with concatenated data in oracle mode with emb: msg#00249

db.maxdb

Subject: RE: MaxDB fetch into problem with concatenated data in oracle mode with embedded SQL statment in C/C++ programs (correction)

Hi Elbertus,

Change the procedure ObtenerOcupaciones() in PruebaDynamic.cpc as
follows:

int ObtenerOcupaciones(void)
{
EXEC SQL BEGIN DECLARE SECTION;

char query[200];
char query_out[1000];

EXEC SQL END DECLARE SECTION;

SQLDA *outda;

strcpy (query,"select rpad(to_char(cod_programa),10,' ') || ");
strcat (query,"rpad(rtrim(tabla,' '),100) || ");
strcat (query,"rpad(to_char(orden),10,' ') ");
strcat (query,"from guf_ocupaciones");

printf("query (%s)\n",query);

exec sql prepare s_cursor from :query;
printf("perpare (%d)\n",sqlca.sqlcode);

exec sql declare Cursor_Ocupaciones cursor for s_cursor;
printf("declare (%d)\n",sqlca.sqlcode);

exec sql open Cursor_Ocupaciones;
printf("open (%d)\n",sqlca.sqlcode);

outda = sqlald(1, 128, 128);
outda->V[0] = (char *) &query_out;
outda->L[0] = sizeof(query_out);
outda->T[0] = SQL_ORA_CHAR;

exec sql fetch Cursor_Ocupaciones using descriptor outda;
printf("fetch 1 (%d)\n",sqlca.sqlcode);

if(!sqlca.sqlcode)
{
while(!sqlca.sqlcode)
{
printf("query_out: (%.*s)\n",sizeof(query_out),query_out);

exec sql fetch Cursor_Ocupaciones using descriptor outda;
if(sqlca.sqlcode) printf("fetch 2 (%d)\n",sqlca.sqlcode);
}
}

exec sql close Cursor_Ocupaciones;
printf("close (%d)\n",sqlca.sqlcode);

sqlclu(outda);

return 0;
}

This should fix your core dump problem.

Regards,

Thomas Simenec
SAP Labs Berlin

-----Original Message-----
From: Elbertus Lochtenberg [mailto:barry@xxxxxxxxxxxxx]
Sent: Donnerstag, 30. Dezember 2004 14:42
To: Simenec, Thomas
Subject: RE: MaxDB fetch into problem with concatenated data in oracle
mode with embedded SQL statment in C/C++ programs (correction)

Hi Thomas,

Sorry I have to tell you that after eliminating some obsolete code from
the sources of the test programs everything seems to work fine in the
static and dynamic version (the last and correct versions I send you in
a previous mail).

The only pending problem seems to be the last byte in the output buffer
that is initialized by ORACLE with a NULL character and with MaxDB with
a blank in where you contacted me fore.

Best regards,

Elbertus Lochtenberg

-----Mensaje original-----
De: Simenec, Thomas [mailto:thomas.simenec@xxxxxxx]
Enviado el: jueves, 30 de diciembre de 2004 13:52
Para: Elbertus Lochtenberg
CC: maxdb@xxxxxxxxxxxxxxx
Asunto: RE: MaxDB fetch into problem with concatenated data in oracle
mode with embedded SQL statment in C/C++ programs (correction)

Hi,

Please send me your Precompiler program for analysis.

Regards,

Thomas Simenec
SAP Labs Berlin

-----Original Message-----
From: Elbertus Lochtenberg [mailto:barry@xxxxxxxxxxxxx]
Sent: Donnerstag, 30. Dezember 2004 13:33
To: maxdb@xxxxxxxxxxxxxxx
Subject: MaxDB fetch into problem with concatenated data in oracle mode
with embedded SQL statment in C/C++ programs (correction)

Dear Reader,

After making some tests with the same program and ORACLE, I came to the
conclusion that the concatenated output of MaxDB is similar.

The difference is that in the ORACLE case the output buffer is filled up
with blanks up to the end -1. In the last byte ORACLE puts a NULL. With
MaxDB the output buffer is filled up to the end with blanks and the byte
(output buffer length+1) seems to contain the character "@" as it is the
last variable on the stack. I suppose that this character depend of what
the memory value is on this point

However is seems that MaxDB is not putting the NULL value at the end of
the output buffer, the prove is that if I define another variable on the
stack, following the output buffer host variable and filled with NULLs,
this "@" character is not shown anymore in the output buffer.

Any way there is something different between the output buffer update
between ORACLE and MaxDB concerning the last byte, which in the ORACLE
case is filled with a NULL character, what isn't the case working with
MaxDB in ORCALE mode.

Best regards,

Elbertus Lochtenberg
Project Manager
Teleserver S.A.





--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/maxdb?unsub=gcdm-maxdb@xxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo