Home » Infrastructure » Unix » Fetching Data Value from unix script to Pro* C file to insert the value in Oracle DB table (Oracle 10.2.0.4)
icon4.gif  Fetching Data Value from unix script to Pro* C file to insert the value in Oracle DB table [message #407076] Mon, 08 June 2009 06:30
atulrsingh
Messages: 55
Registered: November 2006
Location: Mumbai
Member
All,

I need an urgent help for reporting purpose.

I have Batch process written in Pro* C language from where i am executing various objects which is generating Output forms.

Then i am calling an "FT.sh" from the Pro*c file which is creating a consolidated TAR file for all the generated output forms.

Once the Taring activity is completed i need to get the count of files generated for which i am executing the "merged.sh" from the Pro*C file. here "batch_jobs.tar" is my TAR file name.

Code in side merged.sh
======================
a=`tar -tf batch_jobs.tar | wc -l`
echo $a
======================

The command gets executed successfully but i can't get the values of the execution in the Pro*C for inserting in to the data base.

Can some body let me know what should be done to get the Data Value from Unix to Pro*C.

Part of Code for executing the 2 SH files from the Pro*C file:
========
fprintf(g_fp, "%s BM : Before calling ft.sh - %s\n" ,g_cur_time ,mmy_dir_name.arr);
strcpy(mmy_ftp_command.arr,"sh ft.sh ");
strcat(mmy_ftp_command.arr,mmy_dir_name.arr);

strcpy(sys_cmd1,"sh merged.sh");
l_tar_count=system(sys_cmd1);

fprintf(g_fp, "%s BM : Value of l_tar_count - %d\n" ,g_cur_time ,l_tar_count);

fprintf(ftp_fp,"%s",mmy_ftp_command1.arr);

fclose(ftp_fp);
===========

Here l_tar_count is not giving me the count of the output.
Basically i need to know the Code chnages required in my Pro*C or UNIX file which will get my things done.

Wanted to add an important constraint for the solution providers... "I cannot connect to the database from UNIX as on production envirnoment i do not have an access, So we have to do it through application/batch process itself. As Inserting or updating database other than Application is a breach of contract" with client

Thanks in advance for the help

Regards
Atul

[Updated on: Mon, 08 June 2009 06:36]

Report message to a moderator

Previous Topic: oracle 9i installation on IBM-AIX (merged 4)
Next Topic: How to verify email address using mailx command ?
Goto Forum:
  


Current Time: Mon Dec 02 08:53:39 CST 2024