Home » Infrastructure » Unix » Fetching Data Value from unix script to Pro* C file to insert the value in Oracle DB table (Oracle
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
Messages: 55
Registered: November 2006
Location: Mumbai

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 ");

strcpy(sys_cmd1,"sh merged.sh");

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



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


[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: Thu Mar 23 22:51:17 CDT 2023