By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,287 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,287 IT Pros & Developers. It's quick & easy.

the USER

P: n/a
Sorry if I disturb this ng but i need to someone because I'm cry !

For my problem, and now I think for my .... i don't know I try tu put in C
program this peace of code, after the connect !

EXEC SQL BEGIN DECLARE SECTION;
char UserOfDb2 [255];
EXEC SQL END DECLARE SECTION;
......
......
exec sql select user into :UserOfDb2 from sysibm.sysdummy1 ;
fprintf(pfFileLog,"\n-%d- CONNNESIONE CON
L'UTENTE[%s]\n",__LINE__,UserOfDb2 );

But the program goes, every time in coredump ??!??!!

someone can help me ?

which is the type of data of user in db2 ? For example in oracle is a
varchar2(30) !!

regards
sergio


Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Huh ???

"eap90210" <ea******@yahoo.it> wrote in message
news:d6***********@stargate1.inet.it...
Sorry if I disturb this ng but i need to someone because I'm cry !

For my problem, and now I think for my .... i don't know I try tu put in C
program this peace of code, after the connect !

EXEC SQL BEGIN DECLARE SECTION;
char UserOfDb2 [255];
EXEC SQL END DECLARE SECTION;
......
......
exec sql select user into :UserOfDb2 from sysibm.sysdummy1 ;
fprintf(pfFileLog,"\n-%d- CONNNESIONE CON
L'UTENTE[%s]\n",__LINE__,UserOfDb2 );

But the program goes, every time in coredump ??!??!!

someone can help me ?

which is the type of data of user in db2 ? For example in oracle is a
varchar2(30) !!

regards
sergio

Nov 12 '05 #2

P: n/a
eap90210 wrote:
Sorry if I disturb this ng but i need to someone because I'm cry !

For my problem, and now I think for my .... i don't know I try tu put in C
program this peace of code, after the connect !

EXEC SQL BEGIN DECLARE SECTION;
char UserOfDb2 [255];
EXEC SQL END DECLARE SECTION;
......
......
exec sql select user into :UserOfDb2 from sysibm.sysdummy1 ;
fprintf(pfFileLog,"\n-%d- CONNNESIONE CON
L'UTENTE[%s]\n",__LINE__,UserOfDb2 );

But the program goes, every time in coredump ??!??!!

someone can help me ?

which is the type of data of user in db2 ? For example in oracle is a
varchar2(30) !!

regards
sergio


Instead of asking humans on newsgroup - you should ask DB2 - it knows better:

D:\Working>db2 describe select user from sysibm.sysdummy1

SQLDA Information

sqldaid : SQLDA sqldabc: 896 sqln: 20 sqld: 1

Column Information

sqltype sqllen sqlname.data sqlname.length
-------------------- ------ ------------------------------ --------------
448 VARCHAR 128 1 1
Jan M. Nelken
Nov 12 '05 #3

P: n/a
BEST THANKS for the patiance

I'm sorry for my ignorance but I see that user is define to 128! and I think
that to declare a variabile at 255 it was sufficiente but it no true, and
for this reason I ask to NG.

I don't want to disturb anybody so try to understand.

always thanks for your help

regards
Sergio
"Jan M. Nelken" <Un**********@Invalid.Domain> ha scritto nel messaggio
news:42********@news1.prserv.net...
eap90210 wrote:
Sorry if I disturb this ng but i need to someone because I'm cry !

For my problem, and now I think for my .... i don't know I try tu put in
C program this peace of code, after the connect !

EXEC SQL BEGIN DECLARE SECTION;
char UserOfDb2 [255];
EXEC SQL END DECLARE SECTION;
......
......
exec sql select user into :UserOfDb2 from sysibm.sysdummy1 ;
fprintf(pfFileLog,"\n-%d- CONNNESIONE CON
L'UTENTE[%s]\n",__LINE__,UserOfDb2 );

But the program goes, every time in coredump ??!??!!

someone can help me ?

which is the type of data of user in db2 ? For example in oracle is a
varchar2(30) !!

regards
sergio


Instead of asking humans on newsgroup - you should ask DB2 - it knows
better:

D:\Working>db2 describe select user from sysibm.sysdummy1

SQLDA Information

sqldaid : SQLDA sqldabc: 896 sqln: 20 sqld: 1

Column Information

sqltype sqllen sqlname.data
sqlname.length
-------------------- ------ ------------------------------ --------------
448 VARCHAR 128 1
1
Jan M. Nelken

Nov 12 '05 #4

P: n/a
The data is VARCHAR, your declaration isn't. Review the programming guide
for how to define a VARCHAR in C.

"eap90210" <ea******@yahoo.it> wrote in message
news:d6***********@stargate1.inet.it...
BEST THANKS for the patiance

I'm sorry for my ignorance but I see that user is define to 128! and I
think that to declare a variabile at 255 it was sufficiente but it no
true, and for this reason I ask to NG.

I don't want to disturb anybody so try to understand.

always thanks for your help

regards
Sergio
"Jan M. Nelken" <Un**********@Invalid.Domain> ha scritto nel messaggio
news:42********@news1.prserv.net...
eap90210 wrote:
Sorry if I disturb this ng but i need to someone because I'm cry !

For my problem, and now I think for my .... i don't know I try tu put in
C program this peace of code, after the connect !

EXEC SQL BEGIN DECLARE SECTION;
char UserOfDb2 [255];
EXEC SQL END DECLARE SECTION;
......
......
exec sql select user into :UserOfDb2 from sysibm.sysdummy1 ;
fprintf(pfFileLog,"\n-%d- CONNNESIONE CON
L'UTENTE[%s]\n",__LINE__,UserOfDb2 );

But the program goes, every time in coredump ??!??!!

someone can help me ?

which is the type of data of user in db2 ? For example in oracle is a
varchar2(30) !!

regards
sergio


Instead of asking humans on newsgroup - you should ask DB2 - it knows
better:

D:\Working>db2 describe select user from sysibm.sysdummy1

SQLDA Information

sqldaid : SQLDA sqldabc: 896 sqln: 20 sqld: 1

Column Information

sqltype sqllen sqlname.data sqlname.length
-------------------- ------ ------------------------------ --------------
448 VARCHAR 128 1 1
Jan M. Nelken


Nov 12 '05 #5

P: n/a
Mark Yudkin wrote:
The data is VARCHAR, your declaration isn't. Review the programming guide
for how to define a VARCHAR in C.


The declaration is quite fine.

As to why the program segfaults, the information is not helpful at all. Do
you (OP) know exactly at which line of the code the segfault occurs? Have
you run it through a debugger?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #6

P: n/a
Knut Stolze wrote:
Mark Yudkin wrote:

The data is VARCHAR, your declaration isn't. Review the programming guide
for how to define a VARCHAR in C.

The declaration is quite fine.

As to why the program segfaults, the information is not helpful at all. Do
you (OP) know exactly at which line of the code the segfault occurs? Have
you run it through a debugger?


Yes, perhaps you could post a backtrace (or at least the part that
matters). I know this is a bit offtopic, but hey, it doesn't hurt
anyone, does it.

-R-
Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.