|
| |
|
|
maduko
Posts: 168 From: Tulsa OK USA Status: offline
|
Using SPLIT to seperate values - 1/24/2005 12:05:13
Our payment gateway sends back the Order ID field twice (not sure why). So my SQL that puts the info into a database always ends with order ID numbers like: 66.44.105.1-55151.102, 66.44.105.1-55151.102 I only want one stored in the database, not both. What is the correct syntax to disregard the comma and extra text?
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 13:10:59
You may not have to split it. How about something like: <% myField = left(myField,instr(myField,",")-1) %> That should give you everything to the left of the first comma. That any help?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
maduko
Posts: 168 From: Tulsa OK USA Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 14:38:10
Hmmmm... here's the line from the INSERT statement: mySQL= mySQL & SQL_Esc(Request("oid")) & "','" I'm not sure how to incorporate the LEFT into that.
< Message edited by maduko -- 1/24/2005 14:47:04 >
|
|
|
|
Spooky
Posts: 26657 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 14:56:24
mySQL= mySQL & SQL_Esc(Left(Request("oid"),instr(Request("oid"),",")-1) & "','"
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
maduko
Posts: 168 From: Tulsa OK USA Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 15:04:01
I guess I'm not as dense as I thought- that's what I came up with. But this is what I get back: Microsoft VBScript compilation error '800a03ee' Expected ')' /secure/thanks.asp, line 226 mySQL= mySQL & SQL_Esc(Left(Request("oid"),instr(Request("oid"),",")-1) & "','" -------------------------------------------------------------------------------^
|
|
|
|
Spooky
Posts: 26657 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 15:06:27
mySQL= mySQL & SQL_Esc(Left(Request("oid"),instr(Request("oid"),",")-1)) & "','" Not quite enough :-)
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
maduko
Posts: 168 From: Tulsa OK USA Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 15:18:34
Grrrrr..... Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'Left' /secure/thanks.asp, line 226
|
|
|
|
Spooky
Posts: 26657 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 15:20:28
Is Request("oid") filled with a valid entry?
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
maduko
Posts: 168 From: Tulsa OK USA Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 15:35:42
Yes, there isn't really any validuty check on the field.
|
|
|
|
Spooky
Posts: 26657 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 15:44:51
And line 226 is this code? What happens when you use ON ERROR... and response.write mySQL?
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
maduko
Posts: 168 From: Tulsa OK USA Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 16:01:00
I'm sorry- what is the syntax for adding the ON ERROR to this?
|
|
|
|
Spooky
Posts: 26657 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 16:02:59
ON ERROR RESUME NEXT Add a "response.end" if you want to halt the code, and response.write any values before that break. eg : ON ERROR RESUME NEXT ' dodgy code response.write mySQL response.end
_____________________________
If you arent part of the solution, then there is good money to be made prolonging the problem §þ k¥
|
|
|
|
maduko
Posts: 168 From: Tulsa OK USA Status: offline
|
RE: Using SPLIT to seperate values - 1/24/2005 16:16:44
MY APOLOGIES! Maybe a "valid input" would be one with a friggin comma! Duh. Thank you very much.
|
|

New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|