The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem in awk command viveksnv Shell Programming and Scripting 3 03-03-2008 12:59 AM
problem with tr command ravi raj kumar UNIX for Advanced & Expert Users 2 07-02-2007 03:41 AM
problem with dd command or maybe AFS problem Anta Shell Programming and Scripting 0 08-25-2006 07:10 AM
ls command problem buckhtr77 SUN Solaris 2 12-06-2005 12:16 PM
Problem while using Sed command gopskrish UNIX for Dummies Questions & Answers 2 06-27-2005 08:26 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Apr 2008
Posts: 3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Apr 2008
Location: Bangalore
Posts: 120
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Hi,

May be values clause is missing there.

The syntax i remenber is :

Insert into table1 values
( select
.
.
.
..

);


Thanks
Penchal
Reply With Quote
  #3 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Apr 2008
Posts: 43
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Another sample which might help you,

EXEC SQL AT LOGS INSERT INTO WELL_HEADER (UWI,WELLNAME,CRSTATUS,ELEVATION) VALUES (:uwival, :wellnameval, :crstatusval, :elevationval);
Reply With Quote
  #4 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Apr 2008
Posts: 3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by shafi2all View Post
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.
Reply With Quote
  #5 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: May 2008
Posts: 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Is the "username" a host variable or table column, can you describe your error in detail?
Reply With Quote
  #6 (permalink)  
Old 05-09-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,275
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Give us the ORA-<number>
Reply With Quote
  #7 (permalink)  
Old 05-09-2008
Registered User
 

Join Date: Apr 2008
Posts: 3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by hk_president View Post
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.
Reply With Quote
  #8 (permalink)  
Old 05-22-2008
Registered User
 

Join Date: May 2008
Posts: 2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
similar prob faced

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.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101