Embedded SQL in AWK script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Embedded SQL in AWK script
# 1  
Old 04-13-2004
Embedded SQL in AWK script

Hi All,
Can I use AWK script to read data from Oracle table (some embedded SQL perhaps) The reason for this that I have a data file and I need to do some basic validations of the data in the file with some statistical figures related to the data file that I have stored in a Oracle table.

Thanks in advance.
Nilotpal.
# 2  
Old 04-20-2004
No, I don't think you can use AWK for such a task.

PERL or PHP would be a better choice.
# 3  
Old 04-21-2004
perl has DBI just for the purpose of working with a database.
There are versions for Oracle, Sybase, etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute a script based on status of embedded script

Hi, I have 2 scripts, first.ksh and second.ksh and would like first.ksh to run based on response of 'Y/y' received for second.ksh but in my case it continues to execute 'rm /tmp/list' irrespective of response received, below are my scripts with further info, Hope I'm making sense :) Thanks! ... (1 Reply)
Discussion started by: mbak
1 Replies

2. Shell Programming and Scripting

Using awk and sed to modify a create sql script

Hi, I have a file which contains the following data claim_src|clm_id,typ_id pat_src|pat_id prov_src|prov_id,clm_id,prov_name The first field is table name and second field is primary keys of the table Now I have three files which contain ddl of each table. clam_src.sql... (4 Replies)
Discussion started by: wahi80
4 Replies

3. Shell Programming and Scripting

awk script to parse SQL from Pro*C program

Hello, I have a Pro*C program which contains SQL sentences, such as: .... Pro*C sentences .... /*SQL 1*/ EXEC SQL SELECT t1.field1, t1.field2 INTO :w_field FROM TABLE1 t1, TABLE1 t2 WHERE t1.field1 = t2.field1 AND t1.ID = :wl_id; .... Pro*C sentences .... /*SQL 1*/ EXEC... (11 Replies)
Discussion started by: mvalonso
11 Replies

4. Shell Programming and Scripting

Script for HP Embedded Web Server

Hi, In our company we have serveral HP Officejet Pro 8600 N911g printers. I would like to create one addressbook (in CSV format) and import it to all our printers If i go to the settings of my network printer by ip address: /#hId-EmailContacts in my browser I don't see an option ... (0 Replies)
Discussion started by: eclectica1
0 Replies

5. Shell Programming and Scripting

SQL query within an awk script !!

Hello Experts, This sounds crazy, but one of my requirements is that if ID in 5th column in my input file (: separated) is not present in the oracle database table (say t_id) then this record should be skipped. I am using awk for all other requirements. So I was thinking if this requirement... (4 Replies)
Discussion started by: juzz4fun
4 Replies

6. Shell Programming and Scripting

Wrap lines with awk to create SQL script

Greetings! Some of my files list hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to display a message like "No error", else I display the error from the file itself. I came up with this (with help) for myfile in `find . -name... (2 Replies)
Discussion started by: alan
2 Replies

7. Shell Programming and Scripting

Assigning return value of an embedded SQL in a shell script variable

I've a script of the following form calling a simple sql that counts the no of rows as based on some conditions. I want the count returned by the sql to get assigned to the variable sql_ret_val1. However I'm finding that this var is always getting assigned a value of 0. I have verified by executing... (1 Reply)
Discussion started by: MxC
1 Replies

8. UNIX for Dummies Questions & Answers

Execute PL/SQL function from Unix script (.sql file)

Hi guys, I am new on here, I have a function in oracle that returns a specific value: create or replace PACKAGE BODY "CTC_ASDGET_SCHED" AS FUNCTION FN_ASDSCHEDULE_GET RETURN VARCHAR2 AS BEGIN DECLARE ASDSchedule varchar2(6); ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies

9. Shell Programming and Scripting

Bourne shell script with embedded Sybase SQL

Hi, I need a simple (as possible) Bourne shell script that takes an input file of adminID's and spits out a list of adminID's and related tradeID's. Both adminID and tradeID are columns in a Sybase database table called "trades", in which they have a one-to-one relationship. adminID is a... (3 Replies)
Discussion started by: chatieremerrill
3 Replies

10. Shell Programming and Scripting

Calling SQL LDR and SQL plus scripts in a shell script

Hi- I am trying to achieve the following in a script so I can schedule it on a cron job. I am fairly new to the unix environment... I have written a shell script that reads a flat file and loads the data into an Oracle table (Table1) via SQLLDR. This Works fine. Then, I run a nested insert... (5 Replies)
Discussion started by: rajagavini
5 Replies
Login or Register to Ask a Question