Sponsored Content
Full Discussion: pro*c coding
Top Forums UNIX for Dummies Questions & Answers pro*c coding Post 302178256 by user71408 on Tuesday 25th of March 2008 05:49:56 AM
Old 03-25-2008
pro*c coding

Hi All,
I am new to pro*C. I have a select statement as
Code:
select a.ename,a.sal,a.empno from emp where &n=(select count(distinct(b.sal)) from  emp b where a.sal<=b.sal

for this query I have to write a pro*C program. So can you please send me the complete code. Then I will foloow the same steps to future.

Thank you.
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

domain logon problem - FreeBSD PDC w/ win2k pro and winxp pro

this is the seventh problem i'm having with samba. for some reason, i cannot logon to the domain. i've created user accounts... and i was able to establish a connection between the samba server (my PDC) and my workstations by logging in as "root." however now when i try to logon it gives... (5 Replies)
Discussion started by: xyyz
5 Replies

2. UNIX for Advanced & Expert Users

can I use this coding

I apologise because I had pasted this question in the newbies forum first (because i am a bit of a newbie) but thought it might be better suited in here if i have to sepearate parameters can I use this syntax especially the or part (||) and is this correct if (6 Replies)
Discussion started by: w33man
6 Replies

3. Programming

where i get coding for networking in C?

hai, this is nagalakshmi. i have a question in Unix C. i need the coding for the file transfer and simulation of protocols in C where i get the coding? (2 Replies)
Discussion started by: xpertlakshmi
2 Replies

4. Shell Programming and Scripting

Need help with coding

HI, Can some one guide me how to make changes to the script below so that it can load the history of a program to IT server ? Format of data: YYYYMMDD065959.dsk.log YYYYMMDD235959.dsk.log currently both are loaded together. Need to separate them as above format. Thanks in advance. ... (1 Reply)
Discussion started by: crazydude80
1 Replies

5. Windows & DOS: Issues & Discussions

Need help with coding

HI, Can some one guide me how to make changes to the script below so that it can load the history of a program to IT server ? Format of data: YYYYMMDD065959.dsk.log YYYYMMDD235959.dsk.log currently both are loaded together. Need to separate them as above format. Thanks in advance. ... (2 Replies)
Discussion started by: crazydude80
2 Replies

6. Shell Programming and Scripting

Coding the cron

how to write a cron that runs for every 2 minute * * * * * emp.sh but it is executing for every minutes. how can i make it to run for only 10 times for in a day (4 Replies)
Discussion started by: azherkn3
4 Replies
insq(9F)						   Kernel Functions for Drivers 						  insq(9F)

NAME
insq - insert a message into a queue SYNOPSIS
#include <sys/stream.h> int insq(queue_t *q, mblk_t *emp, mblk_t *nmp); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
q Pointer to the queue containing message emp. emp Enqueued message before which the new message is to be inserted. mblk_t is an instance of the msgb(9S) structure. nmp Message to be inserted. DESCRIPTION
insq() inserts a message into a queue. The message to be inserted, nmp, is placed in q immediately before the message emp. If emp is NULL, the new message is placed at the end of the queue. The queue class of the new message is ignored. All flow control parameters are updated. The service procedure is enabled unless QNOENB is set. RETURN VALUES
insq() returns 1 on success, and 0 on failure. CONTEXT
insq() can be called from user or interrupt context. EXAMPLES
This routine illustrates the steps a transport provider may take to place expedited data ahead of normal data on a queue (assume all M_DATA messages are converted into M_PROTO T_DATA_REQ messages). Normal T_DATA_REQ messages are just placed on the end of the queue (line 16). However, expedited T_EXDATA_REQ messages are inserted before any normal messages already on the queue (line 25). If there are no normal messages on the queue, bp will be NULL and we fall out of the for loop (line 21). insq acts like putq(9F) in this case. 1 #include 2 #include 3 4 static int 5 xxxwput(queue_t *q, mblk_t *mp) 6 { 7 union T_primitives *tp; 8 mblk_t *bp; 9 union T_primitives *ntp; 10 11 switch (mp->b_datap->db_type) { 12 case M_PROTO: 13 tp = (union T_primitives *)mp->b_rptr; 14 switch (tp->type) { 15 case T_DATA_REQ: 16 putq(q, mp); 17 break; 18 19 case T_EXDATA_REQ: 20 /* Insert code here to protect queue and message block */ 21 for (bp = q->q_first; bp; bp = bp->b_next) { 22 if (bp->b_datap->db_type == M_PROTO) { 23 ntp = (union T_primitives *)bp->b_rptr; 24 if (ntp->type != T_EXDATA_REQ) 25 break; 26 } 27 } 28 (void)insq(q, bp, mp); 29 /* End of region that must be protected */ 30 break; . . . 31 } 32 } 33 } When using insq(), you must ensure that the queue and the message block is not modified by another thread at the same time. You can achieve this either by using STREAMS functions or by implementing your own locking. SEE ALSO
putq(9F), rmvq(9F), msgb(9S) Writing Device Drivers STREAMS Programming Guide WARNINGS
If emp is non-NULL, it must point to a message on q or a system panic could result. SunOS 5.10 9 Jul 2001 insq(9F)
All times are GMT -4. The time now is 12:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy