Query takes a long time and then crashes............???
-
I'm working on an
ASP.Net application
accessing couple of database tables fromAS400 mainframe server database
. In the code there's an SQL Query, which seems very complicated to me, the person who did the actual coding is no more with our firm. Right now the query is producing some kinda result which is wrong. So can anyone please help me out in finding what's wrong with the SQL query? The SQL query is attached below:Me.OdbcSelectCommand2.CommandText = "SELECT SAMFILE.STAYP.SCLINT, SAMFILE.STAYP.SADMHH, SAMFILE.STAYP.SADMYY, SAMFILE.STAYP.SADMMM, SAMFILE.STAYP.SBLDG, SAMFILE.STAYP.SADMDD, SAMFILE.STAYP.STRMCD, SAMFILE.STAYP.STRMHH, SAMFILE.STAYP.STRMYY, SAMFILE.STAYP.STRMMM, SAMFILE.STAYP.STRMDD, SAMFILE.CLIENTP.CNAME, SAMFILE.CLIENTP.CRACE1, SAMFILE.CLIENTP.CRACE2, SAMFILE.CLIENTP.CRELIG, SAMFILE.CLIENTP.CSEX, SAMFILE.CLIENTP.CBTHHH, SAMFILE.CLIENTP.CBTHYY, SAMFILE.CLIENTP.CBTHMM, SAMFILE.CLIENTP.CBTHDD, SAMFILE.REFSRP.REFSDS, SAMFILE.STAYP.SMDPM, SAMFILE.STAYP.SREFRL, SAMFILE.STAYP.SADRG1, SAMFILE.STAYP.SADRG2, SAMFILE.RACETP.RACEDS, SAMFILE.RELIGP.RELGDS, SAMFILE.STAYP.SADMAG FROM SAMFILE.REFSRP, SAMFILE.RELIGP, SAMFILE.RACETP, { oj SAMFILE.STAYP LEFT OUTER "JOIN SAMFILE.CLIENTP ON SAMFILE.STAYP.SCLINT = SAMFILE.CLIENTP.""CLNT#""} WHERE SAMFILE.REFSRP.REFSCD = SAMFILE.STAYP.SREFRL AND SAMFILE.RELIGP.RELGCD = SAMFILE.CLIENTP.CRELIG AND SAMFILE.RACETP.RACECD = SAMFILE.CLIENTP.CRACE1" // After some loop conditions, the OdbcSelectCommand2 is used in 4 concatenations like this. OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND (({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(SADMHH), digits(SADMYY)) }, '-') }, digits(SADMMM)) }, '-') }, digits(SADMDD)) } <= { d '" & End_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND ({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(STRMHH), digits(STRMYY)) }, '-') }, digits(STRMMM)) }, '-') }, digits(STRMDD)) } >= { d '" & Start_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " OR ({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(SADMHH), digits(SADMYY)) }, '-') }, digits(SADMMM)) }, '-') }, digits(SADMDD)) } <= { d '" & End_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND (SAMFILE.STAYP.STRMCD = 0))" // To get the desired result, one more table is suppossed to be u
-
I'm working on an
ASP.Net application
accessing couple of database tables fromAS400 mainframe server database
. In the code there's an SQL Query, which seems very complicated to me, the person who did the actual coding is no more with our firm. Right now the query is producing some kinda result which is wrong. So can anyone please help me out in finding what's wrong with the SQL query? The SQL query is attached below:Me.OdbcSelectCommand2.CommandText = "SELECT SAMFILE.STAYP.SCLINT, SAMFILE.STAYP.SADMHH, SAMFILE.STAYP.SADMYY, SAMFILE.STAYP.SADMMM, SAMFILE.STAYP.SBLDG, SAMFILE.STAYP.SADMDD, SAMFILE.STAYP.STRMCD, SAMFILE.STAYP.STRMHH, SAMFILE.STAYP.STRMYY, SAMFILE.STAYP.STRMMM, SAMFILE.STAYP.STRMDD, SAMFILE.CLIENTP.CNAME, SAMFILE.CLIENTP.CRACE1, SAMFILE.CLIENTP.CRACE2, SAMFILE.CLIENTP.CRELIG, SAMFILE.CLIENTP.CSEX, SAMFILE.CLIENTP.CBTHHH, SAMFILE.CLIENTP.CBTHYY, SAMFILE.CLIENTP.CBTHMM, SAMFILE.CLIENTP.CBTHDD, SAMFILE.REFSRP.REFSDS, SAMFILE.STAYP.SMDPM, SAMFILE.STAYP.SREFRL, SAMFILE.STAYP.SADRG1, SAMFILE.STAYP.SADRG2, SAMFILE.RACETP.RACEDS, SAMFILE.RELIGP.RELGDS, SAMFILE.STAYP.SADMAG FROM SAMFILE.REFSRP, SAMFILE.RELIGP, SAMFILE.RACETP, { oj SAMFILE.STAYP LEFT OUTER "JOIN SAMFILE.CLIENTP ON SAMFILE.STAYP.SCLINT = SAMFILE.CLIENTP.""CLNT#""} WHERE SAMFILE.REFSRP.REFSCD = SAMFILE.STAYP.SREFRL AND SAMFILE.RELIGP.RELGCD = SAMFILE.CLIENTP.CRELIG AND SAMFILE.RACETP.RACECD = SAMFILE.CLIENTP.CRACE1" // After some loop conditions, the OdbcSelectCommand2 is used in 4 concatenations like this. OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND (({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(SADMHH), digits(SADMYY)) }, '-') }, digits(SADMMM)) }, '-') }, digits(SADMDD)) } <= { d '" & End_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND ({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(STRMHH), digits(STRMYY)) }, '-') }, digits(STRMMM)) }, '-') }, digits(STRMDD)) } >= { d '" & Start_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " OR ({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(SADMHH), digits(SADMYY)) }, '-') }, digits(SADMMM)) }, '-') }, digits(SADMDD)) } <= { d '" & End_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND (SAMFILE.STAYP.STRMCD = 0))" // To get the desired result, one more table is suppossed to be u
YOu say the query "shoots up an error message". Care to post it? we're not psychics.
-
YOu say the query "shoots up an error message". Care to post it? we're not psychics.
cool down bro........!!! reg. the erro msg : whn i add this piece of code in the end of the SQL string (
SAMFILE.MOVESP.MCODE = ""A""
), the error message is : ERROR [42S22] [IBM][iSeries ACCESS ODBC Driver][DB2 UDB]SQL0206 - Column A not in specified tables. and whn I change it to :SAMFILE.MOVESP.MCODE = 'A'
, it takes a long time to process the webpage and after a prolonged period of time, shows the "Page cannot be displayed" error message. -
cool down bro........!!! reg. the erro msg : whn i add this piece of code in the end of the SQL string (
SAMFILE.MOVESP.MCODE = ""A""
), the error message is : ERROR [42S22] [IBM][iSeries ACCESS ODBC Driver][DB2 UDB]SQL0206 - Column A not in specified tables. and whn I change it to :SAMFILE.MOVESP.MCODE = 'A'
, it takes a long time to process the webpage and after a prolonged period of time, shows the "Page cannot be displayed" error message.Just fishing here, but is journaling enabled on the AS/400 file?
-
Just fishing here, but is journaling enabled on the AS/400 file?
-
Just fishing here, but is journaling enabled on the AS/400 file?
without the last piece of code [
SAMFILE.MOVESP.MCODE = A
] also, this query works but it gives an incorrect result. and the only code which can fetch the true values wud be if we include theMCODE
code. -
look dear, if u can put in some valuable comments, pls go ahead, otherwise dont try to rule anybody, u get tht.
-
I'm working on an
ASP.Net application
accessing couple of database tables fromAS400 mainframe server database
. In the code there's an SQL Query, which seems very complicated to me, the person who did the actual coding is no more with our firm. Right now the query is producing some kinda result which is wrong. So can anyone please help me out in finding what's wrong with the SQL query? The SQL query is attached below:Me.OdbcSelectCommand2.CommandText = "SELECT SAMFILE.STAYP.SCLINT, SAMFILE.STAYP.SADMHH, SAMFILE.STAYP.SADMYY, SAMFILE.STAYP.SADMMM, SAMFILE.STAYP.SBLDG, SAMFILE.STAYP.SADMDD, SAMFILE.STAYP.STRMCD, SAMFILE.STAYP.STRMHH, SAMFILE.STAYP.STRMYY, SAMFILE.STAYP.STRMMM, SAMFILE.STAYP.STRMDD, SAMFILE.CLIENTP.CNAME, SAMFILE.CLIENTP.CRACE1, SAMFILE.CLIENTP.CRACE2, SAMFILE.CLIENTP.CRELIG, SAMFILE.CLIENTP.CSEX, SAMFILE.CLIENTP.CBTHHH, SAMFILE.CLIENTP.CBTHYY, SAMFILE.CLIENTP.CBTHMM, SAMFILE.CLIENTP.CBTHDD, SAMFILE.REFSRP.REFSDS, SAMFILE.STAYP.SMDPM, SAMFILE.STAYP.SREFRL, SAMFILE.STAYP.SADRG1, SAMFILE.STAYP.SADRG2, SAMFILE.RACETP.RACEDS, SAMFILE.RELIGP.RELGDS, SAMFILE.STAYP.SADMAG FROM SAMFILE.REFSRP, SAMFILE.RELIGP, SAMFILE.RACETP, { oj SAMFILE.STAYP LEFT OUTER "JOIN SAMFILE.CLIENTP ON SAMFILE.STAYP.SCLINT = SAMFILE.CLIENTP.""CLNT#""} WHERE SAMFILE.REFSRP.REFSCD = SAMFILE.STAYP.SREFRL AND SAMFILE.RELIGP.RELGCD = SAMFILE.CLIENTP.CRELIG AND SAMFILE.RACETP.RACECD = SAMFILE.CLIENTP.CRACE1" // After some loop conditions, the OdbcSelectCommand2 is used in 4 concatenations like this. OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND (({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(SADMHH), digits(SADMYY)) }, '-') }, digits(SADMMM)) }, '-') }, digits(SADMDD)) } <= { d '" & End_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND ({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(STRMHH), digits(STRMYY)) }, '-') }, digits(STRMMM)) }, '-') }, digits(STRMDD)) } >= { d '" & Start_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " OR ({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT({ fn CONCAT(digits(SADMHH), digits(SADMYY)) }, '-') }, digits(SADMMM)) }, '-') }, digits(SADMDD)) } <= { d '" & End_date_conv & "' })"OdbcSelectCommand2.CommandText = OdbcSelectCommand2.CommandText & " AND (SAMFILE.STAYP.STRMCD = 0))" // To get the desired result, one more table is suppossed to be u
-
without the last piece of code [
SAMFILE.MOVESP.MCODE = A
] also, this query works but it gives an incorrect result. and the only code which can fetch the true values wud be if we include theMCODE
code.I think your problem is outside the scope of this forum, and maybe of any forum here.
-
Have you tried getting a wrking query directly against the database without involving odbc? When it works there inclue it in your asp page.
Bob Ashfield Consultants Ltd
as mentioned, the database is on AS/400 Mainframe server. without odbc how can i chk the query. can u guide me on how to proceed with this?
-
look dear, if u can put in some valuable comments, pls go ahead, otherwise dont try to rule anybody, u get tht.
-
Please stop it.
modified on Tuesday, December 9, 2008 3:36 PM
-
Please stop it.
modified on Tuesday, December 9, 2008 3:36 PM
-
Nice job changing that old post I linked to. Still I saw it so, fuck off asshole.
led mike
very bad Led......i'm surprised who ur employer is...........
-
very bad Led......i'm surprised who ur employer is...........
Perhaps, however
Reality Strikes wrote:
please have basic manners
you proved you are a giant hypocritical turd with that post given your reply to Graus which you have now deleted in an attempt to hide the truth thereby also proving you are without honor and integrity. So for the last time (today), fuck off asshole.
led mike
-
Perhaps, however
Reality Strikes wrote:
please have basic manners
you proved you are a giant hypocritical turd with that post given your reply to Graus which you have now deleted in an attempt to hide the truth thereby also proving you are without honor and integrity. So for the last time (today), fuck off asshole.
led mike
i dont know wht the heck u r blabbering..........take a day off from u work and relax.........u will feel better........!!!
led mike wrote:
So for the last time (today), f*** off a**hole.
why making it the last time, say it over and over..........coz thts wht ur parents taught u..........say it very proudly.........!!!
-
i dont know wht the heck u r blabbering..........take a day off from u work and relax.........u will feel better........!!!
led mike wrote:
So for the last time (today), f*** off a**hole.
why making it the last time, say it over and over..........coz thts wht ur parents taught u..........say it very proudly.........!!!
-
Reality Strikes wrote:
i dont know wht the heck u r blabbering
Good, now we can add "lying sack of shit" to your description.
led mike
didnt u see tht icon next to ur name..........seems u r in deep s*** man.........!!! u r crude uncouth ill-bred person lacking culture or refinement and we prefer calling thm as BARBARIANS.
-
as mentioned, the database is on AS/400 Mainframe server. without odbc how can i chk the query. can u guide me on how to proceed with this?
-
didnt u see tht icon next to ur name..........seems u r in deep s*** man.........!!! u r crude uncouth ill-bred person lacking culture or refinement and we prefer calling thm as BARBARIANS.