473,395 Members | 1,452 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.

How to set application name using sqleseti api call

Hello, all.

DB2 ESE v9.1.3, Windows XP.

I want to change the application name of current connection.
I have wrote such SP using sqleseti api call:
---
#include <sqlenv.h>
#include <sqlcli1.h>
#include <sqlca.h>
#include <sqludf.h>

#ifdef __cplusplus
extern "C"
#endif
SQL_API_RC SQL_API_FN sappname (
SQLUDF_VARCHAR *appname
, SQLUDF_INTEGER *rc
, SQLUDF_NULLIND *appname_ind
, SQLUDF_NULLIND *rc_ind
, SQLUDF_TRAIL_ARGS
, struct sqludf_dbinfo *db_info
)
{
struct sqlca sqlca;
struct sqle_client_info clientAppInfo[1];

unsigned short dbAliasLen;
char dbAlias[SQL_ALIAS_SZ + 1];
/* specify db */
dbAliasLen = db_info->dbnamelen;
strcpy(dbAlias, db_info->dbname);
/* initialize clientAppInfo */
clientAppInfo[0].type = SQLE_CLIENT_INFO_APPLNAME;
clientAppInfo[0].pValue =
(char *)malloc(sizeof(char) *(SQLE_CLIENT_APPLNAME_MAX_LEN + 1));

/* set client app. name */
strcpy(clientAppInfo[0].pValue, appname);
clientAppInfo[0].length = strlen((char *)clientAppInfo[0].pValue);

/* set client information */
sqleseti(dbAliasLen, dbAlias, 1, &clientAppInfo[0], &sqlca);
*rc = sqlca.sqlcode;
*rc_ind = 0;
free(clientAppInfo[0].pValue);
return(0);
}
---
I have set the DB2_ALLOW_FENCED_SETI registry variable to YES.
But event I get sqlca.sqlcode=0 after sqleseti call, it seems that my
application name is unchanged after calling this SP.

My questions are:
Am I doing something wrong?
Is it possible at all to set application name?

Sincerely,
Mark Barinstein.

Sep 26 '07 #1
2 3003
On Sep 26, 11:59 am, 4.s...@mail.ru wrote:
Hello, all.

DB2 ESE v9.1.3, Windows XP.

I want to change the application name of current connection.
I have wrote such SP using sqleseti api call:
---
#include <sqlenv.h>
#include <sqlcli1.h>
#include <sqlca.h>
#include <sqludf.h>

#ifdef __cplusplus
extern "C"
#endif
SQL_API_RC SQL_API_FN sappname (
SQLUDF_VARCHAR *appname
, SQLUDF_INTEGER *rc
, SQLUDF_NULLIND *appname_ind
, SQLUDF_NULLIND *rc_ind
, SQLUDF_TRAIL_ARGS
, struct sqludf_dbinfo *db_info
)
{
struct sqlca sqlca;
struct sqle_client_info clientAppInfo[1];

unsigned short dbAliasLen;
char dbAlias[SQL_ALIAS_SZ + 1];
/* specify db */
dbAliasLen = db_info->dbnamelen;
strcpy(dbAlias, db_info->dbname);
/* initialize clientAppInfo */
clientAppInfo[0].type = SQLE_CLIENT_INFO_APPLNAME;
clientAppInfo[0].pValue =
(char *)malloc(sizeof(char) *(SQLE_CLIENT_APPLNAME_MAX_LEN + 1));

/* set client app. name */
strcpy(clientAppInfo[0].pValue, appname);
clientAppInfo[0].length = strlen((char *)clientAppInfo[0].pValue);

/* set client information */
sqleseti(dbAliasLen, dbAlias, 1, &clientAppInfo[0], &sqlca);
*rc = sqlca.sqlcode;
*rc_ind = 0;
free(clientAppInfo[0].pValue);
return(0);}

---
I have set the DB2_ALLOW_FENCED_SETI registry variable to YES.
But event I get sqlca.sqlcode=0 after sqleseti call, it seems that my
application name is unchanged after calling this SP.

My questions are:
Am I doing something wrong?
Is it possible at all to set application name?

Sincerely,
Mark Barinstein.
This procedure doesn't change the application name in v9.5 too.
Is it feature?
Or may be I have missed something?
Is it possible to write such procedure at all?

Sincerely,
Mark Barinstein.

Oct 10 '07 #2
On Oct 10, 10:28 am, 4.s...@mail.ru wrote:
On Sep 26, 11:59 am, 4.s...@mail.ru wrote:


Hello, all.
DB2 ESE v9.1.3, Windows XP.
I want to change the application name of current connection.
I have wrote such SP using sqleseti api call:
---
#include <sqlenv.h>
#include <sqlcli1.h>
#include <sqlca.h>
#include <sqludf.h>
#ifdef __cplusplus
extern "C"
#endif
SQL_API_RC SQL_API_FN sappname (
SQLUDF_VARCHAR *appname
, SQLUDF_INTEGER *rc
, SQLUDF_NULLIND *appname_ind
, SQLUDF_NULLIND *rc_ind
, SQLUDF_TRAIL_ARGS
, struct sqludf_dbinfo *db_info
)
{
struct sqlca sqlca;
struct sqle_client_info clientAppInfo[1];
unsigned short dbAliasLen;
char dbAlias[SQL_ALIAS_SZ + 1];
/* specify db */
dbAliasLen = db_info->dbnamelen;
strcpy(dbAlias, db_info->dbname);
/* initialize clientAppInfo */
clientAppInfo[0].type = SQLE_CLIENT_INFO_APPLNAME;
clientAppInfo[0].pValue =
(char *)malloc(sizeof(char) *(SQLE_CLIENT_APPLNAME_MAX_LEN + 1));
/* set client app. name */
strcpy(clientAppInfo[0].pValue, appname);
clientAppInfo[0].length = strlen((char *)clientAppInfo[0].pValue);
/* set client information */
sqleseti(dbAliasLen, dbAlias, 1, &clientAppInfo[0], &sqlca);
*rc = sqlca.sqlcode;
*rc_ind = 0;
free(clientAppInfo[0].pValue);
return(0);}
---
I have set the DB2_ALLOW_FENCED_SETI registry variable to YES.
But event I get sqlca.sqlcode=0 after sqleseti call, it seems that my
application name is unchanged after calling this SP.
My questions are:
Am I doing something wrong?
Is it possible at all to set application name?
Sincerely,
Mark Barinstein.

This procedure doesn't change the application name in v9.5 too.
Is it feature?
Or may be I have missed something?
Is it possible to write such procedure at all?

Sincerely,
Mark Barinstein.- Hide quoted text -

- Show quoted text -
Did you ever figure this out? we would also like to able to use this
feature for version DB2 8.1.10

Mark Thomas

Nov 8 '07 #3

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

Similar topics

10
by: gregory_may | last post by:
I have an application I created called "JpegViewer.exe". It simply loads a Jpeg file and displays in on the screen. It works great, in my lab. When I am using it at a customer site, things...
6
by: Janick | last post by:
Is there any possibility to override the application name shown using "db2 list applications" in the new Universal Driver. The default "db2jcchttp8443..." is not very meaningful. Regards -...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
4
by: news | last post by:
Not really sure if this is a javascript problem or C# - sorry if in wrong place. Modal Forms Question in Web Application I have two web forms: Form1 and Form2 Form1 calls Form2 using...
6
by: Ollie Riches | last post by:
I understand the use of Application.DoEvents() to process all outstanding messages on the message queue in a winforms application if you have long running process on the UI thread. But can anyone...
3
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
3
by: alessandro menchini | last post by:
Hello, i have a problem determining the workstation name of the client user. i try to do a SELECT CURRENT CLIENT_WRKSTNNAME ..... but i get an empty string. I read the manual (SQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.