problem with sql command in pro*c


 
Thread Tools Search this Thread
Top Forums Programming problem with sql command in pro*c
# 1  
Old 05-09-2008
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;

But sql error appear :
SELECT (select psid from cscterminfo where cscterminfo.TELNO = username), understand this command.
Please help me!
# 2  
Old 05-09-2008
Hi,

May be values clause is missing there.

The syntax i remenber is :

Insert into table1 values
( select
.
.
.
..

);


Thanks
Penchal
# 3  
Old 05-09-2008
Another sample which might help you,

EXEC SQL AT LOGS INSERT INTO WELL_HEADER (UWI,WELLNAME,CRSTATUS,ELEVATION) VALUES (:uwival, :wellnameval, :crstatusval, :elevationval);
# 4  
Old 05-09-2008
Quote:
Originally Posted by shafi2all
Another sample which might help you,

EXEC SQL AT LOGS INSERT INTO WELL_HEADER (UWI,WELLNAME,CRSTATUS,ELEVATION) VALUES (:uwival, :wellnameval, :crstatusval, :elevationval);
thank you shafi2all,
But that syntax is very complex and watse time, because my data is very large.
# 5  
Old 05-09-2008
Is the "username" a host variable or table column, can you describe your error in detail?
# 6  
Old 05-09-2008
Give us the ORA-<number>
# 7  
Old 05-09-2008
Quote:
Originally Posted by hk_president
Is the "username" a host variable or table column, can you describe your error in detail?
Well, `username` is a field of table `radacct`
My error may be sql command syntax in pro*C language. Because in SQL of SI OBJECT BROWSER that command run true.
thanks.
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. 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

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

4. UNIX for Advanced & Expert Users

Problem on Pro*C compilation on HP-UX

Hi, This is my first post to this forum. I have been facing a strange compilation error message. When I try to make a pro*C file on HP-UX ( uname -a shows HP-UX aopc7449 B.11.11 U 9000/800 2416083493 unlimited-user license), ::: Linking... /usr/ccs/bin/ld: profls.o: Not a valid object file... (5 Replies)
Discussion started by: asutoshch
5 Replies

5. AIX

Pro C Compilation problem

Hi, I have AIX 5.3 and my code is written in proc . i am getting following error during compilation Please help?////..... :-d: Compiling with RMS cc -w -q32 -qidirfirst -ISource/Header -I/usr/vacpp/include -q32 -DRMS -DDISEC -DDBG -DBIGENDIAN -DBIT32 -c -q32... (0 Replies)
Discussion started by: ajaysahoo
0 Replies

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

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

8. Shell Programming and Scripting

problem executed shell command from PL/SQL

i wrote plsql procedure that executed shell command using java class my problem is that in some reason the shell command ( liks Is -l , mv ... ) are not recordnize can someone help me with that 10x Alodvg (2 Replies)
Discussion started by: alodvg
2 Replies

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