Ian, eons ago I arranged a tools developer to work with you. Since then I
haven't heard back from you. If she was not able to help you why didn't
you contact me?
We emailed back and forth once or twice. The general belief she has was
that everything behaved as designed; and she stopped responding to me.
i didn't mention it to you cause, as you indicated, the UI tools weren't
really your thing. Didn't really want to harass you on something that isn't
yours.
Plus, you were in Japan. :)
>But the fact that "Undo All" doesn't actually Undo All, but instead is a
>"you broke it, but run away and pretend you never touched it" mode.
Did you send in an example? Did you open a PMR?
No. It's not guaranteed reproducable. One would need to use Control Center
for a few hours for it to happen. i didn't open a PMR (without even knowing
what a PMR is), because i don't know what kind of support options (if any)
we have with IBM.
Considering how common the problems are (five out of five developers here),
i assumed they were just limitations of the tools. Also, considering
her resistance to identify problems, i assumed not much could
or would happen to fix them.
>CALL SYSPROC.ALTOBJ ( 'APPLY_CONTINUE_ON_ERROR', 'CREATE TABLE
>SUPERDUDE.PATRONS ( ... ) IN USERSPACE1 ', -1, ? );
That is what the SQL control center runs...
CONTINUE ON ERROR? And you wonder about lack of UNDO?
The "Undo All" is a feature exposed in Control Center. When the table
altering
fails in, you have an "Undo All" button.
i don't (shouldn't) need an "undo" option when running ALTOBJ myself, since
it is (should be) atomic. i suppose i could wrap it in BEGIN TRANS/ROLLBACK
TRANS
myself.
You don't need to. Just leave the parameter markers for the OUT
parameters.
It does seems to work from the IBM command line utility. If you actually
send the SQL to the server:
CALL SYSPROC.ALTOBJ ('APPLY_CONTINUE_ON_ERROR', 'CREATE TABLE TestFoo
(PatronID int NOT NULL, PatronName varchar(25) NULL)', -1, ?)
you get the error:
Error: CLI0100E Wrong number of parameters. SQLSTATE=07001 (State:07001,
Native Code: FFFE7961)
The table is in the Load Pending state. A previous LOAD
attempt on this table resulted in failure. No access to the table
is allowed until the LOAD operation is restarted or terminated.
....
3 Restart or terminate the previously failed LOAD operation on
this table by issuing LOAD with the RESTART or TERMINATE option
respectively.
Ummm....i have no LOAD operation. i called a stored procedure though.
Mixed case.. now that should be quite a hint. I bet your table is
"TESTFOO" and not "TestFoo", right?
Mixed case? Everything is stored in DB2 as uppercase right?
Everything is converted to uppercase unless quoted?
DB2 is case insensitive that way???
>Okay, so using Control Center, and any SQL it generates is out. Also,
>using ALTOBJ is out.
Because you didn't look up the error messages and you used ON ERROR
CONTINUE.
Well we can't have customers using Control Center either way. Also,
Control Center is using "ON ERROR CONTINUE".
But yes, i used ON ERROR CONTINUE. Still, it's not like i know how to fix
it. i'm more from the school that the server should do that - MSSQL can
do such structure changes without failing.
How about this error:
SQL0443N Routine "ALTOBJ" (specific name "*OBJ") has returned an error
SQLSTATE with diagnostic text "SQL0204 Reason code or token:
SUPERDUDE.OCCURRENCE_VIDEOS". SQLSTATE=38553
(although, IBM admits, this one is a bug fixed in FP12; not that we can
convince the customer to move beyond FP9 in any event. "Your query is
bad. Send us another one.")
>If only we could see the SQL steps that ALTOBJ will run to perform a
>change, and then repair them. Looking back at the documentation for
>ALTOBJ, the first parameter looks interesting:
>>
>GENERATE
>Specifies that all the scripts required by the VALIDATE, APPLY, and UNDO
>modes are to be generated.
Indeed. Maybe we're not all that dumb after all.
Are they being generated and stored somewhere? i see no mention of
where they are generated to.
Still that mixed case table name. Ah yes, you never fixed that. What did
you expect?
i thought DB2 was case insensitve. i thought that, unless quoted, they are
all converted to uppercase.
Both
SELECT * FROM TestFoo
and
SELECT * FROM TeStFoO
work fine. What's the issue again? They're case insensitive *most* of the
time.
you fix that it won't work and it's not ALTOBJ fault, neither the control
center.
Okay, my contrived example has other errors. Issuing of ALTOBJ directly
is not normal. Normal procedure is to right-click on a table in Control
Center and select "Alter". Later when it saves - it fails. Perhaps Control
Center is using mixed case - i doubt it, since i don't see mixed case in it.
That still doesn't explain it's failures.
>1. Never use NOT NULL. If we can't change it, we can't allow it in the
>first place.
You can change it in DB2 9, aside ALTOBJ works.. but you have to sit back
and THINK.
i'm fine with waiting for a table structure to applied. It's part of the
downtime
in doing "updates."
I still don't get what your problem was there, but anyway.
i know. You have to see it. i'll try to detail the symptoms (not the steps
to
reproduce it)
1. Create a table with an IDENTITY and unique index on some integer column
2. Add rows to the table.
3. Use Control Center to alter the table (change varchar to CLOB, or,
change a column from NOT NULL to NULL)
4. Save your table structural changes.
5. The save my or may not fail.
6. Insert new rows into the table, and your unique index on the identity
integer column will fail.
7. Examine the table in Control Center and note that your identity seed
value has been reset to zero rather than what it used to be.
8. Select MAX(intColumnYouUsedInStepOne) FROM sysibm.sysdummy1
9. Update the seed value to the highest value currently in the table.
>But back to the update scripts that we need to send to the customer's IT
>department - which must not lose any live data. What would you do? How
>you use alter tables?
You use ALTOBJ (after fixing your -204 error) to generate the change
script. Validate and test it in house, assuming the schema is fixed.
i'll mention that when using SQL Server, if you make table structural
changes,
and you choose to view the SQL that Enterprise Manager will run to effect
the table changes, you see a series of steps, similar to
i. Start a transaction
ii. Drop all constraints on the table
iii. Make a new table with new structure
iv. Add constraints on the new table.
v. Copy data from the old table to the new table
vi. Drop the old table
vii. Rename the new table to what the old table was.
viii. Add PK and FK's to new table
ix. Commit Transaction.
And if anything fails, the entire operation is rolled back. Data integrity.
The most most most common error we see in Control Center when trying
to alter a table in an SQL statement trying to re-create statistics. If this
were SQL Server, and i was getting an error when it was trying to re-create
statistics, i would comment out the CREATE STATISTICS statement, and
let it complete. (i know what stats are)
>postscript. If this post seems overly hostile, or biased: it is.
Indeed
It is so difficult to explain the problems, when you have to write
everything down. Rather than focusing on the real problems going on
here, instead we're talking about mixed case and ContinueAfterFails...
>DB2 has used up it's point, and i'm now a tired, frustrated, and broken
>man.
*lol*Hey, buy a lottery ticket from your customer :-)
>
i would
>take you up on your offer Serge, but you'd have a room of 5 frustrated
>guys demanding answers.
First you have to count to ten, then we can talk. I'm no sales rep. I'm
not being paid to get yelled at.
No yelling involved. But 4 guys standing around, listening, all wanted to
pipe up and explain the same problems in slightly different ways.
>Perhaps alternativly, you could some some user testing and try to impress
>upon her the problems. She insisted everything is by design.
If you disagree why don't you contact me BEFORE burning bridges by causing
a ruckus which make you look at least as bad as DB2.
i didn't contact you before, cause you was in Japan. Plus, the interface
stuff
was more of her field.
Also, we're fighting a fire trying to update the customer's live system,
while trying to ensure that the scripts run error-free without losing any
data, all the while us not being allowed to touch the live system itself.
Considering we lose database objects, and sometimes data, all the time
here in development, and once on their training side, we're in a bit of a
mode.
Never before have we had to convene a meeting to pull 3 developers off
their regular stuff to try to figure out how to change a column from
NOT NULL to NULL. This has never come up with the other RDBMS
we deal with.
So, why don't we take this off line and you send me an email.
Okay, i'll start an Email.
PS: When a developer kindly agrees (because I ask him/her) to get in
contact with a customer he/she generally doesn't agree to get their names
pasted across the internet.
Oops, i just assumed 'her' name was as unitiquous as "Serge" is. Sorry.