Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old January 18th, 2005, 09:05 AM
bondinnet bondinnet is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 bondinnet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Pro*C Program stops without giving core

Hi,

Just wanted to ask what might be the possible chances of a Pro*C program getting stopped without even giving core dump. In different runs of the program, the last executed statement were different. Given below is a
query I have in that Program.

EXEC SQL SELECT COUNT(1) INTO :NoOfRecords FROM MASTER_TABLE WHERE E_ID = ltrim(rtrim(:v_Id));

The program in different runs usually stops before some query.The surprising part is it fetches values for some query and then before firing some other query it just stops. It is not creating a table lock also.

If anybody has a clue, do help. I am working on Unix env.

Thankz in advance.
James..

Reply With Quote
  #2  
Old January 18th, 2005, 04:37 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
Pro*C will stop when there are Oracle errors. Well-written code will display what the Oracle error was. This is a simple example - check every time you ask Oracle to do anything.

Code:
void dberror(int err, int linenum)
{
    fprintf(stderr,"Oracle error %d on line %d\n",err,linenum);
    EXEC SQL ROLLBACK WORK RELEASE;
    exit(EXIT_FAILURE);
}
#define CKORA { if ( sqlca.sqlcode < 0) dberror(sqlca.sqlcode, __LINE__); }
#define NO_ROWS_FOUND (sqlca.sqlcode==1403)


int my_function(char *v_id)
{
   int NoOfREcords=0;
   short ind=0;
   EXEC SQL 
     SELECT COUNT(1) 
     INTO :NoOfRecords :ind
     FROM MASTER_TABLE 
     WHERE E_ID = ltrim(rtrim(:v_Id));
   CKORA;
   if(NO_ROWS_FOUND)
   {
        NoOfRecords=0;
   }
   return NoOfRecords;
}


CKORA will show an Oracle error and then exit the program.

Reply With Quote
  #3  
Old January 19th, 2005, 03:41 AM
bondinnet bondinnet is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 bondinnet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re: proc stops.

hi,

I actually checked the oracle query from backend. It runs fine. and the program doesnt stop at 1 particular place. In different runs, the program stops at different places.

kindly help

regards
James

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Pro*C Program stops without giving core


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway