473,788 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ 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_Microsystem s
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_positio n;
char section_name[5];
int section_length;
int min_occ;
int max_occ;
char write_to_file_f lag;
char file_name[36];
};

struct sec_msg_rec_typ e
{
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_FORM AT];
struct sec_msg_rec_typ e g_sec_tab[MAX_SEC_MAG_REC _TYPE];
int g_op_msg_tab_cn t;
FILE *g_fhndl_tab[MAX_OP_MSG_FORM AT];



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

if (init("SEC_MAG_ REC_TYPE") != SUCCESS)
{
if (fn_log_errors( g_error_log_fil e,(char *)C_FATAL,"TRAD E","E-INITFAILED",
"TRD_MQ_MSG_PRO CESS","BARCLAYS ","","STAGI NG",
"Initialisa tion of SEC_MAG_REC_TYP E Structure failed",
"","","") != SUCCESS)
{
fn_std_err("Err or in call to fn_log_errors : MAIN.E-INITFAILED");
}
goto sqlerror;
}
g_sec_ind = 0;
g_bt_ind = 'N';

printf("^^****i p_msg_type.arr = %s\n",ip_msg_ty pe.arr);
/*Value shows IM */


int init(char *struct_type)
{
int z;
if (strcmp(struct_ type,"OP_MSG_FO RMAT") == 0)
{
for (z = 0; z <= MAX_OP_MSG_FORM AT; z++)
{
g_op_msg_tab[z].message_type[0] = '\0';
g_op_msg_tab[z].section_positi on = 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_R EC_TYPE") == 0)
{
printf("!!ip_ms g_type = %s\n",ip_msg_ty pe.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_m sg_type = %s\n",ip_msg_ty pe.arr);
/*Value shows IM */
}
return SUCCESS;
}
Apr 26 '07 #1
0 1386

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

Similar topics

3
1434
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# so i hope somebody can give me a hint in 1 min where I need 2 hours :) I get the error message: The best overloaded method match for 'AxVPORTAL2Lib.AxVideoPortal.GetCameraPropertyLong(int, out int)' has
12
9548
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 return the next job_no thanks in advance.
2
1624
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
1023
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 especifi the name of the defaul method, if I do it I get this error: 450: Wrong number of arguments or invalid property assignment Example:
4
29344
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 appreciated C# .ADO.NET 2.0
2
14775
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. found out there is no boolean type in Oracle parameter in OracleType. How can I get the returned value from function call in my code? Thanks in advance
0
1955
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") connString = "Provider=MSDAORA.1;Data Source=<>;User ID=<>;Password=<>" cn.Open connString SQL = "{call test.test_asp({resultset 0, cResult})}" Set cmd = Server.CreateObject ("ADODB.Command")
3
13871
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 ( "P_YEAR" IN NUMBER, "P_QUARTER" IN NUMBER ) RETURN Int
1
5340
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 custom Oracle function that is located in a package called TOOLS_PKG. I have seen how you do this with an Oracle procedure, but would an
0
188
by: Svend Jensen | last post by:
Leo wrote: A synonym will do. /Svend
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10370
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5402
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
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.