conditional writing of sql code


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting conditional writing of sql code
# 1  
Old 09-21-2004
conditional writing of sql code

Hello again... I have a request from another department to list for them all the columns and tables we use in this certain database. I have spooled the oracle stored procedured into 1 file. I need a way to write out parts of that file. The criteria is to to start the block to be written when the word "SELECT" is found, end the block when either a semicolon or the word "WHERE" is found. I suspect there are mixed case versions of these words but this should get over 95% of the cases.

thanks in advance for any help.
Kathy

never mind stopping at the WHERE clause, we have to take that clause too. SO realy we can stop the block at the next semicolon...

Last edited by kburrows; 09-21-2004 at 04:30 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending sql output to email body with conditional subject line

hi , i have written below piece of code to meet the requirement but i am stuck in the logic here. the requirement are: 1) to send the sql out put to email body with proper formatting. 2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies

2. Shell Programming and Scripting

Help writing code

Hi, i need a string that take from a log file just two words (ngwan0) and his related ip address and then execute 2 commands in a shell. Any ideas where to start? Thanks (3 Replies)
Discussion started by: Board27
3 Replies

3. Programming

Help writing SQL query

Hello All, I hope I'm posting this in the right section. I have zero sql query writing skill, in fact, I've never done it before, but for some reason, a request came across my desk to get information from one of our databases. I have about 200 ticket numbers that have no information attached,... (8 Replies)
Discussion started by: bbbngowc
8 Replies

4. Shell Programming and Scripting

Column not allowed, when I am writing sql in UNIX

Please advice to rectify below error #!/bin/ksh X=$(sqlplus -s user/pass << EOSQL set serveroutput on; set heading off feedback off serveroutput on trimout on pagesize 0 INSERT INTO TEST(df) VALUES('a'); COMMIT; EXIT; EOSQL) echo $X echo $? ERROR at line 2: ORA-00984: column not... (1 Reply)
Discussion started by: mirwasim
1 Replies

5. Shell Programming and Scripting

To create a file writing a SQL into it from another file

Hi, I have a file in which I have database information along with 1 SELECT statement. Only 1 statement would be there. I want to grep this SELECT STATEMENT only and write into a separate file. Input File format: Database_Name:<database> Schema_Name:<schema> Table_Name:<table> Select *... (3 Replies)
Discussion started by: ustechie
3 Replies

6. Shell Programming and Scripting

Writing sql results to file using ksh -nevermind

I'm having problems with writing my sql results to a file: sqlplus -S username/password@DB <<!! set echo off set verify off set showmode off set feedback off set timing off set linesize 250 set wrap off set pagesize 0 set newpage none set tab off set trimspool on set colsep... (1 Reply)
Discussion started by: avillanueva
1 Replies

7. Homework & Coursework Questions

Writing Code

1. The problem statement, all variables and given/known data: Write a script that will perform the grep command on a user defined file and a user defined pattern 2. Relevant commands, code, scripts, algorithms: must use grep command (that is the only piece of information that was given) ... (2 Replies)
Discussion started by: akjim101
2 Replies

8. Shell Programming and Scripting

writing the output of SQL into one file

Hi All, Please help me writing the below script. I have two sql queries. 1. Select count(1),Client_id from TABLE_A group by Client_id; 2. Select count(1),Client_id from TABLE_B group by Client_id; I need the output of above two sql queries in a single file. The output 2nd query should be... (4 Replies)
Discussion started by: 46019
4 Replies

9. Programming

Writing to a File using pl/sql

Hi I am new to using pl/sql on a unix platform and am having trouble writing to a file from within a block. Below is an example of the code that I have. I know that I need to use UTL_FILE to accomplish this; however, I keep getting errors. Can someone please help me? I am trying to create a... (1 Reply)
Discussion started by: stky13
1 Replies

10. Shell Programming and Scripting

writing code!!!

suppose by writing this code "$ /sbin/ifconfig eth0| grep 'inet addr:' " i've got this output "inet addr:192.168.2.1 Mask:255.255.255.0" now if i want to see the output like this "IP address: 192.168.2.1 Subnet Mask: 255.255.255.0" what is the code should be? can anyone... (3 Replies)
Discussion started by: shelly
3 Replies
Login or Register to Ask a Question
rlm_sql(5)							 FreeRADIUS Module							rlm_sql(5)

NAME
rlm_sql - FreeRADIUS Module DESCRIPTION
The rlm_sql module provides an SQL interface to retrieve authorization information and store accounting information. It can be used in conjunction with, or in lieu of the files and detail modules. The SQL module has drivers to support the following SQL databases: db2 iodbc mysql oracle postgresql sybase unixodbc Due to the size of the configuration variables, the sql module is usually configured in a separate file, which is included in the main radiusd.conf via an include directive. The main configuration items to be aware of are: driver This variable specifies the driver to be loaded. server login password These specify the servername, username, and password the module will use to connect to the database. radius_db The name of the database where the radius tables are stored. acct_table1 acct_table2 These specify the tables names for accounting records. acct_table1 specifies the table where Start records are stored. acct_table2 specifies the table where Stop records are stored. In most cases, this should be the same table. postauth_table The name of the table to store post-authentication data. authcheck_table authreply_table The tables where individual Check-Items and Reply-Items are stored. groupcheck_table groupreply_table The tables where group Check-Items and Reply-Items are stored. usergroup_table The table where username to group relationships are stored. deletestatlesessions This option is set to 'yes' or 'no'. If you are doing Simultaneous-Use checking, and this is set to yes, stale sessions ( defined as sessions for which a Stop record was not received ) will be cleared. logfile This option is useful for debugging sql problems. If logfile is set then all sql queries for the containing section are written to the file specified. This is useful for debugging and bulk inserts. num_sql_socks The number of sql connections to make to the database. connect_failure_retry_delay The number of seconds to wait before attempting to reconnect to a failed database connection. sql_user_name This is the definition of the SQL-User-Name attribute. This is set once, so that you can use %{SQL-User-Name} in the SQL queries, rather than the nested username substitution. This ensures that Username is parsed consistently for all SQL queries executed. default_user_profile This is the default profile name that will be applied to all users if set. This is not set by default. query_on_not_found This option is set to 'yes' or 'no'. If set to yes, then the default user profile is returned if no specific match was found for the user. authorize_check_query authorize_reply_query These queries are run during the authorization stage to extract the user authorization information from the ${authcheck_table} and ${authreply_table}. authorize_group_check_query authorize_group_reply_query These queries are run during the authorization stage to extract the group authorization information from the ${groupcheck_table} and ${groupreply_table}. accounting_onoff_query The query to be run when receiving an Accounting On or Accounting Off packet. accounting_update_query accounting_update_query_alt The query to be run when receiving an Accounting Update packet. If the primary query fails, the alt query is run. accounting_start_query accounting_start_query_alt The query to be run when receiving an Accounting Start packet. If the primary query fails, the alt query is run. accounting_stop_query accounting_stop_query_alt The query to be run when receiving an Accounting Stop packet. If the primary query fails, the alt query is run. simul_count_query The query to be run to return the number simultaneous sessions for the purposes of limiting Simultaneous Use. simul_verify_query The query to return the detail information needed to confirm that all suspected connected sessions are valid, and are not stale ses- sions. group_membership_query The query to run to check user group membership. postauth_query The query to run during the post-authentication stage. CONFIGURATION
Due to the size of the configuration for this module, it is not included in this manual page. Please review the supplied configuration files for example queries and configuration details. SECTIONS
authorization, accounting, checksimul, post-authentication FILES
/etc/raddb/radiusd.conf, /etc/raddb/sql.conf, /etc/raddb/sql/<DB>/dialup.conf, /etc/raddb/sql/<DB>/schema.sql, SEE ALSO
radiusd(8), radiusd.conf(5), AUTHORS
Chris Parker, cparker@segv.org 5 February 2004 rlm_sql(5)