468,119 Members | 2,060 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

sqltypes.h compile error?

Hi all!
I used google, but I found nothing.
I have got smiple code:

#include <sql.h>
int main()
{
}

when I compiled this in Borland C++ 5.5.1 for Win32 Copyright (c) 1993,
2000 Borland, i receive errors:
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 274:
Declaration missing ;
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 275:
Declaration missing ;
Error E2238 c:\Program Files\Borland\Bcc55\include\sqltypes.h 276:
Multiple declaration for 'WORD'
Error E2344 c:\Program Files\Borland\Bcc55\include\sqltypes.h 275:
Earlier declaration of 'WORD'
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 276:
Declaration missing ;
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 277:
Declaration missing ;
Warning W8070 why.c 5: Function should return a value in function main
*** 6 errors in Compile ***

Are they errors in sqltypes.h ?

Any ideas?

greetings
Grzesiek

change -> grzesiocz
Nov 12 '05 #1
8 5464
Vavel wrote:
Hi all!
I used google, but I found nothing.
I have got smiple code:

#include <sql.h>
int main()
{
}

when I compiled this in Borland C++ 5.5.1 for Win32 Copyright (c) 1993,
2000 Borland, i receive errors:
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 274:
Declaration missing ;
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 275:
Declaration missing ;
Error E2238 c:\Program Files\Borland\Bcc55\include\sqltypes.h 276:
Multiple declaration for 'WORD'
Error E2344 c:\Program Files\Borland\Bcc55\include\sqltypes.h 275:
Earlier declaration of 'WORD'
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 276:
Declaration missing ;
Error E2139 c:\Program Files\Borland\Bcc55\include\sqltypes.h 277:
Declaration missing ;
Warning W8070 why.c 5: Function should return a value in function main
*** 6 errors in Compile ***

Are they errors in sqltypes.h ?


I'd say yes. Apparently the header file is not self-containing and you need
to include some other header files first.

But you should really ask Borland and not IBM because you are trying to
compile a header file that comes with "Bcc55" and not one that came with
DB2 (see the path shown in the error messages).

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
Hi!
Thanks to your reply.
But you should really ask Borland and not IBM because you are trying to
compile a header file that comes with "Bcc55" and not one that came with
DB2 (see the path shown in the error messages).


I know that it is NTG but... I want to execute some instructions that is
used to adding audio and image to ibm db2, so I wrote it here...

Instructions are following:

EXEC SQL BEGIN DECLARE SECTION;
long hvInt_Stor;
long hvExt_Stor;
EXEC SQL END DECLARE SECTION;
hvInt_Stor = MMDB_STORAGE_TYPE_INTERNAL;
hvExt_Stor = MMDB_STORAGE_TYPE_EXTERNAL;
EXEC SQL INSERT INTO EMPLOYEE VALUES(
'128557', /*id*/
'Anita Jones', /*name*/
DB2IMAGE( /*Image Extender UDF*/
CURRENT SERVER, /*database server name in*/
/CURRENT SERVER register*/
'/employee/images/ajones.bmp' /*image source file*/
'ASIS', /*keep the image format*/
:hvInt_Stor, /*store image in DB as BLOB*/
'Anita''s picture'), /*comment*/
DB2AUDIO( /*Audio Extender UDF*/
CURRENT SERVER, /*database server name in*/
/*CURRENT SERVER register*/
'/employee/sounds/ajones.wav', /*audio source file*/
'WAVE', /* audio format */
:hvExt_Stor, /*retain content in server file*/
'Anita''s voice') /*comment*/
);

so I have used Google and I've found
http://tinyurl.com/4rc3b
but if I write like this
#include <stdio.h>
#include <stdlib.h>
#include "sql.h"
main()
{
}
I would receive the same error :-(
So what to do?Other language?other compilator or other way?

Vavel
Nov 12 '05 #3
Hi!
Thanks to your reply.
But you should really ask Borland and not IBM because you are trying to
compile a header file that comes with "Bcc55" and not one that came with
DB2 (see the path shown in the error messages).


I know that it is NTG but... I want to execute some instructions that is
used to adding audio and image to ibm db2, so I wrote it here...

Instructions are following:

EXEC SQL BEGIN DECLARE SECTION;
long hvInt_Stor;
long hvExt_Stor;
EXEC SQL END DECLARE SECTION;
hvInt_Stor = MMDB_STORAGE_TYPE_INTERNAL;
hvExt_Stor = MMDB_STORAGE_TYPE_EXTERNAL;
EXEC SQL INSERT INTO EMPLOYEE VALUES(
'128557', /*id*/
'Anita Jones', /*name*/
DB2IMAGE( /*Image Extender UDF*/
CURRENT SERVER, /*database server name in*/
/CURRENT SERVER register*/
'/employee/images/ajones.bmp' /*image source file*/
'ASIS', /*keep the image format*/
:hvInt_Stor, /*store image in DB as BLOB*/
'Anita''s picture'), /*comment*/
DB2AUDIO( /*Audio Extender UDF*/
CURRENT SERVER, /*database server name in*/
/*CURRENT SERVER register*/
'/employee/sounds/ajones.wav', /*audio source file*/
'WAVE', /* audio format */
:hvExt_Stor, /*retain content in server file*/
'Anita''s voice') /*comment*/
);

so I have used Google and I've found
http://tinyurl.com/4rc3b
but if I write like this
#include <stdio.h>
#include <stdlib.h>
#include "sql.h"
main()
{
/* my instructions*/
}
I would receive the same error :-(
So what to do?Other language?other compilator or other way?

Vavel

Nov 12 '05 #4
In article <cs**********@inews.gazeta.pl>, Vavel (ch****@poczta.fm)
says...
}
I would receive the same error :-(
So what to do?Other language?other compilator or other way?

Vavel


My guess is that you need to put the db2 include directory in front
of the bcc55 include directory when compiling.
Nov 12 '05 #5
Vavel wrote:
But you should really ask Borland and not IBM because you are trying to
compile a header file that comes with "Bcc55" and not one that came with
DB2 (see the path shown in the error messages).


I know that it is NTG but... I want to execute some instructions that is
used to adding audio and image to ibm db2, so I wrote it here...

Instructions are following:

EXEC SQL BEGIN DECLARE SECTION;
long hvInt_Stor;
long hvExt_Stor;
EXEC SQL END DECLARE SECTION;
hvInt_Stor = MMDB_STORAGE_TYPE_INTERNAL;
hvExt_Stor = MMDB_STORAGE_TYPE_EXTERNAL;
EXEC SQL INSERT INTO EMPLOYEE VALUES(
'128557', /*id*/
'Anita Jones', /*name*/
DB2IMAGE( /*Image Extender UDF*/
CURRENT SERVER, /*database server name in*/
/CURRENT SERVER register*/
'/employee/images/ajones.bmp' /*image source file*/
'ASIS', /*keep the image format*/
:hvInt_Stor, /*store image in DB as BLOB*/
'Anita''s picture'), /*comment*/
DB2AUDIO( /*Audio Extender UDF*/
CURRENT SERVER, /*database server name in*/
/*CURRENT SERVER register*/
'/employee/sounds/ajones.wav', /*audio source file*/
'WAVE', /* audio format */
:hvExt_Stor, /*retain content in server file*/
'Anita''s voice') /*comment*/
);

so I have used Google and I've found
http://tinyurl.com/4rc3b
but if I write like this
#include <stdio.h>
#include <stdlib.h>
#include "sql.h"
main()
{
/* my instructions*/
}
I would receive the same error :-(
So what to do?Other language?other compilator or other way?


You are also getting the errors from the "bcc55" path? Then you'll have to
make sure that the DB2 header file is picked up by your compiler and not
the Borland one.

The "sql.h" says (usually) that the compiler will first look in all the
directories that you specified via the "-I" compiler option to find the
necessary header files, whereas <sql.h> would first search in the
system/compiler's directories. Did you specify the
proper ..../sqllib/include/ directory via -I for your compile options?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #6
Knut Stolze wrote:
You are also getting the errors from the "bcc55" path? Yes
Then you'll have to
make sure that the DB2 header file is picked up by your compiler and not
the Borland one.

Ok. So now I compile using IBM libraries and I've got another errors:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
why.c:
Error E2176 C:\Program Files\IBM\SQLLIB\include\sqlsystm.h 89: Too many
types in declaration
Error E2176 C:\Program Files\IBM\SQLLIB\include\sqlsystm.h 90: Too many
types in declaration
Warning W8070 why.c 5: Function should return a value in function main
*** 2 errors in Compile ***

Instructions are following:
#include "sql.h"
int main()
{
}

I don't know what to do. How to make some sql instructions inside
programme wrote in c language?My target is: to add Audio Voice and Video
to IBM DB2 using AIV extenders...

greetings
Vavel
Nov 12 '05 #7
Vavel wrote:
Knut Stolze wrote:
You are also getting the errors from the "bcc55" path?

Yes
Then you'll have to
make sure that the DB2 header file is picked up by your compiler and not
the Borland one.

Ok. So now I compile using IBM libraries and I've got another errors:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
why.c:
Error E2176 C:\Program Files\IBM\SQLLIB\include\sqlsystm.h 89: Too many
types in declaration
Error E2176 C:\Program Files\IBM\SQLLIB\include\sqlsystm.h 90: Too many
types in declaration
Warning W8070 why.c 5: Function should return a value in function main
*** 2 errors in Compile ***


If I look at my version of sqlsystm.h (V8.2 FP7), I see this close to line
90:

#ifndef SQL_BIGINT_TYPE
#ifdef db2Is64bit
#define SQL_BIGINT_TYPE long
#else
#define SQL_BIGINT_TYPE long long
#endif
#endif
#ifndef SQL_BIGUINT_TYPE
#ifdef db2Is64bit
#define SQL_BIGUINT_TYPE unsigned long
#else
#define SQL_BIGUINT_TYPE unsigned long long
#endif
#endif

typedef SQL_BIGINT_TYPE sqlint64;
typedef SQL_BIGUINT_TYPE sqluint64;
My guess would be that your compiler is a bit outdated and cannot handle the
data type "long long".

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #8
Knut Stolze wrote:
My guess would be that your compiler is a bit outdated and cannot handle the
data type "long long".

Thanks for help!
I'll try to use Micorosft Visual C++ ver.6 Maybe this sompiler will cope
with my problem.
Thank you once again.
Vavel
Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mike Albanese | last post: by
5 posts views Thread by Carmine Cairo | last post: by
5 posts views Thread by Brice Prunier | last post: by
10 posts views Thread by Chris LaJoie | last post: by
6 posts views Thread by Thomas Connolly | last post: by
2 posts views Thread by BruceWho | last post: by
14 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.