Sponsored Content
Full Discussion: SQLPLUS IN AWK Programming
Top Forums Shell Programming and Scripting SQLPLUS IN AWK Programming Post 302650143 by mkandula1983 on Friday 1st of June 2012 03:53:44 PM
Old 06-01-2012
SQLPLUS IN AWK Programming

Hi,

I am giving a call to SQLPLUS to query for something from a AWK session, but i am getting an error

Code:
"syntax error The source line is 4.
 The error context is
              >>>  l_count=` <<< 
 awk: The statement cannot be correctly parsed."

The code is:

Code:
awk '{
      if (substr($0,70,21) > 1 && substr($0,92,4)<3000) {
      l_cust_num=substr($0,1,25);
      l_count=`sqlplus -s apps/apps <<EOF
                 SET PAGES 0
                 SET FEED OFF
                 SET FEEDBACK OFF
                 SET LINESIZE 5000
                 SET HEADING OFF
                 SET VERIFY OFF
                 SET RECSEP OFF
                 SELECT COUNT(*) FROM oe_lookups WHERE lookup_type='RBC_POAO_CUSTOMER_LOOKUP' AND lookup_code=$l_cust_num;
                EXIT
                EOF`
       if $l_count > 0 {
       count=0;
       }
      }
      else {
       print $0;
      }
     }'

Let me know if i have to use this something different... I am using this for oracle apps script

Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.

Last edited by radoulov; 06-01-2012 at 06:06 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk programming

Hi all, i want to study harder awk programming. where can i get a good examples, problems and solutions. i'm in a hurry.. thanks, (5 Replies)
Discussion started by: tungaw2004
5 Replies

2. Shell Programming and Scripting

need help with awk programming

Hello Friends I want to process only those lines which are not started with a * or " example File name: GRX "RxDataTime, NSysClkEn, Frame","Size","Sleep","TNum","TSet","TWait" *Init Start *Comment Generated from: C:\Documents and Settings 000000,0000,1,0,0,0,0,0,0... (8 Replies)
Discussion started by: user_prady
8 Replies

3. Shell Programming and Scripting

To pass the .sql file as a paramter to sqlplus through shell programming

Hi, Currently i have a .sql file 1.sql. I need to pass that as a parameter through a shell script to the sqlplus inside the same shell script. How I should I do.can anyone help me pls. I have an req where I need to send the .sql file and the place where the script has to create a .csv... (9 Replies)
Discussion started by: Hemamalini
9 Replies

4. Shell Programming and Scripting

awk programming

Hi I have a multi -line file which is sorted by the 1-st colomn in the following format: 400 0000 0001 1000 1010 0111 0000 1000 0000 402 1101 0000 1100 1010 0111 1000 1000 0000 403 1001 0000 1100 1010 0111 0000 1000 0000 495 1000 0000 1100 ... (4 Replies)
Discussion started by: aoussenko
4 Replies

5. Programming

awk programming

I have the list of numbers in a file 105.1 102.0 100.5 100 98 97.5 95 ... I want to get how many times I have numbers greater than a particular limit, say 100 in the list. How can I do that with awk command? (5 Replies)
Discussion started by: pranto_d
5 Replies

6. Shell Programming and Scripting

AWK programming

Hi All, I read the AWK manual in the MAN page. But i didn't understand the below piece of code in the script TABLE=`echo "${FILE}" | awk -F"/" '{print $NF}' | cut -d"." -f1 | awk -F"_" '{print $NF}' 2>> ${LOGFILE}`; Please explain the above code. Thanks in advance ....... Regards,... (4 Replies)
Discussion started by: pdathu
4 Replies

7. Shell Programming and Scripting

awk with variable from sqlplus

Hi, I'm a it stuck on the below code where a variable is pulled from sqlplus and used in awk. It runs with no errors but still pulls back all records in the input file. It should pull the max reference from sql plus and then only print those records where the reference value in column 1 is... (4 Replies)
Discussion started by: jonathanb30
4 Replies

8. Shell Programming and Scripting

awk programming

Need assistance using awk . Need assistance in awk programming. Any idea of getting the marked data into a file. </tr> <tr> <td class='labelOptional_ind'> cdr.00012325.0000000000000000.20130612.050005.WANP4722_csv </td> <td width='15%' class='labelOptional'> <div align='center'>... (8 Replies)
Discussion started by: ajayram_arya
8 Replies

9. Shell Programming and Scripting

Sqlplus error - sqlplus -s <login/password@dbname> : No such file or directory

i am using bash shell Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127. IFS="," declare -a Arr=($Variable1); SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE} echo "set head off ; " > ${SQLCMD} echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies

10. Shell Programming and Scripting

awk programming -Passing variable to awk for loop

Hi All, I am new to AWK programming. I have the following for loop in my awk program. cat printhtml.awk: BEGIN -------- <some code here> END{ ----------<some code here> for(N=0; N<H; N++) { for(M=5; M<D; M++) print "\t" D ""; } ----- } ... (2 Replies)
Discussion started by: ctrld
2 Replies
SSL_CTX_set_session_id_context(3)				      OpenSSL					 SSL_CTX_set_session_id_context(3)

NAME
SSL_CTX_set_session_id_context, SSL_set_session_id_context - set context within which session can be reused (server side only) SYNOPSIS
#include <openssl/ssl.h> int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len); int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, unsigned int sid_ctx_len); DESCRIPTION
SSL_CTX_set_session_id_context() sets the context sid_ctx of length sid_ctx_len within which a session can be reused for the ctx object. SSL_set_session_id_context() sets the context sid_ctx of length sid_ctx_len within which a session can be reused for the ssl object. NOTES
Sessions are generated within a certain context. When exporting/importing sessions with i2d_SSL_SESSION/d2i_SSL_SESSION it would be possible, to re-import a session generated from another context (e.g. another application), which might lead to malfunctions. Therefore each application must set its own session id context sid_ctx which is used to distinguish the contexts and is stored in exported sessions. The sid_ctx can be any kind of binary data with a given length, it is therefore possible to use e.g. the name of the application and/or the hostname and/or service name ... The session id context becomes part of the session. The session id context is set by the SSL/TLS server. The SSL_CTX_set_session_id_context() and SSL_set_session_id_context() functions are therefore only useful on the server side. OpenSSL clients will check the session id context returned by the server when reusing a session. The maximum length of the sid_ctx is limited to SSL_MAX_SSL_SESSION_ID_LENGTH. WARNINGS
If the session id context is not set on an SSL/TLS server and client certificates are used, stored sessions will not be reused but a fatal error will be flagged and the handshake will fail. If a server returns a different session id context to an OpenSSL client when reusing a session, an error will be flagged and the handshake will fail. OpenSSL servers will always return the correct session id context, as an OpenSSL server checks the session id context itself before reusing a session as described above. RETURN VALUES
SSL_CTX_set_session_id_context() and SSL_set_session_id_context() return the following values: 0 The length sid_ctx_len of the session id context sid_ctx exceeded the maximum allowed length of SSL_MAX_SSL_SESSION_ID_LENGTH. The error is logged to the error stack. 1 The operation succeeded. SEE ALSO
ssl(3) 50 2013-03-05 SSL_CTX_set_session_id_context(3)
All times are GMT -4. The time now is 11:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy