Home » Developer & Programmer » Precompilers, OCI & OCCI » Problem on compilation (oracle10g, solaris)
Problem on compilation [message #339017] Wed, 06 August 2008 09:34 Go to next message
hariprasad
Messages: 5
Registered: August 2008
Junior Member
hi friends,

i am new to to proc and trying write some demo programs.
#include<stdio.h>
#include</ora10gclnt/product/10.2.0/db_1/precomp/public/sqlca.h>

char userid[30] = "billing/dbname@passwd";

void sql_error();

int main()
{

int emp_id;
float raise_sal;

EXEC SQL WHENEVER SQLERROR do sql_error("Oracle error");

EXEC SQL CONNECT :userid;
printf("Connected.\n");

printf("\nEnter the EmpID:  ");
scanf("%d",emp_id);

printf("\nEnter the raise_sal:  ");
scanf("%f",raise_sal);


EXEC SQL EXECUTE
        BEGIN billing.RAISE_SALARY
        (:emp_id, :raise_sal);
        END;
END-EXEC;

EXEC SQL COMMIT WORK RELEASE;

return 0;
}


when i am compailing it with options
proc SQLCHECK=SEMANTICS MODE=ORACLE iname=pro_emp.pc
it is giving me error like

Error at line 27, column 8 in file pro_emp.pc
BEGIN billing.RAISE_SALARY
.......1
PLS-S-00201, identifier 'BILLING.RAISE_SALARY' must be declared
Error at line 27, column 8 in file pro_emp.pc
BEGIN billing.RAISE_SALARY
.......1
PLS-S-00000, Statement ignored
Semantic error at line 27, column 2, file pro_emp.pc:
BEGIN billing.RAISE_SALARY
.1
PCC-S-02346, PL/SQL found semantic errors

can any one help me please.
will appreciate.
Re: Problem on compilation [message #339021 is a reply to message #339017] Wed, 06 August 2008 10:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is not
billing/dbname@passwd
but
billing/passwd@dbname

and you have to give on proc command.

Regards
Michel
Re: Problem on compilation [message #339177 is a reply to message #339021] Thu, 07 August 2008 00:23 Go to previous messageGo to next message
hariprasad
Messages: 5
Registered: August 2008
Junior Member
Michel,

yes you r correct.
that was a typing mistake by me.
on my program i have written the correct one and even after that i am geting the same problem as i have explained.
any idea why it is ?
Re: Problem on compilation [message #339186 is a reply to message #339177] Thu, 07 August 2008 00:42 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Did you give userid connection on proc compilation command?

Proc is currently not able to find the object on the database.

Regards
Michel
Re: Problem on compilation [message #339192 is a reply to message #339186] Thu, 07 August 2008 01:08 Go to previous messageGo to next message
hariprasad
Messages: 5
Registered: August 2008
Junior Member
Hi michel,

when i comiled the way u told me, it is compiling with proc.
and when i am compiling the .c file with gcc it giving me problem like this.

bash-3.00$ gcc -L /ora10gclnt/product/10.2.0/db_1/lib32 -lclntsh pro_emp.c -o pro_emp
Undefined first referenced
symbol in file
sql_error /var/tmp//cckIc8J6.o
ld: fatal: Symbol referencing errors. No output written to pro_emp
collect2: ld returned 1 exit status

any soln.

Regards,
HARI
Re: Problem on compilation [message #339200 is a reply to message #339192] Thu, 07 August 2008 01:19 Go to previous message
hariprasad
Messages: 5
Registered: August 2008
Junior Member
Hi michel i did it.
Thanku very much for your help.

Regards,
Hari
Previous Topic: Handling Runtime Errors for Host Arrays
Next Topic: proc 10.2.0 on windows
Goto Forum:
  


Current Time: Thu Mar 28 11:16:21 CDT 2024