« first day (29 days earlier)      last day (19 days later) » 

11:47 AM
Hi balpha
 
 
1 hour later…
12:58 PM
hi @spoulson -- sorry, was deep down in bug fixing land :)
 
1:32 PM
me, too
Been racking my brain around this deployment automation crap
 
1:57 PM
Morning guys
 
Morning
 
2:35 PM
morning
 
 
1 hour later…
3:46 PM
@TheUnhandledException around ?
 
@Sathya Now I am
Just finished a bike ride
 
@TheUnhandledException ah welcome back, hope the ride was good ?
 
It was thanks
 
@TheUnhandledException can I bug you with few questions on regexp ?
 
How are you @Sathya?
You sure can!
Welcome to my humble, buggy abode :-)
 
3:50 PM
@TheUnhandledException I'm ok.. trying to see if regexp can solve hours of tedious work
@TheUnhandledException thank you!
 
You'd better not be trying to parse [X]HTML
;-)
 
@TheUnhandledException ah no way!
yes I know about that question on SO
 
Everyone does ;-)
 
@TheUnhandledException :D couple of days ago, someone asked me the same Q, I sent him that link ;)
anyhow, I'm preparing a script to export a bunch of tables from my database & re import them
The export script is like this:
DROP TABLE PGITH_INST_RISK_CHRG_DTL_EXP;
CREATE TABLE PGITH_INST_RISK_CHRG_DTL_EXP AS SELECT * FROM PGITH_INST_RISK_CHRG_DTL WHERE PIRCDH_POL_SYS_ID = FN_GET_POL_SYS_ID(&POL_NO);

DROP TABLE PGITH_INST_RISK_CHRG_DTL_EXP;
CREATE TABLE PGITH_INST_RISK_PREM_DTL_EXP AS SELECT * FROM PGITH_INST_RISK_PREM_DTL WHERE PIRPDH_POL_SYS_ID = FN_GET_POL_SYS_ID(&POL_NO);

DROP TABLE PGITH_INST_RISK_CHRG_DTL_EXP;
CREATE TABLE PGITH_POL_INST_CHARGE_EXP AS SELECT * FROM PGITH_POL_INST_CHARGE WHERE PICH_POL_SYS_ID=FN_GET_POL_SYS_ID(&POL_NO);
.. just that there are about 250 lines of the same sort, with different table names
250 seems to be the magic number for me T_T
 
@Sathya HAHA. yeah. Magically bad :-/
 
3:54 PM
export script is done
the import script is more or less the same, with certain changes
No drop tables statements, which I cleared by doing a regexp find for
> DROP TABLE \w*;
and replace with space
 
replaced create table with insert into using simple find/replace
now comes the part where I'm stuck
the scripts now look like this
INSERT INTO PGITH_INST_RISK_CHRG_DTL_EXP AS SELECT * FROM PGITH_INST_RISK_CHRG_DTL WHERE PIRCDH_POL_SYS_ID = FN_GET_POL_SYS_ID(&POL_NO);


INSERT INTO PGITH_INST_RISK_PREM_DTL_EXP AS SELECT * FROM PGITH_INST_RISK_PREM_DTL WHERE PIRPDH_POL_SYS_ID = FN_GET_POL_SYS_ID(&POL_NO);


INSERT INTO PGITH_POL_INST_CHARGE_EXP AS SELECT * FROM PGITH_POL_INST_CHARGE WHERE PICH_POL_SYS_ID=FN_GET_POL_SYS_ID(&POL_NO);
now I need to swap the table names between insert into and select
ie,
> INSERT INTO PGITH_INST_RISK_CHRG_DTL_EXP AS SELECT * FROM PGITH_INST_RISK_CHRG_DTL
becomes
> INSERT INTO PGITH_INST_RISK_CHRG_DTL AS SELECT * FROM PGITH_INST_RISK_CHRG_DTL_EXP
 
fun
Let me see here
 
I tried regexp find for
> PGI(\w*)
but it selects both the table names :(
the common thing is that
all tables to be "found" start with PGI and end with _EXP
aw crap.
> PGI(\w*_EXP)
seems to do it >_>
 
replace(/INSERT INTO ([^ ]+) AS SELECT \* FROM ([^ ]+)/,'INSERT INTO $2 AS SELECT * FROM $1')
@Sathya Oh, HA, you beat me to it :-)
 
4:01 PM
@TheUnhandledException I'm using notepad++ on Windows :(
 
@Sathya Oh. Did you get it already?
because if not I can create an HTML page for you in 2 minutes which will do it for you
 
how to I select the latter part
the table names after select * from
 
I was using a regex with the SELECT * FROM in it
 
hold on, I'm lost now.
 
Me too :-) Sorry...
 
4:05 PM
@TheUnhandledException no worries, I think I can handle from here.
 
@TheUnhandledException thanks for listening to my rambling
 
If not, I can whip up an HTML page in like 2 minutes which does the regex replace for you
sec, just got an answer that jsfiddle.com is the site I needed for you :-)
 
@TheUnhandledException that will be helpful
 
@Sathya Give me 45 seconds :-)
 
4:07 PM
sure @TheUnhandledException
 
Click "run". You'll get a textbox in the lower right. Paste in SQL, click "submit", that should run the regex
2
 
@TheUnhandledException holy crap.
you just saved me atleast 6 hours of work
 
HAHA, glad I could help :-)
If you know JavaScript style regexes you can just replace the regex in the lower left frame and run again
 
doesn't work for multiple queries, separated y new line ?
 
sec'
forgot the /g flag on the regex
 
4:15 PM
@TheUnhandledException beautiful.
I cannot thank you enough Josh!
 
@Sathya You're very welcome :-)
If you need another regex added to it, just ask
 
@TheUnhandledException I will !
I owe you a beer!
or atleast couple of 'em!
 
Haha, next time you're in NC let me know :-)
 
@TheUnhandledException ofcourse! likewise, if you're coming down to austin!
 
Will do :-)
Now, off for lunch at Saffron -- Local Indian restaurant, I was about to post their link and realized, wow, Google Chrome says the site has a malware infection! Yikes!
 
4:20 PM
@TheUnhandledException yikes
Have a good lunch!
 
need to let their staff know when I get there, maybe I'll get a discount off the buffet lol
@Sathya Thanks!
 
 
2 hours later…
5:56 PM
Fueld up, I return to bugtsting!
 
@TheUnhandledException ditto
 
@Sathya No discounts for letting them know about the malware on their site though, LOL
but they might pay me to fix it! :-D
 
@TheUnhandledException that's even better!
how was the food btw & what did you have ?
 
@Sathya Food was pretty good, not as good as it sometimes is there. For example the Chicken tikka masala, they often don't make enough for the whole day, so by the time I got there it was Chicken fakka masala, that is, quickly fried chicken in the masala sauce as opposed to the real thing which they simmer overnight in the sauce :-)
I had chicken keema (if I'm spelling that right) for the first time, and that was delicious. Very salty, but yummy. Extra spicy :-)
Fresh Naan too, this restaurant stays on top of that :-)
They also had pulao which was very yummy, instead of their usual biryani. I don't like their biryani as well
 
6:23 PM
Damn you @TheUnhandledException you just made my pasta unappetizing and crave for that >_>
oh bloody shoot me
 
breaking my head for the past hour because of my stupidity
 
@Sathya Sounds like my day yesterday. Anything I can help with?
 
@TheUnhandledException nope, figured it
 
6:29 PM
incorrect default values in function header >_>
or rather, mistaken
CREATE OR REPLACE FUNCTION FN_GET_POL_SYS_ID(P_POL_NO         VARCHAR2,
                                             P_POL_END_NO_IDX NUMBER DEFAULT 0,
                                             P_POL_END_SR_NO  NUMBER DEFAULT 09)
damn the paranthesis requirements
 
I never use database functions/procedures. I probably should...
 
7:12 PM
@TheUnhandledException I also highly dislike stored procedures as it divides programming rules.
 
@Cawas I don't necessarily dislike them, although I do agree code and data should be separated
More that I've just never learned how to use them effectively.
I always just code what I need in PHP or w/e
 
I wonder if couchDB have those.
 
7:24 PM
@Cawas elaborate ?
 
@Sathya let's take a stored procedure for inserting for instance. all actual procedures for inserting a new registry are on the front end, let's say php. if you use the SP, it's all except the actual command to insert into the database. then if you have to modify anything, you have to go to the database to adjust it.
that also goes a long way on big static projects... from times to time, things change. now instead of just the annoyance of going to DB yourself, you have to go through the DBA.
from my point of view I can make a parallel of this and stateless / statefull debates.
you guess which one is which.
 
Hmm
 
the only reason SP exists is for performance gain. I highly doubt the benefits from it justify the issues it causes on development.
 
Funny thing among Oracle Forms - you odn't need to write any code for inserts/updates/deletes
that's pretty much why I've never seen a SP being used for inserts
 
that's great
 
7:37 PM
the SPs I work on are processing only
 
like what?
 
@Cawas um, number crunching
 
maybe I just had an awful experience with Santander, a big international bank, and the way they implement oracle there.
 
I work on an insurance product
so the SPs I build/customize/maintain are used for things like premium calculations, billing amongst others
 
well, as long as they are not dependent on the database layouts, I don't see any problem with that.
 
7:39 PM
GUI --> Forms --> Enter data --> Hit button --> data --> sp() --> data --> Forms --> database
 
hmm... so it's basically for queries.
that sounds like a good use for them.
it's like prioritizing critical process which can not be automatically identified by the server.
 
@Cawas what was the front end used ?
 
@Sathya sterling gis, bps... pretty much a proprietary one.
it was also mixed with java, but I didn't work directly on that part.
the bureocracy there was insanely unecessary. and, I think, highly promoted by oracle's design.
 
@Cawas I see
 
but that's not much to do with SPs... procedures are just minor part. I was thinking about regular MS SQL on minor sites, and just recalled it is also bad on big enviroments.
and ASP also promotes using SPs like that.
 
7:55 PM
@Cawas OK
 
@Sathya please, elaborate. :P
 
@Cawas OK == don't know about that,so I'll take your word :P
 
well, as you brought up, it is all about how you use it... but the way things are designed thus directing how to use intuitively ends up building a community knowledge around it. argh, too much philosophy again!
neways, have any of you had a chance to try couchdb in production?
 
8:10 PM
@Cawas Nope, I'm guessing you haven't either ?
 
I havent even tried it. I'm just reading about it and wishing to see it.
 
@Cawas hehe :) I was trying to find in in what way SP's are bad - considering that I haven't seen them being used for anything other than processing
 
@Sathya in classic ASP it's advised to use parametrized queries to avoid SQL injection... and most info you find on internet is about using it is with SPs.
8
Q: Classic ASP SQL Injection Protection

Daniel A. WhiteWhat is a strong way to protect against sql injection for a classic asp app? FYI I am using it with an access DB. (I didnt write the app)

 

« first day (29 days earlier)      last day (19 days later) »