Click here to Skip to main content
16,021,125 members

Comments by carlos.ma (Top 3 by date)

carlos.ma 11-Oct-12 12:30pm View    
Hi, I have tested your query and it's running ok, so I think that the problem may be the type of data that you are using for the columns or if the second table (product1) doesn't allow null values for the rest of the fields that are not being inserted. It could help if you specify the type of error you are getting from SQL.
carlos.ma 11-Oct-12 10:50am View    
Ok, no problem, I'll explain you what I did here. I think the key point is when the count var value is 2, if this happens then it means that our value has at least 2 special characters so there is no need to continue the search; that's why the code just trims the content of the value from the begin to the appearance of the second special character. The code uses lastIndexOf instead of indexOf because if the second special character was the same that the first one then it would trim the value from the begin to the apperance of the first special character; for instance let's say that our value was "myname//", then using indexOf the result would be "myname", but with lastIndexOf the result will be "myname/". I hope I've made a good explanation, however if you have any doubt or comment let me know and I'll check it.
carlos.ma 8-Oct-12 15:26pm View    
Could you share your code to see how you are trying to do that, please?