Sponsored Content
Top Forums Shell Programming and Scripting Error in calling store procedure using SQLPLUS in unix Post 302431076 by pradeep7986 on Monday 21st of June 2010 01:24:35 AM
Old 06-21-2010
Error in calling store procedure using SQLPLUS in unix

Hi,
I am facing the following error in calling the stored procedure from SQLPLUS in unix environment.

Code:
SQL> set serveroutput on
SQL> var store number;
SQL> exec test_proc(:store, 200);
BEGIN TEST_PROC(:store, 200); END;
*
ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "TEST_PROC", line 111
ORA-06512: at line 1

The definition of the stored procedure is :
Code:
procedure test_proc(
  store out number,
  key number)     
is
declare
...
begin
...
end test_proc;

Please tell me how should I pass a numeric value here in order to make this procedure run.

Thanks
Pradeep

Last edited by pradeep7986; 06-21-2010 at 03:03 AM.. Reason: added the line 'end test_proc' in the end where only end was written
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

calling Oracle procedure from Unix

Does anyone know how to call an Oracle stored procedure from a Unix script? (1 Reply)
Discussion started by: ssmiths001
1 Replies

2. Shell Programming and Scripting

Calling an Oracle Stored Procedure from Unix shell script

hai, can anybody say how to call or to execute an oracle stored procedure in oracle from unix... thanks in advance.... for ur reply.... by, leo (2 Replies)
Discussion started by: Leojhose
2 Replies

3. Programming

Calling procedure through Unix Shell

Hi can anyone help me in how to 1) invoke batch profile to run sqlplus on XXXXX server. 2) execute truncate table xtra.xtra_card_email_request using procedure dbadmin.truncate_table . 3) Check the count before and after the job run. (1 Reply)
Discussion started by: jakred
1 Replies

4. Shell Programming and Scripting

Calling procedure through Unix Shell

how to 1) invoke batch profile to run sqlplus on XXXXX server. 2) execute truncate table xtra.xtra_card_email_request using procedure dbadmin.truncate_table . 3) Check the count before and after the job run. (1 Reply)
Discussion started by: jakred
1 Replies

5. UNIX for Dummies Questions & Answers

Calling stored procedure from unix

Hi, My stored procedure returns a value. How to retrieve the value and display in unix. Stored procedure CREATE OR REPLACE PROCEDURE gohan(num INT) IS BEGIN DBMS_OUTPUT.PUT_LINE('My lucky number is ' || num); END; Unix Scripting i used sqlplus -s... (7 Replies)
Discussion started by: gohan3376
7 Replies

6. Shell Programming and Scripting

how to store the return values of stored procedure in unix shell script.

hi i am calling a oracle stored procedure(in the database) from unix shell scripting (a.sh). the called stored procedure returns some values through OUT variables i want to assign the return values of stored procedure in to unix shell script variable. can you provide me the code. ... (1 Reply)
Discussion started by: barani75
1 Replies

7. UNIX for Dummies Questions & Answers

calling a unix shell script from sqlplus

I want to execute a shell script from sqlplus prompt and get its output back to sqlplus. Is this possible? if yes just give me an example for doing that. (2 Replies)
Discussion started by: boopathyvasagam
2 Replies

8. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have a UNIX script which will prepare anonymous oracle pl/sql block in a temporary file in run time and passes this file to sqlplus as given below. cat > $v_Input_File 2>>$v_Log << EOF BEGIN EXECUTE IMMEDIATE 'ALTER SESSION FORCE PARALLEL DML PARALLEL 16'; EXECUTE... (1 Reply)
Discussion started by: vikas_trl
1 Replies

9. How to Post in the The UNIX and Linux Forums

Calling a Sybase Stored procedure from a UNIX Script

Hi, I am new to shell scripting and Sybase database i need a help that i try to execute a SYBASE stored procedure from a Unix shell script and wanna write the output of the SP into a Text File.somehow i try to find a solution but whwn i try to run the script i am not getting the output file with... (1 Reply)
Discussion started by: Arun619
1 Replies

10. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have exactly same issue @vikas_trl had in following link: https://www.unix.com/shell-programming-and-scripting/259854-control-not-returning-sqlplus-calling-unix-shell-script.html I wonder if he or somebody else could find the issue's cause or the solution. Any help would... (4 Replies)
Discussion started by: RicardoQ
4 Replies
return(1T)						       Tcl Built-In Commands							return(1T)

__________________________________________________________________________________________________________________________________________________

NAME
return - Return from a procedure SYNOPSIS
return ?-code code? ?-errorinfo info? ?-errorcode code? ?string? _________________________________________________________________ DESCRIPTION
Return immediately from the current procedure (or top-level command or source command), with string as the return value. If string is not specified then an empty string will be returned as result. EXCEPTIONAL RETURN CODES
In addition to the result of a procedure, the return code of a procedure may also be set by return through use of the -code option. In the usual case where the -code option isn't specified the procedure will return normally. However, the -code option may be used to generate an exceptional return from the procedure. Code may have any of the following values: ok (or 0) Normal return: same as if the option is omitted. The return code of the procedure is 0 (TCL_OK). error(1) Error return: the return code of the procedure is 1 (TCL_ERROR). The procedure command behaves in its calling context as if it were the command error result. See below for additional options. return(2) The return code of the procedure is 2 (TCL_RETURN). The procedure command behaves in its calling context as if it were the command return (with no arguments). break(3TCL) The return code of the procedure is 3 (TCL_BREAK). The procedure command behaves in its calling context as if it were the command break. continue(4) The return code of the procedure is 4 (TCL_CONTINUE). The procedure command behaves in its calling context as if it were the command continue. value Value must be an integer; it will be returned as the return code for the current procedure. The -code option is rarely used. It is provided so that procedures that implement new control structures can reflect exceptional condi- tions back to their callers. Two additional options, -errorinfo and -errorcode, may be used to provide additional information during error returns. These options are ignored unless code is error. The -errorinfo option specifies an initial stack trace for the errorInfo variable; if it is not specified then the stack trace left in errorInfo will include the call to the procedure and higher levels on the stack but it will not include any information about the context of the error within the procedure. Typically the info value is supplied from the value left in errorInfo after a catch command trapped an error within the procedure. If the -errorcode option is specified then code provides a value for the errorCode variable. If the option is not specified then errorCode will default to NONE. EXAMPLES
First, a simple example of using return to return from a procedure, interrupting the procedure body. proc printOneLine {} { puts "line 1" ;# This line will be printed. return puts "line 2" ;# This line will not be printed. } Next, an example of using return to set the value returned by the procedure. proc returnX {} {return X} puts [returnX] ;# prints "X" Next, a more complete example, using return -code error to report invalid arguments. proc factorial {n} { if {![string is integer $n] || ($n < 0)} { return -code error "expected non-negative integer, but got "$n"" } if {$n < 2} { return 1 } set m [expr {$n - 1}] set code [catch {factorial $m} factor] if {$code != 0} { return -code $code $factor } set product [expr {$n * $factor}] if {$product < 0} { return -code error "overflow computing factorial of $n" } return $product } Next, a procedure replacement for break. proc myBreak {} { return -code break } SEE ALSO
break(1T), catch(1T), continue(1T), error(1T), proc(1T), source(1T), tclvars(1T) KEYWORDS
break, catch, continue, error, procedure, return ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl 7.0 return(1T)
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy