PRo*C program for SQL queries using threading concept


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers PRo*C program for SQL queries using threading concept
# 1  
Old 05-21-2008
PRo*C program for SQL queries using threading concept

Hi All,
I have written 4 SQL queries. I want to write PRO*C program for this. I want to put these 4 queries in a single PR*C program using threading concept. Please guide me to write the pogram.
the queries are as follows.
1. select * from head;
2. select * from details;
3. delete from head where <condition>
4. delete from DETAIL where <condition>

I want to write a cursor for this like
Cursor C! is
select * from head;
curosr c2 is
select * from detail;
...
IF c1 % found then
delete from head;
IF c2% found then
delete from detail;
....



Thank you.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. Shell Programming and Scripting

pro*c program for sql query

Hi all, I have sql query as follows. Please write a pro*c program for the following query. select sp1.cost_change ||','|| sp1.cost_change_desc ||','|| sp1.reason ||','|| to_char(sp1.active_date,'DD-MON-YYYY HH24:MI:SS') ||','|| sp1.status ||','|| sp1.cost_change_origin... (0 Replies)
Discussion started by: user71408
0 Replies

9. 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
Login or Register to Ask a Question
rlm_sql_log(5)                                                   FreeRADIUS Module                                                  rlm_sql_log(5)

NAME
rlm_sql_log - FreeRADIUS Module DESCRIPTION
The rlm_sql_log module appends the SQL queries in a log file which is read later by the scripts/radsqlrelay Perl program. The purpose of this module is to de-couple the storage of long-term accounting data in SQL from "live" information needed by the RADIUS server as it's running. If you are not using SQL for simultaneous login restrictions (i.e. "sql" is not listed in the "session" section of "radiusd.conf"), then this module allows you to log SQL queries to a file, and then process them at your leisure. The benefit of this approach is that for a busy server, the overhead of performing SQL qeuries may be significant. Also, if the SQL data- bases are large (as is typical for ones storing months of data), the INSERTs and UPDATEs may take a relatively long time. Rather than slowing down the RADIUS server by having it interact with a database, you can just log the queries to a file, and then run those queries on another machine, or at a time when the RADIUS server is typically lightly loaded. If the "sql" module is listed in the "session" section of "radiusd.conf", then a similar system can still be used. In that case, one data- base would be used to maintain "live" session information. That database would be small, fast, and information would be deleted from it when a user logs out. A second database would store long-term accounting information, as described above. LIMITATIONS
This module only performs the dynamic expansion of the variables found in the SQL statements. No operation is executed on the database server. (this would be done later by an external program) That means the module is useful only with non-"SELECT" statements. CONFIGURATION
The main configuration items to be aware of are the path of the log file and the different SQL queries. path An entry named "path" sets the full path of the file where the SQL queries are recorded. (this variable is run through dynamic string expansion, and can include FreeRADIUS variables to create a dynamic filename) Accounting queries When a accounting record is processed, the module searches a config entry keyed by the Acct-Status-Type attribute present in the packet. For example, the SQL to be run on an accounting start must be named "Start" in the configuration for the module. Other usual values for Acct-Status-Type are "Stop", "Alive", "Accounting-On", etc. See the VALUEs for Acct-Status-Type in the dictio- nary.rfc2866 file. Post-Auth query An entry named "Post-Auth" sets the query to run during the post-authentication stage. This query is mainly used to log sessions where there may not be a later accounting packet. modules { ... sql_log { path = "${radacctdir}/sql-relay" acct_table = "radacct" postauth_table = "radpostauth" sql_user_name = "%{%{User-Name}:-DEFAULT}" Start = "INSERT INTO ${acct_table} ..." Stop = "UPDATE ${acct_table} SET ..." Alive = "UPDATE ${acct_table} SET ..." Post-Auth = "INSERT INTO ${postauth_table} ..." } ... } accounting { ... sql_log ... } post-auth { ... sql_log ... } SECTIONS
accounting, post-auth FILES
/etc/raddb/radiusd.conf SEE ALSO
radsqlrelay(8), radiusd(8), radiusd.conf(5) AUTHOR
Nicolas Baradakis <nicolas.baradakis@cegetel.net> 28 May 2005 rlm_sql_log(5)