1753758 Members
4833 Online
108799 Solutions
New Discussion юеВ

Re: Pro*C error

 
Manish Srivastava
Trusted Contributor

Pro*C error

Hi,

I do not know whether this is the right place for this if no then please bear with me.

I am trying to compile a Pro*C program on hpux which was compiled and was running on tru64. When I compile it on hpux I get the following error:
========================
Precompiling liborah24.pc
/opt/oracle/OraHome1/bin/proc sqlcheck=full userid=scott/tiger@ian mode=ansi `echo -DTRUE=1 -DFALSE=0 | sed "s/-D/define=/g"` `echo -DPOSIX_4D9 -D_OSF_SOURCE -D_XOPEN_SOURCE=500 | sed "s/-D/define=/g"` include=../libgen include=/opt/oracle/OraHome1/precomp/public include=. liborah24.pc

Pro*C/C++: Release 9.2.0.4.0 - Production on Mon Sep 13 10:22:16 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

System default option values taken from: /opt/oracle/OraHome1/precomp/admin/pcscfg.cfg

Error at line 678, column 5 in file liborah24.pc
EXEC SQL
....1
PLS-S-00306, wrong number or types of arguments in call to '>='
Error at line 678, column 5 in file liborah24.pc
EXEC SQL
=================================


Thanks,
Manish.
6 REPLIES 6
Yogeeraj_1
Honored Contributor

Re: Pro*C error

hi manish,

do you have a PL/SQL function that returns a boolean or a procedure which has as an OUT or IN OUT boolean parameter?

you may be facing bug 185212.

please let us know.

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Manish Srivastava
Trusted Contributor

Re: Pro*C error

Hi,

It is not a PL/SQL returning a boolean. The parameters passed are int and a struct.
Does this problem occur if any element of the struct is a boolean?

manish
Eric Antunes
Honored Contributor

Re: Pro*C error

See the following Note on Metalink:

http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=95532.1

Yes, you must not have any boolean as a function parameter: you can transform the boolean parameter into an integer for exemple...
Each and every day is a good day to learn.
Yogeeraj_1
Honored Contributor

Re: Pro*C error

hi,

more details about the error and solution provided by metalink:


Solution Description
--------------------
BOOLEAN-type variables cannot be passed directly from/to PL/SQL from/to any of the Oracle Programmatic Interfaces, including Pro*C programs.

The BOOLEAN type is unique to pl/sql and since there is no corresponding

database internal type, the conversion routines do not exist.

Solution
--------
Suggestion A:
Modify the PL/SQL routine to pass an INTEGER parameter rather than a BOOLEAN.

Suggestion B:
Use an anonymous block to wrap the call to the procedure which converts the parameters from boolean to integer or number.

e.g.
consider the stored procedure
PROC_WITH_BOOL(P1 IN OUT NUMBER,P2 IN OUT BOOLEAN)

call this from Pro*C in the following way:
int io_param;
int io_bool;
..
/* Intervening code omitted */
..

EXEC SQL EXECUTE
declare
d_param BOOLEAN := TRUE;
begin
if :io_bool = 0 then
d_param = FALSE;
end if;
proc_with_bool(:io_param,d_param);

if d_param = FALSE then
:io_bool := 0;
else
:io_bool := 1;
end if;
end;
END-EXEC;


However since this code works on your tru64, this should most probably be a configuration problem.

Can you try to do a simple pro*c and compile it to see it your pro*c is OK?

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: Pro*C error

hi again,

a simple make file that you may wish to consider:
==========================================
$(TARGET): $(SOURCE) $(SOURCE:.pc=.c) $(SOURCE:.pc=.o)
$(CC) $(LDFLAGS) -t -o $(TARGET) \
$(SOURCE:.pc=.o) -L$(ORACLE_HOME)/lib $(PROLDLIBS)

include $(ORACLE_PROC_MAKEFILE)

PROCFLAGS= ireclen=255 lines=yes $(PROC_ENV_FLAGS) \
include=$(ORACLE_HOME)/proc/lib
PROFLAGS=$(PROCFLAGS)

CFLAGS=-I. -g $(CC_ENV_FLAGS)

==========================================

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Manish Srivastava
Trusted Contributor

Re: Pro*C error

Hi,

My other ProC programs compile. This is the only one where I am facing the problem.

Thanks for the information and help. The problem still exists.

manish