dbTalk Databases Forums  

SQL Question

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss SQL Question in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dean
 
Posts: n/a

Default SQL Question - 02-23-2006 , 12:54 PM






I'm running some debug code in a program in C++, and I have a grid that
returns the results of any SQL statement that I care to enter on
screen. I can see the results of a select query, or I can execute a
command (such as delete), but in the latter case I can't see any
responce from Oracle to tell me what happened in the command (for
example, that 10 rows were deleted). How can I get this last message
back from Oracle?

Thanks!

Dean


Reply With Quote
  #2  
Old   
dean
 
Posts: n/a

Default Re: SQL Question - 02-23-2006 , 12:57 PM






Oh its 9.2i, Windows, ADO, on a Borland compiler.


Reply With Quote
  #3  
Old   
dean
 
Posts: n/a

Default Re: SQL Question - 02-23-2006 , 12:59 PM



So something like:

select get_last_error_msg as MSG from dual


Reply With Quote
  #4  
Old   
Sybrand Bakker
 
Posts: n/a

Default Re: SQL Question - 02-23-2006 , 04:51 PM



On 23 Feb 2006 10:54:59 -0800, "dean" <deanbrown3d (AT) yahoo (DOT) com> wrote:

Quote:
I'm running some debug code in a program in C++, and I have a grid that
returns the results of any SQL statement that I care to enter on
screen. I can see the results of a select query, or I can execute a
command (such as delete), but in the latter case I can't see any
responce from Oracle to tell me what happened in the command (for
example, that 10 rows were deleted). How can I get this last message
back from Oracle?

Thanks!

Dean
Both Pro*C and OCI automagically return the number of rows affected.
As you don't specify which Oracle supplied API you are using your
question can't be answered.

--
Sybrand Bakker, Senior Oracle DBA


Reply With Quote
  #5  
Old   
dean
 
Posts: n/a

Default Re: SQL Question - 02-24-2006 , 09:55 AM



Sorry I don't know anything about OCI - we used it years ago in low
level programming calls but not any more. How can I tell?

Is there no simple SQL query I can run as a select statement from dual,
or something like that?

Thanks!

Dean


Reply With Quote
  #6  
Old   
Mark C. Stock
 
Posts: n/a

Default Re: SQL Question - 02-24-2006 , 10:14 AM




"dean" <deanbrown3d (AT) yahoo (DOT) com> wrote

: Sorry I don't know anything about OCI - we used it years ago in low
: level programming calls but not any more. How can I tell?
:
: Is there no simple SQL query I can run as a select statement from dual,
: or something like that?
:
: Thanks!
:
: Dean
:

what are you using to establish the connection with the Oracle database?

what grid are you using?

likely it's a grid property

there is no such message or select statement to submit to oracle -- if you
were coding PL/SQL or issuing your own SQL statements, you could check
SQL%ROWCOUNT (or ROWCOUNT for a specific variable) or depending on the
environment you issue your SQL from check the SQLCA (IIRC -- it's been
awhile)

but if you're using a grid control, the grid control is managing the SQL for
you, and it will be reponsible for returning the status

so i'm guessing really isn't an oracle question but a grig control question

++ mcs



Reply With Quote
  #7  
Old   
dean
 
Posts: n/a

Default Re: SQL Question - 02-27-2006 , 09:07 AM



Its derived from TtsDBGrid (Top Grid). And it uses ADO to connect to
Oracle.


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.