Sponsored Content
Full Discussion: Need a help
Top Forums UNIX for Dummies Questions & Answers Need a help Post 302239978 by u263066 on Thursday 25th of September 2008 12:09:25 AM
Old 09-25-2008
Need a help

I am calling sql script from host program

how to capture the return message
here is part of code
Code:
getcount()
{
xx1=`$ORACLE_HOME/bin/sqlplus -s apps/ostgapps1 2>/dev/null << EOF
     WHENEVER SQLERROR EXIT 1
     SET HEADING OFF SET FEEDBACK OFF SET VERIFY OFF SET PAGESIZE 0
       
     WHENEVER SQLERROR EXIT SQL.SQLCODE;
      select count(*) from XXPH_CMS_INVOICE_ALL;
      exit
EOF`
}


Is there any way that I can get the total count as return
any help would be highly apprecited.
 
cvm-sql(7)						 Miscellaneous Information Manual						cvm-sql(7)

NAME
cvm-sql - CVM SQL Framework QUERY SUBSTITUTION
$VAR and ${VAR} are replaced with the quoted value of the environment variable named VAR. Use the second form when VAR contains anything other than alpha-numeric or underscore (_) characters. Do not include quotes in the query. The variables account and domain contain the account and domain names given by the CVM client. $$ is replaced with a single dollar sign. QUERY RESULTS
The query must produce the following fields exactly in order. All required fields must not be null or empty. 1. Password, encrypted with crypt(3) (required) 2. Actual account name (required) 3. User ID (integer) (required) 4. Group ID (integer) (required) 5. Directory (required) 6. Real name (optional) 7. Login shell (optional) 8. Group name (optional) 9. Domain name (optional) 10. System account name (optional) 11. System account directory (optional) 12. Mailbox path (optional) DEFAULT QUERY
SELECT password, username, userid, groupid, directory, realname, shell, groupname, domain, sys_username, sys_directory FROM accounts WHERE username=$account AND domain=$domain SEE ALSO
cvm-mysql(8), cvm-pgsql(8), cvm-pwfile(8), cvm-qmail(8), cvm-unix(8), cvm-vmailmgr(8), cvm-benchclient(8), cvm-checkpassword(8), cvm-test- client(8) http://untroubled.org/cvm/cvm.html cvm-sql(7)
All times are GMT -4. The time now is 09:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy