473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Misterious Error in Pro*C

On this piece of code:
When SELECT returns nothing sqlca.sqlcode = 0 and no_data_found_func
isn´t called.
How do I know if the insertion was OK?

EXEC SQL
INSERT INTO TB_SWITCH (
ID_SWITCH,
ID_SITE,
ID_PROPRIETARIO,
CD_OPC,
CD_SWITCH,
DS_TIPO_SWITCH,
DT_CRIACAO
)
(
SELECT
SQ_TBSWITCH.NEXTVAL,
s.id_site,
e.id_empresa,
:sw.cd_opc,
:sw.cd_switch,
:sw.ds_tipo_switch,
SYSDATE
FROM tb_empresa e, tb_site s WHERE
(s.cd_intelig_site = :sw.cd_intelig_site AND s.dt_exclusao IS NULL)
AND (e.nm_empresa = :sw.nm_empresa AND
e.dt_exclusao IS NULL)
AND ROWNUM = 1
);

if (sqlca.sqlcode != 0)
{
fprintf (fpLog, "Error on Insert\n", numReg);
}
}
sqlca.sqlcode is always 0.
How do I know if the insertion was OK, then?

Tks!

Pedro Oguri
Jul 19 '05 #1
1 2866
Hi Pedro,

You should be able to use:

sqlca.sqlerrd[2]

Which will give you the number of rows processed by the last SQL statement

Cheers

Andy
Jul 19 '05 #2

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

Similar topics

2
by: Lance Wynn | last post by:
Hello All, In case the subject wasn't completely clear, I just upgraded to Windows XP Pro from Windows 2000 Pro. All my ASP stuff seems to work, except that when an ASP page generates an error,...
1
by: geek04 | last post by:
i'm using pro*c to precompile my c++ code which accesses oracle 9i database, i'm running a oracle 9i client on my system on compiling the c++ file (generated by pro*c)i'm getting following...
1
by: Scott | last post by:
I'm trying to pull certain Filemaker 5 tables into SQL Server 2000 in an automated import job using a file DSN. Everything resides locally on a Windows XP machine. My process works fine on a test...
1
by: richard turner | last post by:
Access 97 is running on an XP Home machine pulling up a database on an XP Pro machine. The XP Home machine has 512 megs of RAM, the XP Pro machine has 768 megs. Access 97 runs fine on both...
8
by: Seeker | last post by:
Hello, In using Solaris Pro Compiler to compile Pro*C code. I am getting this error: make: Fatal error in reader: parser_proc_online.mk, line 26: Badly formed macro assignment Based on other...
0
by: WebDev2 | last post by:
I can't get AJAX.NET Pro to work. I keep getting a Compiler Error Message: CS0246: The type or namespace name 'AjaxPro' could not be found (are you missing a using directive or an assembly...
3
by: edo | last post by:
I'm currently testing on a local network a website developed in asp It is running IIS - OS 2000 Pro as a server. I can see all .asp pages from every PC client (OS XP, 2000 Pro, WIN95) and from...
0
by: rgettman | last post by:
Hello, I'm attempting to use Pro*C to create a nested table and send that data to a stored procedure as a parameter. However, I'm getting a Pro*C compiler error that I'll describe below. I'm...
1
by: Pedro Oguri | last post by:
On this piece of code: When SELECT returns nothing sqlca.sqlcode = 0 and no_data_found_func isn´t called. How do I know if the insertion was OK? EXEC SQL INSERT INTO TB_SWITCH ( ID_SWITCH,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.