473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

embedded sql application fails on Suse (powerPC)

Hi,

i get the following error when running an embedded sql application on
Suse (powerPC):

SQL4903N The length of parameter "runtime_pid" of function
"sqlastrt_trusted"
is not valid.

Iam running against DB2 V9.1

Is this a known issue ?

Jun 11 '07 #1
3 2344
Please shaw us your Procedure and the way to call the procedure.
I suspect that the data type mismatch reside in this isuue.

Jun 11 '07 #2
On Jun 12, 2:08 am, Tonkuma <tonk...@jp.ibm.comwrote:
Please shaw us your Procedure and the way to call the procedure.
I suspect that the data type mismatch reside in this isuue.
This same code works on other platforms. Also this is part of a bigger
application. If i write the exact same code as a small test
application it works fine. I cannot find the difference.

int db2esqlConnect(const char *databaseEnv,
const char *username,
const char *password,
ERRCB *ep)
{
EXEC SQL BEGIN DECLARE SECTION;
char dbsql[10];
char usersql[20];
char passwdsql[20];
short numTables;
EXEC SQL END DECLARE SECTION;
int rc;
long prev_code = 0;

strcpy(dbsql, databaseEnv);
memset(&sqlca, 0, sizeof(struct sqlca));
/* connect to database */

if (username && *username && password && *password) {
strcpy(usersql, username);
strcpy(passwdsql, password);
EXEC SQL CONNECT TO :dbsql USER :usersql USING :passwdsql;
}
else {
EXEC SQL CONNECT TO :dbsql;
}

if (SQLCODE == 0) {
strncpy(Sversion_, sqlca.sqlerrp, 8);
Sversion_[8] = '\0';
strcpy(dbname, databaseEnv);
}
else
{
return FALSE;
}
}

Jun 12 '07 #3
Vivek wrote:
On Jun 12, 2:08 am, Tonkuma <tonk...@jp.ibm.comwrote:
>Please shaw us your Procedure and the way to call the procedure.
I suspect that the data type mismatch reside in this isuue.
This same code works on other platforms. Also this is part of a bigger
application. If i write the exact same code as a small test
application it works fine. I cannot find the difference.

int db2esqlConnect(const char *databaseEnv,
const char *username,
const char *password,
ERRCB *ep)
{
EXEC SQL BEGIN DECLARE SECTION;
char dbsql[10];
char usersql[20];
char passwdsql[20];
short numTables;
EXEC SQL END DECLARE SECTION;
int rc;
I recommend that you initialize _all_ variables at declaration.
long prev_code = 0;

strcpy(dbsql, databaseEnv);
You should use "strncpy" here to prevent buffer overflows.
memset(&sqlca, 0, sizeof(struct sqlca));
/* connect to database */

if (username && *username && password && *password) {
strcpy(usersql, username);
strcpy(passwdsql, password);
strncpy
EXEC SQL CONNECT TO :dbsql USER :usersql USING :passwdsql;
}
else {
EXEC SQL CONNECT TO :dbsql;
}

if (SQLCODE == 0) {
strncpy(Sversion_, sqlca.sqlerrp, 8);
What's the definition of Sversion? It does not show up above.
Sversion_[8] = '\0';
strcpy(dbname, databaseEnv);
}
else
{
return FALSE;
}
}
Other than the above comments, you haven't shown us the code of the
procedure and how you invoke it - just some embedded SQL code that connects
to a database.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jun 26 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mike | last post by:
I've spent a couple of days on this and I'm to the "bang-my-head 'gainst the monitor and babble in tongues" mode. First - SuSE Pro 9.3, Linux 2.6.11.4-21.7, Apache 2.0.53, PHP 4.3.10 I have...
3
by: Fabio Garufi | last post by:
Hi, all, I built the fftw-3.0.1-fma on a LynxOS 4.0 running on a board equipped with a PowerPC G4 7457. To compile it I had to slightly modify the configure script to use the -fvec instead of...
16
by: Marina | last post by:
Hi, I am trying to find the minimum security settings to allow a windows control embedded in IE have full trust. If I give the entire Intranet zone full trust, this works. However, this is...
0
by: kirby | last post by:
My db2 environement is as follows: Suse Linux on powerpc, with 64-bit DB2, 8.1 fixpack 8a. Db2 is installed on local drives, and all tablespaces/containers are on some some network attached...
10
by: Ashish | last post by:
Hi I am new to C I have one query.... can i store a value on a given memory location in C say for example i want to store an integer value 10 at location 0X100000. how can i do it in C... if...
7
by: wardm | last post by:
I have created a Dict object in a C++ App that calls (embedded) Python functions. The Dict is to be used to pass variable data between the C++ App and the python functions. However I cannot get...
0
by: Carl Douglas | last post by:
Hi Python fans, I am developing a DLL that is loaded by a host application on windows. I'm using python 2.5. My DLL uses an embedded python interpreter which can access the host application...
2
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW...
1
by: NeophyteDK | last post by:
hello Im trying to cross compile php for powerpc on Win XP with MinGW. I have succesfully cc'ed Lighttpd, with the same toochain. i use the command line: CC=powerpc-linux-gcc AR=powerpc-linux-ar...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.