Hi,
We upgraded our servers from solaris 9 to 10. We recompiled all the Pro*C programs with the new oracle version as well. Oracle is 11g. We are facing core dump with the below error for certain executions. But when we are placing new statements between the error fucntion we get junk values to the output files.
Last edited by DukeNuke2; 07-09-2011 at 06:53 PM..
Just getting into the Unix command line programming and am unable to run any program I write. I am using a Makefile and the source is compiling but when I enter the name of the output file I get back:
bash: lab01exe.out: command not found
I'm sure I am just dooing something simple... (2 Replies)
I am confused about how to use a .exe file in unix along with a compiled C++ program. I've been using emacs and I compiled with g++, but I have no idea how that relates to use with a .exe. (1 Reply)
Hello All,
I have coded a C program which looks something like below... (program name: test.c)
#include<stdio.h>
main()
{
int dist,dm,dcm;
printf(" Enter the distance between 2 cities in KM : ");
scanf("%d",&dist);
dm=dist*1000;
dcm=dist*10;
printf("Distance between 2 cities in... (6 Replies)
Hi
I compiled an executable on Solaris 10 which creates semaphore ( semget)
but it didn't work on solaris 9 , while it is executing sucessfully on solaris 10. It is throwing the system error that Invalid arguments ( system error 22) on solaris 9.
the ldd for the executable on two servers is as... (4 Replies)
I have compiled my application on Solaris 10 with following description
SunOS ldg1 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Blade-T6320
The compiler is Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
But when installing the application on Solaris 9
SunOS odcarch02 5.9... (2 Replies)
I am trying to make an application which works on unix to work on linux. I already tried copying the binary files and start it up but I am getting an error stating "Cannot execute binary file". Then I tried to recompile but i am getting an error whenever I tried to recompile. I am getting the... (1 Reply)
Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
I have put some yellow color codes and works well.
I call the funstion using
print_usage(stderr, 0);
I would like to know if there is any way, to store the ansi color codes in variables and then call them inside fprintf.
Or have a format followed by the strings I want to output.
... (5 Replies)
Will a program compiled in ubuntu 14.04 execute in Centos 7? That is to say a tarball or zip is downloaded from github and extracted, compiled, and make is all done in ubuntu 14.04, can I mv the program from ubuntu 14.04 to Centos 7, add it to path in Centos 7. And run it? Thank you :) (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT REDHAT
ecpg
ECPG(1) PostgreSQL Client Applications ECPG(1)NAME
ecpg - embedded SQL C preprocessor
SYNOPSIS
ecpg [ option... ] file...
DESCRIPTION
ecpg is the embedded SQL preprocessor for C programs. It converts C programs with embedded SQL statements to normal C code by replacing the
SQL invocations with special function calls. The output files can then be processed with any C compiler tool chain.
ecpg will convert each input file given on the command line to the corresponding C output file. Input files preferrably have the extension
.pgc, in which case the extension will be replaced by .c to determine the output file name. If the extension of the input file is not .pgc,
then the output file name is computed by appending .c to the full file name. The output file name can also be overridden using the -o
option.
This reference page does not describe the embedded SQL language. See the PostgreSQL Programmer's Guide for that.
OPTIONS
ecpg accepts the following command-line arguments:
-c Automatically generate C code from SQL code. Currently, this works for EXEC SQL TYPE.
-D symbol
Define a C preprocessor symbol.
-I directory
Specify an additional include path, used to find files included via EXEC SQL INCLUDE. Defaults are . (current directory),
/usr/local/include, the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include), and
/usr/include, in that order.
-o filename
Specifies that ecpg should write all its output to the given filename.
-t Turn on autocommit of transactions. In this mode, each query is automatically committed unless it is inside an explicit transaction
block. In the default mode, queries are committed only when EXEC SQL COMMIT is issued.
-v Print additional information including the version and the include path.
---help
Show a brief summary of the command usage, then exit.
--version
Output version information, then exit.
NOTES
When compiling the preprocessed C code files, the compiler needs to be able to find the ECPG header files in the PostgreSQL include direc-
tory. Therefore, one might have to use the -I option when invoking the compiler (e.g., -I/usr/local/pgsql/include).
Programs using C code with embedded SQL have to be linked against the libecpg library, for example using the flags -L/usr/local/pgsql/lib
-lecpg.
The value of either of these directories that is appropriate for the installation can be found out using pg_config(1).
EXAMPLES
If you have an embedded SQL C source file named prog1.pgc, you can create an executable program using the following sequence of commands:
ecpg prog1.pgc
cc -I/usr/local/pgsql/include -c prog1.c
cc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg
SEE ALSO
PostgreSQL Programmer's Guide for a more detailed description of the embedded SQL interface
Application 2002-11-22 ECPG(1)