473,473 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

oracle pro*C problem:varchar variable is truncated after calling C function

1 New Member
I have varchar variable declared .When I print this var it shows me correct value before a C function.
Inside a c function this variable value is getting truncated .
The c function does not pass this variable .It intializes structure memebers only.
I am using Pro*C/C++: Release 8.1.7.0.0 and OS details is :
Release: 5.8
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.8 Generic 117350-35 Mar 2006

Request your help in this matter.


EXEC SQL BEGIN DECLARE SECTION;
varchar ip_msg_type[5];
EXEC SQL END DECLARE SECTION;

/*Some of the Declarations are as below*/
struct op_msg_format
{
char message_type[5];
int section_position;
char section_name[5];
int section_length;
int min_occ;
int max_occ;
char write_to_file_flag;
char file_name[36];
};

struct sec_msg_rec_type
{
char section_name[5];
int start_position;
int section_length;
};

char g_prog_name[100];
struct op_msg_format g_op_msg_tab[MAX_OP_MSG_FORMAT];
struct sec_msg_rec_type g_sec_tab[MAX_SEC_MAG_REC_TYPE];
int g_op_msg_tab_cnt;
FILE *g_fhndl_tab[MAX_OP_MSG_FORMAT];



/* Part of Main Program is below */
printf("^^***ip_msg_type.arr = %s\n",ip_msg_type.arr);
/*value shows IMG */

if (init("SEC_MAG_REC_TYPE") != SUCCESS)
{
if (fn_log_errors( g_error_log_file,(char *)C_FATAL,"TRADE","E-INITFAILED",
"TRD_MQ_MSG_PROCESS","BARCLAYS","","STAGING",
"Initialisation of SEC_MAG_REC_TYPE Structure failed",
"","","") != SUCCESS)
{
fn_std_err("Error in call to fn_log_errors : MAIN.E-INITFAILED");
}
goto sqlerror;
}
g_sec_ind = 0;
g_bt_ind = 'N';

printf("^^****ip_msg_type.arr = %s\n",ip_msg_type.arr);
/*Value shows IM */


int init(char *struct_type)
{
int z;
if (strcmp(struct_type,"OP_MSG_FORMAT") == 0)
{
for (z = 0; z <= MAX_OP_MSG_FORMAT; z++)
{
g_op_msg_tab[z].message_type[0] = '\0';
g_op_msg_tab[z].section_position = 0;
g_op_msg_tab[z].section_name[0] = '\0';
g_op_msg_tab[z].section_length = 0;
g_op_msg_tab[z].min_occ = 0;
g_op_msg_tab[z].max_occ = 0;
g_op_msg_tab[z].write_to_file_flag = '\0';
g_op_msg_tab[z].file_name[0] = '\0';

/* This is of type pointer and you are assigning
a char constant to it */
g_fhndl_tab[z] = NULL;
}
}
if (strcmp(struct_type,"SEC_MAG_REC_TYPE") == 0)
{
printf("!!ip_msg_type = %s\n",ip_msg_type.arr);
/*Value shows IMG */

for (z = 0; z <= MAX_SEC_MAG_REC_TYPE; z++)
{
g_sec_tab[z].section_name[0] = '\0';
g_sec_tab[z].start_position = 0;
}
printf("!!!ip_msg_type = %s\n",ip_msg_type.arr);
/*Value shows IM */
}
return SUCCESS;
}
Apr 26 '07 #1
0 1363

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Daniel Diehl | last post by:
Good morning! Now I'm sitting over 2 hours on a problem calling a method in the logitech SDK DLL. Everything is working fine, but calling one method I fell in a problem. I'm not that old with C#...
12
by: Newbie | last post by:
how can i call an oracle function to get data without using a select statement or stored procedures? given a project_no, i need to call the function: ops$sqltime.pa_new_job_no_fn which will...
2
by: Newbie | last post by:
how can i call an oracle function? given a project_no, i need to call the function: ops$sqltime.pa_new_job_no_fn which will return the next job_no thanks in advance.
0
by: Tako | last post by:
I have a problem calling .NET classes with default properties from VB6. The class has a public member, this public member has a default property, from VB6 I can´t acces the default method without...
4
by: jens Jensen | last post by:
Hello, Assum i have an oracle function called ofunction. Can someone tell me how i can call this function assuming it take the parameter in_param of type clob. Any help will be highly...
2
by: John | last post by:
My application needs to call Oracle function using oracle client 9.2. The oracle function returns boolean value from its returned parameter. The name space that I used is system.data.oracleclient....
0
by: One from | last post by:
I have a lot of Oracle function in packages and i would like use it in my ASP pages. With Oracle procedure it's all right. Sample like this .... set cn = Server.CreateObject("ADODB.Connection")...
3
by: Steve Kershaw | last post by:
I'm not even sure this can be done. I have a requirement to call an Oracle function (that returns a value) from C# code. The Oracle function is as follows: FUNCTION get_rec_final_qtr_count (...
1
by: Anthony Smith | last post by:
$stmt = $dbh->prepare("begin TOOLS_PKG.getOrgCode(?); end;"); $stmt->bindParam(1, $value, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 12); $stmt->execute(); Does anything look wrong? This is a...
0
by: Svend Jensen | last post by:
Leo wrote: A synonym will do. /Svend
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.