Sponsored Content
Top Forums Shell Programming and Scripting Extract Oracle sql queries from .fmb and .rdf files Post 302914209 by jim mcnamara on Friday 22nd of August 2014 05:41:13 PM
Old 08-22-2014
Use strings uaampay.fmb | egrep -i '(select|insert|update|delete)'

Gives you something like this:
Code:
select utrpycd_code, utrpycd_desc from utrpycd where utrpycd_rev_loc_id 
= (select uzrcloc_rev_loc_id from uzrcloc where uzrcloc_cash_drawer_user_id = :key_block.cash_drawer_user_id)
select utvasvc_code, utvasvc_desc from utvasvc where utvasvc_desc not like 'Elec%' order by utvasvc_code
select utvresv_code, utvresv_desc from utvresv where utvresv_desc not like 'Elec%' and utvresv_desc not like 'Good%' order by utvresv_code
select '1' acci, '2' title, '3' status, '4' eff, '5' term from dual
select '1' fund, '2' title, '3' ftyp, '4' entry, '5' status, '6' eff, '7' term from dual
select '1' locn, '2' title, '3' status, '4' eff, '5' term from dual
select '1' prog, '2' title, '3' entry, '4' status, '5' eff, '6' term from dual
select '1' acct, '2' title, '3' atyp, '4' entry, '5' status, '6' eff, '7' term from dual
select '1' ccen, '2' title, '3' entry, '4' status, '5' eff, '6' term from dual
select '1' coas, '2' title, '3' status, '4' eff, '5' term from dual
select '1' rucl, '2' title, '3' type, '4' status, '5' eff, '6' term from dual
select '1' prog, '2' title, '3' entry, '4' status, '5' eff, '6' term from dual
select utrbank_code, ucbcust_last_name || 
decode(ucbcust_first_name, null , '' , ', ' || 
ucbcust_first_name) || decode(ucbcust_middle_name, null , '' , ' ' || 
ucbcust_middle_name) bank_description from utrbank, ucbcust 
where ucbcust_cust_code = utrbank_cust_code_bank
select utrpycd_code, utrpycd_desc from utrpycd, utvreas where utrpycd_code = utvreas_code 
and utvreas_rsnt_code = 'NUPC' and utrpycd_rev_loc_id = 
(select uzrcloc_rev_loc_id from uzrcloc where uzrcloc_cash_drawer_user_id = 
:key_block.cash_drawer_user_id)
select stvstat_code, stvstat_desc from stvstat order by 1
select utrpycd_code, utrpycd_desc from utrpycd where utrpycd_rev_loc_id = 
(select uzrcloc_rev_loc_id from uzrcloc where uzrcloc_cash_drawer_user_id = :key_block.cash_drawer_user_id)
select utvasvc_code, utvasvc_desc from utvasvc where utvasvc_desc not like 'Elec%' 
order by utvasvc_code

:key is a bind variable - bind variables start with a leading colon. Note the 'select [garbage] from dual' statements. Those do not really impact performance at all. Ignore them. Forms developers do that to avoid having to code fixed data in header for display tables. PS I edited the output a little to be more human readable.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

SQL queries in background?

I have to query a DB2 database, and sometimes they take a long time to produce results. Can I run these queries in the background, and if so, where will the results appear? (1 Reply)
Discussion started by: jpprial
1 Replies

2. UNIX for Dummies Questions & Answers

shell script for sql queries

Hi All, I have written 4 sql queries . Now I want to write one SHELL SCRIPTING program for all these queries... i.e 1.select * from head; 2. select * from detail; 3. delete from head; 4. delete from detail; Please let me know how to write a shell script... Thank you (1 Reply)
Discussion started by: user71408
1 Replies

3. Shell Programming and Scripting

Need to extract .sql files

Hi, I am trying to extract all .sql files present in a particular directory and its sub directories. How can i do this using shell script or awk? any help would be earnestly appreciated. thanks. (1 Reply)
Discussion started by: sprinleo
1 Replies

4. Shell Programming and Scripting

Select SQL Queries Option

count.sh#!/bin/ksh SQL1=`sqlplus -s usr/pwd @count.sql $1 $2 $3` SQL2=`sqlplus -s usr/pwd @selectall.sql $1 $2 $3` LIST="Count Select_All" select i in $LIST do if then echo $SQL1 elif then echo $SQL2 fi done (2 Replies)
Discussion started by: killboy
2 Replies

5. UNIX for Advanced & Expert Users

Extract Oracle DB Connect and SQL execution log

Hi, I am trying to write a generic script as a part of a framework which will establish Oracle DB connection once and loops in to check for some files which gives the SQL statements to execute. The script is running but I am stuck with capturing errors ( ORA and SP) and outputs. Example: ... (4 Replies)
Discussion started by: mirage0809
4 Replies

6. UNIX for Advanced & Expert Users

How to i execute .rdf file oracle report automatically in cron tab unix

Hi, I want to execute .rdf file which uses oracle report in crontab ..Can you please help me out how to schedule it crontab.as it is a rdf file Please give any suggestions regarding the above issue. (0 Replies)
Discussion started by: soumyamishra
0 Replies

7. Shell Programming and Scripting

Code needed to get sql queries

Hi i need code to get sql queries through a shell script for a text file input which contain the service ids iputfile I-H-2048-10GB-M I-H-4096-12GB-M I-H-2048-p1000-M the code should contain below queries among which service_id is replacable with value from input file. ... (4 Replies)
Discussion started by: surender reddy
4 Replies

8. AIX

Convert MS Access Queries to AIX SQL

Unix Team, I'm a recent college graduate entering in the " real world" and boy let me tell you it can quite challenging. I just got a job with a large fortune 50 company lets just say that my expectations and tasks have expanded since I first got hired. Last week I got assigned a pretty big... (9 Replies)
Discussion started by: techstudent01
9 Replies

9. Programming

Join 2 SQL queries into one

Dear community, could someone help me to join 2 queries into one? Basically it's the same query with different clauses (please notice the FIELD3 filters and related counters into the subquery): SELECT A.FIELD1,A.FIELD2,A.FIELD3 FROM TABLE A INNER JOIN ( SELECT FIELD1,... (3 Replies)
Discussion started by: Lord Spectre
3 Replies

10. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
ldns(3) 						     Library Functions Manual							   ldns(3)

NAME
ldns_rdf_new, ldns_rdf_clone, ldns_rdf_new_frm_data, ldns_rdf_new_frm_str, ldns_rdf_new_frm_fp, ldns_rdf_free, ldns_rdf_deep_free, ldns_rdf_print- SYNOPSIS
#include <stdint.h> #include <stdbool.h> #include <ldns/ldns.h> ldns_rdf* ldns_rdf_new(ldns_rdf_type type, size_t size, void *data); ldns_rdf* ldns_rdf_clone(const ldns_rdf *rd); ldns_rdf* ldns_rdf_new_frm_data(ldns_rdf_type type, size_t size, const void *data); ldns_rdf* ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str); ldns_status ldns_rdf_new_frm_fp(ldns_rdf **r, ldns_rdf_type type, FILE *fp); void ldns_rdf_free(ldns_rdf *rd); void ldns_rdf_deep_free(ldns_rdf *rd); void ldns_rdf_print(FILE *output, const ldns_rdf *rdf); DESCRIPTION
ldns_rdf_new() allocates a new rdf structure and fills it. This function DOES NOT copy the contents from the buffer, unlinke ldns_rdf_new_frm_data() type: type of the rdf size: size of the buffer data: pointer to the buffer to be copied Returns the new rdf structure or NULL on failure ldns_rdf_clone() clones a rdf structure. The data is copied. rd: rdf to be copied Returns a new rdf structure ldns_rdf_new_frm_data() allocates a new rdf structure and fills it. This function _does_ copy the contents from the buffer, unlinke ldns_rdf_new() type: type of the rdf size: size of the buffer data: pointer to the buffer to be copied Returns the new rdf structure or NULL on failure ldns_rdf_new_frm_str() creates a new rdf from a string. type: type to use str: string to use Returns ldns_rdf* or NULL in case of an error ldns_rdf_new_frm_fp() creates a new rdf from a file containing a string. r: the new rdf type: type to use fp: the file pointer to use Returns LDNS_STATUS_OK or the error ldns_rdf_free() frees a rdf structure, leaving the data pointer intact. rd: the pointer to be freed Returns void ldns_rdf_deep_free() frees a rdf structure _and_ frees the data. rdf should be created with _new_frm_data rd: the rdf structure to be freed Returns void ldns_rdf_print() Prints the data in the rdata field to the given file stream (in presentation format) output: the file stream to print to rdf: the rdata field to print Returns void AUTHOR
The ldns team at NLnet Labs. Which consists out of Jelte Jansen and Miek Gieben. REPORTING BUGS
Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at http://www.nlnetlabs.nl/bugs/index.html COPYRIGHT
Copyright (c) 2004 - 2006 NLnet Labs. Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
ldns_rdf. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. REMARKS
This manpage was automaticly generated from the ldns source code by use of Doxygen and some perl. 30 May 2006 ldns(3)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy