Cannot store integer value


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cannot store integer value
# 1  
Old 04-10-2008
Cannot store integer value

Hi ,

I have code like below in my ksh script, but getting an error as SP2-0253: data item 1 ("SAMPLE_ID") will not fit on line , pls help me. thanks.


if (( CHECKS == 0 )) || (( CHECKS == 1 ))

then

V_SAMPLE_ID=$( $ORACLE_HOME/bin/sqlplus -S / <<EOF
whenever sqlerror exit 1 rollback;
whenever oserror exit 1 rollback;

--Set up pagesize parameters.
set newpage 0;
set space 0;
set echo off;
set pagesize 0;
set heading off;
set verify off;
set feedback off;
set trimspool off;
set termout on;
set colsep "";
set linesize 5;

select SAMPLE_ID from sample_m
where NAME=$MFGLBL and TVALUE=$C_SAMPLE;
exit;
EOF
)
v_count=$?
print "V_SAMPLE_ID: $V_SAMPLE_ID" >> $LOG_FILE


fi
# 2  
Old 04-10-2008
right now i'm able to get the value after adding a substr in the select statement, but the value is getting '2003 15588' , instead of '20031558'

thanks
# 3  
Old 04-10-2008
any solution for this problem
# 4  
Old 04-10-2008
It's against the:

https://www.unix.com/unix-dummies-que...om-forums.html

to bump up questions!
# 5  
Old 04-10-2008
My crystal ball is fuzzy, but I think you're assuming we know your DB schema.....
# 6  
Old 04-10-2008
realy sorry about that.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Are These All The Integer Types In C

Hello and Good day, I am currently studying C and I just finished learning about variables mainly those of integer type. I am wondering if the list below are all there is to integer variables and there are still more that i have to learn. Here are the list: Char Short int long long long... (3 Replies)
Discussion started by: split_func0
3 Replies

2. Solaris

Integer Validation

Hi Using the below logic to check whether the value is integer or not and converting the value to decimal if not. int_chck = sprintf(substr($i, 1, 2)) o_cnt = 'if ; then echo $int_chck; else echo $((0x$int_chck)); fi' Thanks, Dines (4 Replies)
Discussion started by: dineshnak
4 Replies

3. Shell Programming and Scripting

String to integer

I am on HP-UX using ksh in the script. MaxSal=`sqlplus -silent /nolog <<EOF connect / as sysdba whenever sqlerror exit sql.sqlcode set pagesize 0 feedback off verify off heading off echo off select max(sal) from emp1; select max(sal) from emp2; select max(sal) from emp3; exit; EOF`... (3 Replies)
Discussion started by: bang_dba
3 Replies

4. Shell Programming and Scripting

how to compare string integer with an integer?

hi, how to I do this? i="4.000" if ; then echo "smaller" fi how do I convert the "4.000" to 4? Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies

5. Solaris

How to Use a Variable as Integer?

hello, i am writing a script that takes the UID from the PASSWD and then i want to increse the Number by one. for the Next user. i cannot get this to work that a variable is as interger example: set i = 0 set $i = $+1 it's in tcsh if it's mather (10 Replies)
Discussion started by: shatztal
10 Replies

6. Shell Programming and Scripting

Alphanumeric to integer

Hi folks, I have a value like A12,i could able to change this into integer using typeset as below typeset -i A12 But, I need your advice to change the values like 1A2 or 12A into integer. Thanks in advance. Thanks, Sathish (3 Replies)
Discussion started by: bsathishmca
3 Replies

7. UNIX for Dummies Questions & Answers

integer to string

Hi all, is there an easy way to convert integer to string in bash? I have numbers like 1, 2, ..., 112, ... and I would like to get 001 002 003 004 ... Thank you, Sarah (4 Replies)
Discussion started by: f_o_555
4 Replies

8. Shell Programming and Scripting

get integer part

Hi, I did a df|awk| command and it returns a percentage "94%", how could I only get the integer part "94" out of it, so I can compare it to another number, I knwo that I have to pipe it to sth, but "grep " did not work, it still give me number WITH the percentage, does someone know what... (3 Replies)
Discussion started by: ericaworld
3 Replies

9. IP Networking

how to pass integer

i am writing a client and server program client program main() { int sockfd,n; char str; struct sockaddr_in sock; if ((sockfd=socket(AF_INET,SOCK_STREAM,0))<0) { perror("SOCKET ERROR"); } bzero(&sock,sizeof(sock)); sock.sin_family=AF_INET; (1 Reply)
Discussion started by: ramneek
1 Replies
Login or Register to Ask a Question