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
Jifty::Plugin::SQLQueries(3pm)				User Contributed Perl Documentation			    Jifty::Plugin::SQLQueries(3pm)

NAME
Jifty::Plugin::SQLQueries - Inspect your application's SQL queries DESCRIPTION
This plugin will log each SQL query, its duration, its bind parameters, and its stack trace. Such reports are available at: http://your.app/__jifty/admin/requests USAGE
Add the following to your site_config.yml framework: Plugins: - SQLQueries: {} You can turn on and off the stacktrace, as well as an "EXPLAIN" of each query, using options to the plugin: framework: Plugins: - SQLQueries: stacktrace: 0 explain: 1 The plugin defaults to logging the stack trace, but not the explain. METHODS
init Sets up a "post_init" hook. inspect_before_request Clears the query log so we don't log any unrelated previous queries. inspect_after_request Stash the query log. inspect_render_summary Display how many queries and their total time. inspect_render_analysis Render a template with all the detailed information. post_init Tells Jifty::DBI to log queries in a way that records stack traces. prereq_plugins This plugin depends on Jifty::Plugin::RequestInspector. COPYRIGHT AND LICENSE
Copyright 2007-2010 Best Practical Solutions This is free software and may be modified and distributed under the same terms as Perl itself. perl v5.14.2 2010-12-10 Jifty::Plugin::SQLQueries(3pm)