[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::rdb_60

Title:Oracle Rdb - Still a strategic database for DEC on Alpha AXP!
Notice:RDB_60 is archived, please use RDB_70..
Moderator:NOVA::SMITHISON
Created:Fri Mar 18 1994
Last Modified:Fri May 30 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5118
Total number of notes:28246

4992.0. ""C" and SQL" by ORAREP::ALLVAX::ONEILL () Mon Feb 03 1997 11:20


    I wrote a "C" program that takes advange of some RDB libraries that allow
    you to execute SQL statements dynamicly. Is there any way to get number of 
    rows effected by an update/delete type statement? Neither of the 
    SQLCA/SQLDA data structures carry this information.
    
	Again thanks for your help
T.RTitleUserPersonal
Name
DateLines
4992.1NOVA::SMITHIDon't understate or underestimate Rdb!Mon Feb 03 1997 11:4310
~Is there any way to get number of  rows effected by an update/delete type
~statement? Neither of the  SQLCA/SQLDA data structures carry this information.

The SQLCA will have this information once the statement executes.  Please read
the SQLCA appendix in the SQL Reference Manual (SQLERRD).

Naturally the SQLDA would not have this information as it describes the data
passed to and from a statement.

Ian
4992.2svrav1.au.oracle.com::MBRADLEYI was dropped on my head as a baby. What's your excuse?Mon Feb 03 1997 17:515
Or you can use GET DIAGNOSTIC in an MSP.

G'day,

Mark.
4992.3Still having problems with C and SQLORAREP::ALLVAX::ONEILLTue Feb 11 1997 11:4349
PROBLEM:

	Have a "C" program to execute any valid SQL statement dynamicly.
Am trying to capture the message that indicates the number of rows effected
by "UPDATE" AND "DELETE" type SQL statements. This is the message that
normally appears for interactive SQL users after the statment executes:
"6 rows updated", "24 rows deleted" etc...

This information is not part of the "SQLCA" data structure that is returned
by the dynamic routines. The documentation seems to indicate that the
"RDB$MESSAGE_VECTOR" might have this information but I have not been able
to successfully include this external data structure in my program. I
get an "undefined symbol" message from the linker:

%LINK-W-NUDFSYMS, 1 undefined symbol:
%LINK-I-UDFSYM,         RDB$MESSAGE_VECTOR
%LINK-I-UDFSYM,         VMH$FIXEDQ_UR (Weak Reference)
%LINK-I-UDFSYM,         VMH$FIXEDQ_UW (Weak Reference)
%LINK-I-UDFSYM,         VMHDEB$TRACE_FREE_VM (Weak Reference)
%LINK-I-UDFSYM,         VMHDEB$TRACE_FREE_VMLIST (Weak Reference)
%LINK-I-UDFSYM,         VMHDEB$TRACE_GET_VM (Weak Reference)
%LINK-I-UDFSYM,         VMHDEB$TRACE_RET_VMH (Weak Reference)
%LINK-W-USEUNDEF, undefined symbol RDB$MESSAGE_VECTOR referenced
        in psect $LINK$ offset %X000002A0
        in module SQL$DYNAMIC_DRIVER_I file USER100:[ORAM.DYNAM]EXEC_SQL.OBJ;38

I have declared the structure in my program as follows:

extern struct Rdb$MESSAGE_VECTOR_str RDB$MESSAGE_VECTOR;

Is there header or something that I need to include in my program in order to
use this data structure?

What are the members of this data structure or do I have to use the built in
system calls to access it?(ie SYS$PUTMSG)

Have been unable to find any adequate documentation on this.
Will RDB$MESSAGE_VECTOR give me the information I'm looking for?
Here is my environment and versions:

Current PROCESS DEC Rdb environment is version V6.0-0 (MULTIVERSION)
Current SYSTEM  DEC Rdb environment is version V6.0-0 (MULTIVERSION)
Current PROCESS SQL environment is version V6.0-0 (MULTIVERSION)
Current PROCESS Rdb/Dispatch environment is version V6.0-1 (MULTIVERSION)
Current SYSTEM SQL environment is version V6.0-0 (MULTIVERSION)
Current SYSTEM Rdb/Dispatch environment is version V6.0-1 (MULTIVERSION)

Again thanks for your help...
4992.4DUCATI::LASTOVICAIs it possible to be totally partial?Tue Feb 11 1997 11:5113
from reply .1:

The SQLCA will have this information once the statement executes.  Please read
the SQLCA appendix in the SQL Reference Manual (SQLERRD).

	As you your specific question, check out
the program examples in RDM$DEMO (such as C_SAMPLE.RC).

>Current PROCESS DEC Rdb environment is version V6.0-0 (MULTIVERSION)

	and finally, it is time to upgrade to a more current version
of Rdb.  V6.0 was released 3 years ago and there have been hundreds
of bug fixes since then.
4992.5WEORG::GREMBOWICZWed Feb 12 1997 08:5712
    
    >the program examples in RDM$DEMO (such as C_SAMPLE.RC).
    
    Unfortunately, that is an RDO example, not an SQL example.  The dynamic
    SQL examples are called sql_dynamic*.c.  However, those examples don't
    show using SQLERRD to get the row count although you can, with the
    third element of the SQLERRD array, SQLCA.SQLERRD[2] in C.  
    
    Helen