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!

Hi,

May be values clause is missing there.

The syntax i remenber is :

Insert into table1 values
( select
.
.
.
..

);

Thanks
Penchal

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.

Is the "username" a host variable or table column, can you describe your error in detail?

Give us the ORA-<number>

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.

I faced a similar kind of problem. The problem was with scalar queries. pro*C is unable to recognise that.

Try this:

int cnt;

EXEC SQL select (select count(*) from tab) into :cnt from dual;

Gives error.