Sponsored Content
Top Forums Shell Programming and Scripting Variable not found error for a variable which is returned from stored procedure Post 302505993 by michaelrozar17 on Friday 18th of March 2011 06:59:27 AM
Old 03-18-2011
As you would know the error is related to Oracle. Please check the procedure you have written, it has some syntax errors. Or explain what your trying to achieve with the procedure. If your trying to read the row count of a table to a unix shell variable then try/compile either of the below procedures..
Code:
create or replace NEW_PROC is
begin
select count(*) from table;
end;

or

create or replace NEW_PROC is
cnt int;
begin
select count(*) into cnt from table;
dbms_output.put_line(cnt);
end;


Last edited by michaelrozar17; 03-18-2011 at 08:33 AM.. Reason: typo
This User Gave Thanks to michaelrozar17 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assign the returned value of a function to a variable

Hi, Can anyone please show me how to assign the returned value of a function to a variable? Thanks. (2 Replies)
Discussion started by: trivektor
2 Replies

2. Shell Programming and Scripting

script or piece of code where the data returned by a stored procedure you are writing

hi fndz. Can you please help me with the code if I call a stored procedure from my shell script and stored procedure returns a cursor, cursor output should be saved to a file (3 Replies)
Discussion started by: enigma_83
3 Replies

3. Shell Programming and Scripting

How to assign value to a variable with row(using -n) returned by sed

Hi Friends, REQUIREMENT: Want to delete files from the current directory match with the same in the file test.txt set -x i=1 echo "i=$i" COUNT=`sed -n '$=' test.txt` echo "Count=$COUNT" while do "## Here is error##" FILETOREMOVE=`sed -n \'$i,1p\' test.txt` echo $FILETOREMOVE... (5 Replies)
Discussion started by: sourabhsharma
5 Replies

4. UNIX for Dummies Questions & Answers

Loop on array variable returning error: 0 not found

I'm guessing i have a syntax error. I'm not sure it get's past the the while condition. I get an error 0 not found. Simple loop not sure what I'm doing wrong. #!/usr/bin/ksh set -A MtPtArray /u03 /u06 tUbound=${#MtPtArray } echo $tUbound i=0 while ($i -lt $tUbound) do print... (4 Replies)
Discussion started by: KME
4 Replies

5. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

6. UNIX for Dummies Questions & Answers

Assigning the output of a command to a variable, where there may be >1 line returned?

Hello I am using unix CLI commands for the Synergy CM software. The command basically searches for a folder ID and returns the names of the projects the folder sits in. The result is assigned to a variable: FIND_USE=`ccm folder -fu -u -f "%name"-"%version" ${FOLDER_ID}` When the command... (6 Replies)
Discussion started by: Glyn_Mo
6 Replies

7. Shell Programming and Scripting

check variable value when nothing is returned

Hi all, I am wondering how can I check when a variable has nothing returned in it. I am trying to store a pid in this variable to see if a script is running in the background. So I am using something like that proc_pid=`ps -ef |grep script.sh|grep -v grep|awk '{print $2}'` if then ... (1 Reply)
Discussion started by: geovas
1 Replies

8. UNIX for Dummies Questions & Answers

Variable not found error

Hi, I get a "FILEPATH: not found" error on the 3rd line and the line where it is within the case. Any idea as to why I'm getting this error time and time again? Oh and FILEPATH will store the directory of the file. I appreciate any help! IAM=`basename $0` RC=0 FILEPATH = ""... (1 Reply)
Discussion started by: MIA651
1 Replies

9. Shell Programming and Scripting

Getting value of variable whose name is stored in another variable

Unix OS : Linux 2.6x Shell type : Korn I am stuck in weird problem . In my shell script I am setting an environment variable using the following command : EMP="KUMARJIT"; export EMP In the following sections of the script , what I did is : I created and initialized a new shell variable "type"... (5 Replies)
Discussion started by: kumarjt
5 Replies

10. Shell Programming and Scripting

Variable not found error in while loop

I am unable to use the value of a variable. while ] do LstFldDataPart =`head -n "$LstFldDataPartCntr" "${FeedFileDir}/${FeedFileBadRecs}" | tail -1 | tr -d '\n'` echo $LstFldDataPart JndLstFldDataPart="${JndLstFldDataPart}${LstFldDataPart}" LstFldDataPartCntr=... (3 Replies)
Discussion started by: TomG
3 Replies
DB2_PROCEDURES(3)							 1							 DB2_PROCEDURES(3)

db2_procedures - Returns a result set listing the stored procedures registered in a database

SYNOPSIS
resource db2_procedures (resource $connection, string $qualifier, string $schema, string $procedure) DESCRIPTION
Returns a result set listing the stored procedures registered in a database. PARAMETERS
o $connection - A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. o $qualifier - A qualifier for DB2 databases running on OS/390 or z/OS servers. For other databases, pass NULL or an empty string. o $schema - The schema which contains the procedures. This parameter accepts a search pattern containing _ and % as wildcards. o $procedure - The name of the procedure. This parameter accepts a search pattern containing _ and % as wildcards. RETURN VALUES
Returns a statement resource with a result set containing rows describing the stored procedures matching the specified parameters. The rows are composed of the following columns: +------------------+---------------------------------------------------+ | Column name | | | | | | | Description | | | | +------------------+---------------------------------------------------+ | PROCEDURE_CAT | | | | | | | The catalog that contains the procedure. The | | | value is NULL if this table does not have cata- | | | logs. | | | | | PROCEDURE_SCHEM | | | | | | | Name of the schema that contains the stored pro- | | | cedure. | | | | | PROCEDURE_NAME | | | | | | | Name of the procedure. | | | | |NUM_INPUT_PARAMS | | | | | | | Number of input (IN) parameters for the stored | | | procedure. | | | | |NUM_OUTPUT_PARAMS | | | | | | | Number of output (OUT) parameters for the stored | | | procedure. | | | | | NUM_RESULT_SETS | | | | | | | Number of result sets returned by the stored pro- | | | cedure. | | | | | REMARKS | | | | | | | Any comments about the stored procedure. | | | | | PROCEDURE_TYPE | | | | | | | Always returns 1, indicating that the stored pro- | | | cedure does not return a return value. | | | | +------------------+---------------------------------------------------+ SEE ALSO
db2_column_privileges(3), db2_columns(3), db2_foreign_keys(3), db2_primary_keys(3), db2_procedure_columns(3), db2_special_columns(3), db2_statistics(3), db2_table_privileges(3), db2_tables(3). PHP Documentation Group DB2_PROCEDURES(3)
All times are GMT -4. The time now is 03:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy