Some days are just harder than others. And today, is a hard day. Yesterday was also hard. And after eleven hours worth of wrangling…useless. I had to throw it all away and start over.
It isn't that what I'm doing is all that hard, really. Or at least, it shouldn't be. I'm having to use the 'openquery' routine in SQL Server to hit up an Oracle box.
But I can't see the box I'm hitting. So I'm querying blind. I can't just go look at the tables, because I don't have direct access. It's complicated – I can query them through a link server, but I can't…
look at it.
This is not usually that big a deal. Honest. The actual query is a tad longer than this, but roughly something like this:
INSERT INTO MYTABLE
(ID, AMT_PAID, AMT_CRD, INV_NUM, BLAHBLAHBLAH)
(SELECT * FROM OPENQUERY (ORACLEBOX, 'SELECT ID, AMT_PAID, AMT_CRD, INV_NUM, BLAHBLAHBLAH FROM T_THISORTHAT WHERE INV_DATE > ' '01-APR-2006' ') C)
See? How hard can that be? Run!
Error: Server 1627, user not recognized.Damn it. {Exit application, come back in} Run! (Why this works is beyond me, but it does.)
Error: Line 402, error near ')'Damn. It. Uuuuuuuuuh, OK, extra comma. Take out comma. Run!
Error: Line 402, error near ')' Is not! RUN!
Error: Line 402, error near ')' Is not! RUN!
Error: Line 402, error near ')' Is NOT, you lying sack of - !! RUN!
Error: Line 402, error near ')' See, now, if it didn't work the first twelve times, generally speaking, this is a subtle hint that it will not work the
next twelve times, either. Undaunted, I keep hitting F5 like maybe
this time, it will just sort of ignore the error and run my query.
Eventually, it dawns on me that this isn't going to happen. Combing through all lines, I find the error is not on line 402, it is on line 8. @*^&@.
Fix the error on the line 8. Run.
Error: Line 402, error near ')'Oh, right. The comma I took out earlier. That actually belonged there. Heh heh. I knew that. Put comma back in. Run!!
Error. Line or field data would be truncated. Operation terminated.@(*^&@O&^*@&^@*^&@(?*^?&!?^*&@?^*(&@#$^*(&!&*(^!!!!!!!!!!!!!!
Just truncate the freakin' data, I don't care!!!!!!!!!!!
**sigh**
ALTER TABLE MYTABLE {add ludicrous amounts of character space to all fields, don't give a crap about it really I'm going to delete the table right after I finish this FREAKING project} {freakin' truncating the space of the stupid PO numbers who the HECK built this piece of crap Oracle box in the first place WHY can't we just have a standardized grumble grouse kvetch}
RUN!
Error: MSDORA error 29672b2968ui20672q: Field or table does not exist.What field? Which one didn't you find? **sigh** {Query Oracle table with dummy where parameters to get field names [because I can't just look and see them], fix the typo and move on}
RUN! Run like the WIND! RUN FOR YOUR LIFE!!!!!!!!
{…processing…}
Go make
delicious Lean Pocket for breakfast.
{…processing…}
Eat Lean Pocket. Try to act cheerful and not grimace, even though it tastes like turkey-scented cardboard.
{…processing…}
Work Sudoku Pacific in newspaper, at which I suck
{…processing…}
Answer some emails.
{…processing…}
Stomp a few other fires burning elsewhere in Corporate America
{…processing…}
Do some laundry
{…processing…}
Organize the closet
{…processing…}
Knit a few rows of the scarf I meant to make myself months ago
{…processing…}
Call for refill of drugs (mmm…drugs…), read Wall Street Journal
{…processing…}…????
At this point, 9:45 p.m., after fourteen hours of inattention to detail, I realize that I am:
a) using the wrong instance of Oracle
b) returning all 35,000,000 rows instead of just a subset of them due to having forgotten the second half of the 'where' statement, and
c) not cut out for this job and should return to being a stay at home mom, where the most challenging thing presented is how to draw a castle with rainbow starfish ponies on it
This morning I came back at it and actually, it's going better. I dropped and rewrote my tables, redid my openquery (with full where statements this time, TYVM) and now I've got all my data. Yup. I've got all 250,000 lines of information. Sitting there. In my tables.
It's just that…uh…well. I can't really remember, ahem, what I was planning to
do with this information, once I got it.
I'm serious.
I can't remember where I was
going with it. I was doing something with the credits and the debits and was going to compare them with…some…other thing…to do a kind of rebill thing…but I can't remember where.
There are eight distinct sales programs residing on three different SQL servers, with about two dozen linked Oracle servers housing various data regarding some, all, or none of them. What I need is…somewhere out there.
At least, I'm pretty sure it is. But my notes about what I'm doing look like they were written by a drunk monkey (well, I
am taking hyoscyamine) and I think I may have mixed two different phone calls on the same sheet of paper and besides – I don't see what a Fidelity IRA has to do with
anything.
****sigh****
It's going to be a loooooooooong day.