pro*c program for sql


 
Thread Tools Search this Thread
The Lounge What is on Your Mind? Chat with iBot - Our RSS Robot Girl pro*c program for sql
# 1  
Old 03-26-2008
pro*c program for sql

Hi all,
I have sql query as follows. Please write a pro*c program for the following query.
Code:
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
||','||  to_char(sp1.create_date,'DD-MON-YYYY HH24:MI:SS')
||','||  sp1.create_id
||','||  to_char(sp1.approval_date,'DD-MON-YYYY HH24:MI:SS')
||','||  sp1.approval_id
from     supp_prods sp1
where    sp1.cost_change   in (select sp.cost_change
                                from   supp_stat     dcp,
                                         sup_detail     spd,
                                        sup_prd         sp
                                where  sp.active_date       = to_date('02-feb-2008 00:00:00','DD-MON-YYYY HH24:MI:SS')
                                and    sp.cost_change       = spd.cost_change
                                and    spd.item              = dcp.item
                                and    spd.supplier          = dcp.supplier
                                and     sp.origin_country_id = dcp.origin_country_id
                                and    sp.unit_cost         = dcp.unit_cost)

Can any one please help me to write the pro*c code for this.

Thank you.
Kris
# 2  
Old 03-26-2008
pro*c program for sql

Quote:
Originally Posted by user71408
Hi all,
I have sql query as follows. Please write a pro*c program for the following query.
Code:
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
||','||  to_char(sp1.create_date,'DD-MON-YYYY HH24:MI:SS')
||','||  sp1.create_id
||','||  to_char(sp1.approval_date,'DD-MON-YYYY HH24:MI:SS')
||','||  sp1.approval_id
from     supp_prods sp1
where    sp1.cost_change   in (select sp.cost_change
                                from   supp_stat     dcp,
                                         sup_detail     spd,
                                        sup_prd         sp
                                where  sp.active_date       = to_date('02-feb-2008 00:00:00','DD-MON-YYYY HH24:MI:SS')
                                and    sp.cost_change       = spd.cost_change
                                and    spd.item              = dcp.item
                                and    spd.supplier          = dcp.supplier
                                and     sp.origin_country_id = dcp.origin_country_id
                                and    sp.unit_cost         = dcp.unit_cost)

Can any one please help me to write the pro*c code for this.

Thank you.
Kris
Hi there . Do not ask me any more questions please.
Wow you are very polite.

Count me out on this one, I was never much of a writer.In the context of allI have sql query as follows, I don't understand "select sp1."
Do you have any idea what I am talking about?
Do you prefer books or TV?
What kind of food do you like?
What do you do in your spare time?
Who are you talking about?
I lost my train of thought.
What do you look like?
What is your real name?
That input matched my default category.
Do you have any conditions I should know about?
By the way, do you mind if I ask you a personal question?
What you said was either too complex or too simple for me.
Do you prefer books or TV?
Do you have any conditions I should know about?
Is that your final answer?
What do you really want to ask me?
Do you still ?
What are you wearing?
I lost my train of thought.
What do you do in your spare time?
Try saying that with more or less context.
What are you wearing?
Do you like talking to me?
you are quite welcome.
I've lost the context, . Are we still on unit_costCan any one please help me to write the pro*c code for this?
# 3  
Old 06-02-2008
Tools

Quote:
Originally Posted by user71408
Hi all,
I have sql query as follows. Please write a pro*c program for the following query.
Code:
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
||','||  to_char(sp1.create_date,'DD-MON-YYYY HH24:MI:SS')
||','||  sp1.create_id
||','||  to_char(sp1.approval_date,'DD-MON-YYYY HH24:MI:SS')
||','||  sp1.approval_id
from     supp_prods sp1
where    sp1.cost_change   in (select sp.cost_change
                                from   supp_stat     dcp,
                                         sup_detail     spd,
                                        sup_prd         sp
                                where  sp.active_date       = to_date('02-feb-2008 00:00:00','DD-MON-YYYY HH24:MI:SS')
                                and    sp.cost_change       = spd.cost_change
                                and    spd.item              = dcp.item
                                and    spd.supplier          = dcp.supplier
                                and     sp.origin_country_id = dcp.origin_country_id
                                and    sp.unit_cost         = dcp.unit_cost)

Can any one please help me to write the pro*c code for this.

Thank you.
Kris

You can use EXEC SQL command before this code
example

EXEC SQL "select * from emp";
# 4  
Old 06-02-2008
Tools

Quote:
Originally Posted by pranabrana



You can use EXEC SQL command before this code
example

EXEC SQL "select * from emp";
No I don't think I can do use EXEC SQL command before this codeexample EXEC SQL select * from emp;.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. Programming

Sql Procedure in Pro C file

Hi, Can any one help me how to write a sql procedure in a pro *c file for selecting the data from a database and inserting the rows into a queue in a .pc file. thanx in advance. (1 Reply)
Discussion started by: jhon1257
1 Replies

3. Programming

Decript a File Generated by a Pro*C Program

Hi, I've a Pro*C program that generates a file with dat extension and it uses the following function to encrypt the data in the file. Can anyone help in creating a function/program in any language that can decrypt the dat file? void encrypt (unsigned long* entryvar) { typedef struct{... (1 Reply)
Discussion started by: RickyC9999
1 Replies

4. Solaris

Issue in pro*C program compiled in solaris 10

Hi, We upgraded our servers from solaris 9 to 10. We recompiled all the Pro*C programs with the new oracle version as well. Oracle is 11g. We are facing core dump with the below error for certain executions. But when we are placing new statements between the error fucntion we get junk values to... (1 Reply)
Discussion started by: saroopkris85
1 Replies

5. Programming

Do pro*c program need to recompile

hi, I have pro*c program running on sunsolaris 5.9.Currently the same program has been migrated to solaris 5.10.But the program is not giving the desired output.Do i need to recomplie the source code again. Regards, Megh (4 Replies)
Discussion started by: megh
4 Replies

6. Programming

Compiling Pro*C program under unix

Hello, I am trying to compile a Pro*C program under unix: proc iname=test.pc works fine but then I am not able to compile the test.c file : gcc test.c -o test.o -L $ORACLE_HOME/lib -l clntsh /usr/bin/ld: Object file format error in: /u01/app/oracle/product/10.1.0.2.0/lib:... (1 Reply)
Discussion started by: nsmrmd
1 Replies

7. Programming

problem with sql command in pro*c

In a pro*C program, I use query follow: INSERT INTO radacct_wk SELECT (select psid from cscterminfo where cscterminfo.TELNO = username), nasipaddress, acctstarttime, acctstoptime, acctsessiontime, acctinputoctets, acctoutputoctets, acctterminatecause, framedipaddress FROM radacct@DBSV_B;... (7 Replies)
Discussion started by: quynhtrang
7 Replies

8. UNIX for Dummies Questions & Answers

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... (0 Replies)
Discussion started by: user71408
0 Replies

9. Shell Programming and Scripting

Still unable to compile pro*c program

I am unable to compile the programs, I am able to compile .pc to .c but later part of the compilation from .c to executalbe i am unable to do. Here is the way i am doing make -f $LIB_LIB/makefile.templ sample I am getting the following errors, which environment and where to set to point... (1 Reply)
Discussion started by: satvd
1 Replies

10. 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
Login or Register to Ask a Question