|
This is a bit of topic for this forum, but I can see why many still use DDS.
I'm saying that the SQL error codes and their descriptions are often "flat out wrong" when it comes to the real problem.
Example:
CREATE OR REPLACE VIEW V_SHIP_VIA FOR SYSTEM NAME V_SHIPVIA
(SHIP_VIA_CODE FOR SHPV_CODE,
SHIP_VIA_DESC FOR SHPV_DESC)
AS
(SELECT SUBSTR(RFSLC,1,3) AS SHIP_VIA_CODE,
SUBSTR(RFDTA, 1, 30) AS SHIP_VIA_DESC
FROM ASTDTA.REFERRF
WHERE RFCAT = '0022' AND RFSQ2 = 1 ); This statement yields error:
[SQL7029] New name V_SHIPVIA is not valid.
DSPMSGD...
Display Formatted Message Text
System: TBFPWR7
Message ID . . . . . . . . . : SQL7029
Message file . . . . . . . . : QSQLMSG
Library . . . . . . . . . : QSYS
Message . . . . : New name &3 is not valid.
Cause . . . . . : An attempt was made to rename &1 in &2, but the new name
is not valid. Both the new name and the new system name are valid system
names. If both names are specified in the RENAME statement, only the name
following SYSTEM NAME can be a valid system name.
Recovery . . . : Do one of the following and try the request again:
-- Specify either the new name or the new system name.
-- Change the first name to be a name that is not valid as a system name.
The new name is most certainly valid.
What I discovered (by trial and error) is that assigning the system name for a view where the original name is less that 10 characters, is not valid.
The issue with RDi is that it doesn't provide the message description - navigator does. If RDi is a "development tool" with "development studio" added in, it should AT LEAST yield the message description.
Greg
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of
Vernon Hamberg
Sent: Thursday, October 30, 2014 12:58 PM
To: Rational Developer for IBM i / Websphere Development Studio Client
for System i & iSeries
Subject: Re: [WDSCI-L] Running SQL scripts
SQL errors on IBM i usually have an SQL code (the variable SQLCOD in
RPG). This number is part of an error message, so if the code is 100,
you can see more by putting the error code after SQL to build a message ID.
To see more about SQL code 100 you would do this -
DSPMSGD SQL0100 QSQLMSG
The manual on SQL messages and codes has this instruction -
"Take the absolute value of the SQLCODE, then append it to the letters
″SQL″ (for SQLCODEs less than 10 000) or the letters ″SQ″ (for
SQLCODEs greater than or equal to 10 000) to determine the message identifier."
HTH
Vern
On 10/30/2014 10:01 AM, Gary Thompson wrote:
Greg,
I often find myself at that frustrating point, looking at an SQL error and not getting it.
Happened yesterday when someone asked for help debugging an SQL statement.
Took way too much time to get the answer, even though the error identified an "invalid" component.
I like your 'upstream or downstream' comment . . .
Error handling, to me, is the toughest game in town, and don't
remember ever having a good idea of how to make any SQL error message 'better'.
Frankly, I think the issue is more in my attitude, focus and experience.
I would not try comparing SQL error handling with a high level
language because HLL errors are, to me, easier to trap because they mainly relate to 'one' operation.
For example, I don't recall being stumped by SQL errors in the FROM
clause, which is one part of an SQL statement that I can relate to an HLL program.
To me, an SQL statement is more like an HLL routine.
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Greg
Wilburn
Sent: Thursday, October 30, 2014 8:11 AM
To: 'Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries'
Subject: Re: [WDSCI-L] Running SQL scripts
Ken,
Thanks... this is my first crack at SQL and while I like what it can do, I really despise the lack of "real information" when an error occurs. Most of the time the error message (even in Navigator) is useless... missing a comma here or there, indicating that something is "invalid" when there's an issue upstream or downstream.
Would be nice if there was better syntax checking like in a high level programming language.
Greg
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Ken
Killian
Sent: Thursday, October 30, 2014 8:14 AM
To: Rational Developer for IBM i / Websphere Development Studio
Client for System i & iSeries
Subject: Re: [WDSCI-L] Running SQL scripts
Greg,
Sadly no...
RDI Script is an Addition/Complementary to running SQL Scripts, not a "REPLACEMENT"...
<Big Frown>
I love the ability to test stored procedures from within RDi with the
ability to debug! <smile>
But, at least it gives error feedback, although no highlighting. It has forced me to learn SQL Better. And when I get stuck, I OFTEN have to resort back to good old "Run SQL Scripts" inside of Navigator...
Except for testing stored procedures, I often use SquirrelSQL.org. Because it has bookmarks for commonly run SQL Statements that I run every day/Week. And it also remembers my last 100 SQL Statements. Which is very handy at times.
I really want to use Data Studio more... But, I guess it's navigation drive me personally nuts. Writing and running SQL Scripts should be a SIMPLE, not complicated. I guess I need to use it more myself...
In the Script Writer, you can press F5=Run Sql Script! Very nice! And you can highlight statement to run that single statement! Also very nice!
But, when I try to use the "SQL Query Builder" for a single SQL Statement. I cannot use F5 to run... <frown> Very frustrating. But, it has awesome Code Assist for Fields & Tables! And I can build sql statement visually, sort of...
Data Studio also does NOT have the Visual Explain or the Index
Advisor. Once again you have to go back Navigator. Since IBM does NOT
know how to use "Code Reuse" across their tool platform. <Big Frown>
So, sadly I only use Data-Studio for testing stored-Procedures. Any
SQL I use SquirrelSQL.org or Navigator or good old Green Screen
SQL... <disappointment>
RDi cannot NOT be beat for RPGLE development however!!! <Joy Joy>
-Ken Killian-
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Greg
Wilburn
Sent: Wednesday, October 29, 2014 3:56 PM
To: 'WDSCI-L@xxxxxxxxxxxx'
Subject: [WDSCI-L] Running SQL scripts
I've installed the Developer Studio and have been creating/editing SQL scripts (mostly creating views). I like this a bit better than simply running them through Navigator, but when a script fails it doesn't highlight the problem area like Navigator does.
Is there any way to change this?
--
This is the Rational Developer for IBM i / Websphere Development
Studio Client for System i & iSeries (WDSCI-L) mailing list To post
a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/wdsci-l.
--
This is the Rational Developer for IBM i / Websphere Development
Studio Client for System i & iSeries (WDSCI-L) mailing list To post
a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/wdsci-l.
--
This is the Rational Developer for IBM i / Websphere Development
Studio Client for System i & iSeries (WDSCI-L) mailing list To post
a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/wdsci-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.