Help with C function and Oracle


 
Thread Tools Search this Thread
Operating Systems Solaris Help with C function and Oracle
# 1  
Old 10-18-2011
Help with C function and Oracle

Hi,

I am calling database package from Pro*C program.
It is giving me the error
Code:
ORA-01426 : numeric overflow.

my package function is having all arguments with char or varchar variable.
Code:
int retval := pkg1.func1(arg1 varchar(3), arg2 char(8));

In this call only numeric variable is retval.
Code:
pkg1.func1 is also returning NUMBER.
This call giving me the ORA-01426 Error.

Can anyone help me on this.

Moderator's Comments:
Mod Comment Please use code tags

Last edited by zaxxon; 10-18-2011 at 03:21 PM.. Reason: code tags
# 2  
Old 10-18-2011
perhaps you should try with double int?
# 3  
Old 10-18-2011
It's better to make descriptive thread titles than a generic plea like 'URGENT!!'. The number of exclamation marks isn't proportional to the quality or rapidity of the help received.

Please post the statement which caused this error.
# 4  
Old 10-18-2011
Hi orange47,

Thanks for your reply.

But my package function also not getting called.
I have traces in my function i am calling but that traces also not getting printed.

Is this the problem os memory corruption in Pro*C or what ???
# 5  
Old 10-18-2011
Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. For this reason, posting questions with subjects like "Urgent!" or "Emergency" and demanding a fast reply are not permitted in the regular forums.

For members who want a higher visibility to their questions, we suggest you post in the Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.

Posting a new question in the Emergency UNIX and Linux Support Forum requires forum Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.

If you have posted a question in the regular forum with a subject "Urgent" "Emergency" or similar idea, we will, more-than-likely, close your thread and post this reply, redirecting you to the proper forum.

Of course, you can always post a descriptive subject text, remove words like "Urgent" etc. (from your subject and post) and post in the regular forums at any time.


Thank you.

The UNIX and Linux Forums
# 6  
Old 10-18-2011
statement causing the error.

T_arg1 and T_arg2 are my Pro*C variables.
Code:
int retval := pkg1.func1(T_arg1 , T_arg2);


Last edited by zaxxon; 10-18-2011 at 03:28 PM.. Reason: code tags, see your 1st post, it has a link to a description how to use them.
# 7  
Old 10-18-2011
@user270885
  1. You had a subject that was not fitting for this forum - urgent things are posted in the "urgent" area. Your subject was only "Urgent!!" and sowith not even any descriptive at all.
  2. You did not use code tags and still do not do.

I changed your subject, handed code tags. So maybe you reread the rules and post as sugested or I will close this thread. Thanks for your cooperation.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling Oracle function from script

Hi I need to call a function in database and update the return value of that function with a value in csv file. test.csv 1,2,3,,5,,,8,9,10 1,2,3,4,5,,,8,9,10 1,2,3,,,,,8,9,10In the above file I want to replace column 2 with a value extracted from database like (select student_id from... (3 Replies)
Discussion started by: kev94
3 Replies

2. Shell Programming and Scripting

set oracle variable in function

Hi, I have a function that is suposed to generate a AWR report: #-----------------------# gen_awr() #-----------------------# { sqlplus -s admin/admin@OCEAN11<<ENDOFSQL define num_days = '' define report_type = "html" define begin_snap =$snap1 define end_snap =%snap2 define... (1 Reply)
Discussion started by: amitlib
1 Replies

3. Programming

Oracle Database: INSERT INTO with TO_DATE function

Hello, I am writting a procedure in shell script as, set serveroutput on declare date_gen DATE := $DATEGEN; begin INSERT INTO TBL1 ( EMPNAME,EMPID,EMPBDATE) VALUES($EMPNAME,$EMPID,TO_DATE(date_gen,'YYYY-MM-DD')); end; / Where DATEGEN is unix string variable which I need to use into... (10 Replies)
Discussion started by: Poonamol
10 Replies

4. Shell Programming and Scripting

unix capture oracle function error

Hi, I want to execute an oracle function from unix script so for that I created a sample oracle function as below: create or replace function test_fn(test_date out varchar2) RETURN varchar2 IS BEGIN select to_char(sysdate,'DD-MON-YY') into test_date from dual; return test_date;... (5 Replies)
Discussion started by: dips_ag
5 Replies

5. Shell Programming and Scripting

getting return value from oracle function

So, in Oracle (11gR2) on aix I have a function like: CREATE OR REPLACE function COMMON.t2(var1 in varchar2, vari in number,var2 in out number) return number as begin insert into korisnik_temp(kor_inicia, kor_opisno) values(1, var1); var2:=0; return var2; exception when... (12 Replies)
Discussion started by: bongo
12 Replies

6. Shell Programming and Scripting

Oracle Function Needed

Dear Experts, Please find below the script in perl and can any body convert this script exactly in to oracle 9i fiunction which will return the required result same as perl. #!/usr/bin/perl $nof=@ARGV; @var2 = (); for($n=0; $n<$nof; $n++) { $filename = @ARGV; open... (3 Replies)
Discussion started by: shary
3 Replies

7. Shell Programming and Scripting

Question for calling oracle function from perl

Dear Sir/Madam, I use the following way to call the oracle stored procedure in a perl script, but I do not know how to call a oracle function by the following way ? # ARGV is the oracle stored procedure name with parameters $str = "sqlplus -s <<-eof \n" . "$db_login... (0 Replies)
Discussion started by: ili
0 Replies

8. Shell Programming and Scripting

ORACLE return a function to Solaris

Guys, I´m have this problem and I do not know what to do anymore: cod=`sqlplus -s ${DATABASE} << EOF set heading off feedback off verify off select max(eventid) from events; exit EOF` sed "s/CODEVENTID/${cod}/" c.ctl Abova What I´ve done. The CODEEVENTID is already set into a... (1 Reply)
Discussion started by: Rafael.Buria
1 Replies

9. Shell Programming and Scripting

i want to call a oracle function in my shell script

i want to call a oracle function in my shell script (4 Replies)
Discussion started by: dineshr85
4 Replies
Login or Register to Ask a Question