473,503 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in executing dynamic query with context in PRO *C program

Hi All,
I am facing problem in executing one dynamic query in PRO *C program
on linux. I want to update table
mytable by data MADURAI for a column mycolumn1 where primary key is
myPK.I want to use
EXECUTE IMMEDIATE with context.But it is not working.
Following is my piece of code. Please help. Thanks in advance.

int main()
{
EXEC SQL BEGIN DECLARE SECTION;
sql_context cntxt;
VARCHAR hDbName[32];
VARCHAR query[2000];
EXEC SQL END DECLARE SECTION;

EXEC SQL CONTEXT ALLOCATE :cntxt;

//Connected with database in another function passing context
as one argument. By using :-

connect_fun(cntxt,user,paswd);

strcpy((char *)query.arr,"UPDATE mytable SET
mycolumn1='MADURAI' WHERE myPK='11' ");
query.len=strlen("UPDATE mytable SET mycolumn1='MADURAI' WHERE
myPK='11' ");
EXEC SQL CONTEXT USE:cntxt;

//EXEC SQL AT :hDbName EXECUTE IMMEDIATE :query;
If I use this statement than ORA error is "statement handle not
prepared".

//EXEC SQL EXECUTE IMMEDIATE :query;
If I use this statement than ORA(1012) error is "not logged
on".

EXEC SQL AT :hDbName COMMIT;

return 0;

}
int connect_fun(sql_context cntxt,char *user, char *paswd)
{

EXEC SQL CONTEXT USE:cntxt;

EXEC SQL CONNECT :user IDENTIFIED BY :paswd AT :hdbname USING
:hdbname;

return 0;
}

Oct 9 '06 #1
2 4645

chets wrote:
I am facing problem in executing one dynamic query in PRO *C program
on linux.
Then you'd do better asking on an appropriate newsgroup. This one is
about the C programming language...

A newsgroup in the comp.databases.oracle hierarchy would be _much_ more
appropriate.

Oct 9 '06 #2
chets wrote:
Hi All,
I am facing problem in executing one dynamic query in PRO *C program
on linux. I want to update table
mytable by data MADURAI for a column mycolumn1 where primary key is
myPK.I want to use
EXECUTE IMMEDIATE with context.But it is not working.
Following is my piece of code. Please help. Thanks in advance.

int main()
{
EXEC SQL BEGIN DECLARE SECTION;
<snip>

I'm afraid that the bulk of this is not C but the major extensions that
Pro *C provides for handling SQL. We only deal with standard C not
something that uses C as a wrapper around vast quantities of other
stuff. You will have to ask somewhere that Pro *C is topical, and I'm
sure that there will be mailing lists dedicated to it if you look. You
could also try looking at SQL groups or groups dedicated to whatever SQL
engine it is that Pro *C works with, but check to see if Pro *C is
topical before posting to such groups.
--
Flash Gordon
Oct 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4723
by: Dima Protchenko | last post by:
Hi, guys. Please help if you know something about this. Error: ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed. line: if not rs.EOF then (from the code...
2
8431
by: J.Bijleveld | last post by:
Hello colleagues, At this moment we have a real big problem using a .NET application with an Oracle database (v8.1.6). I hope someone has encountered this problem before and is able to help me...
1
2390
by: Guinness Mann | last post by:
When you guys talk about "dynamic SQL," to what exactly are you referring? Is dynamic SQL anything that isn't a stored procedure? Specifically, I use ASP.NET to communicate with my SQL Server...
0
2037
by: Srini | last post by:
I am implementing Front Controller in ASP.net as outlined in Microsoft documentation titled "Implementing Front Controller in ASP.NET Using HTTPHandler"...
11
4706
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to...
2
2610
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
8
2702
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a...
2
1931
by: planetthoughtful | last post by:
Hi All, I'd like to place a subreport onto a report that draws its records from a UNION query. When I design the query and view the records all looks fine. However, when I put the query as...
10
4892
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.