1 2 3 Previous Next 30 Replies Latest reply on Nov 6, 2004 3:06 AM by 807575

    Conversion Error Occurred

      I have a Page1.jsp in JSC, and on it I have two components, both Text Fields.

      I also have a 'button' on this page.

      On click of the button, I have written code to insert the record, to a Pointbase table, using a RowSet added to the page.

      My code works fine, as long as the two text fields are not bound to the rowset.

      But the moment I bind the two text fields to two columns in a Rowset, which I also added to the page, and then press the button, I get the following error:

      "Conversion error occurred".

      This error does not occur if I unbind the text fields to the RowSet items.

      I have tried to use convertors for these text fields, but they don't seem to work. One of them is a text field, and the other in an integer.

      What is the convertor I should be using for a Text Field which is bound to a CHAR type column in an Oracle database, or even Pointbase?


        • 1. Re: Conversion Error Occurred
          I tried the following and it worked:

          Attach NO convertor to the TextField which holds just text and is bound to a CHAR column in the database.

          For the field which is bound to an INTEGER column in the database, I used a Number Comvertor and that worked.

          I wonder why an IntegerConvertor did not work?


          • 2. Re: Conversion Error Occurred
            When I use this with Oracle 8i database, I keep getting an error:
            Conversion error occurred.
            My oracle column is CHAR, and I've tried all the convertors for the TextField which is bound to it.

            Something seems strange....is it the Oracle driver? Looks like it is working okay with Pointbase.

            • 3. Re: Conversion Error Occurred
              Hi Haroon - a few questions :

              - are you using the default drivers which come w/Creator?

              - when you open the table in the server navigator, you can click on the columns which are giving you trouble and see the properties in the property sheet - what values are shown for SQL TYPE and TYPE NAME properties?

              - if possible, can you go into sqlplus and do a desc on that table and post the results? that way we can check it out here more easily.

              - are null values allowed in the column?

              • 4. Re: Conversion Error Occurred
                -Yes, I am using the default drivers provided with Creator

                - Values shown for the troble column in the database:
                SQL TYPE - CHAR
                TYPE NAME - CHAR
                COLUMN SIZE - 250

                - Null Values are allowed

                - SQL PLUS Post

                RESOURCE_URL CHAR(250)
                RESOURCE_LINK CHAR(250)

                -Database is Oracle 8i

                Thanks for your help.


                • 5. Re: Conversion Error Occurred
                  Thanks Haroon - I'll look into it.

                  Out of curiousity, did you try varchar2's? I think that's the one we most commonly see on Oracle - but the char should work too...

                  • 6. Re: Conversion Error Occurred
                    Thanks again.

                    Tried VARCHAR2, as well. Same problem. The moment I 'unbind' from database, the problem goes away, but then I can't use that feature anymore.

                    Just moved from my trial copy to a paid subscription, so am keen to get this feature to work.

                    You guys are giving great help, thanks!

                    Let me know if there's anything else I can do to sort this issue out.


                    • 7. Re: Conversion Error Occurred
                      Thanks Haroon!

                      Did you download the AppModel example? Look at the page simple.jsp - I think it's doing exactly what you're looking for - as does the Insert Update Delete tutorial. Have you gone through those yet?

                      Rereading the thread- I want to make sure I'm understanding -
                      - Were you successful inserting into Pointbase with bound textfields? The tutorial works fine for me there. If that hasn't worked for you, we should start by troubleshooting there.

                      - Are you using the default converters (which Creator applies the first time a component is bound) or are you using some others? What happens if you bind the textfields to the database, and then remove the converters entirely? Since the columns are char's, I would think that the converter really isn't necessary... unless you have your own custom converter etc...

                      - I assume you have a message list component (or a message component for each textfield) on your page - this may give you more info.

                      Sorry this is taking so long!! If you can make a simple 1 page example of what you're doing, it might make sense for you to send in your project... then we can work on that together....

                      • 8. Re: Conversion Error Occurred
                        I have created a one page project, which captures the problem I'm having. I've zipped it to a 1.5 MB file, and can send it to you if you want.

                        But it is pretty basic:
                        I've added 6 components to a page:
                        -2 textfields
                        -1 button
                        -1 MessageList
                        -1 RowSet from Oracle 8i table (let's call it ORA Rowset) It has CHAR type columns
                        -1 RowSet from Poiintbase table (let's call it POBS Rowset) It has VARCHAR type columns.

                        I've written absolutely zero code.

                        When I bind the two text fields, to two columns in the ORA RowSet, run the application, and when the page comes up, press the submit button, I get the following error:
                        "textField1" : Conversion Error Occurred

                        When I do the exact same thing with the POBS rowset, and press the submit button, I get no error.

                        Let me know how I can send you the project file, though you would have to use your own database instances.


                        • 9. Re: Conversion Error Occurred
                          Thanks Haroon - please email your project to CreatorFeedback AT sun DOT com and that will come to me!

                          • 10. Re: Conversion Error Occurred
                            Just sent you the file.


                            • 11. Re: Conversion Error Occurred
                              Got it - I'm going to start by changing it to do an insert on scott/tiger 's dept table for starter... so I added one addditonal text field for deptno and am binding the fields.

                              I noticed your code that's commented out does updates - I was under the impression that you were doing inserts? Please clarify which one to start with :)

                              Also I noticed that the concurrency isn't set on the rowsets to CONCUR_UPDATEABLE - so I'm wondering how the pointbase worked at all...?

                              Did you have a chance go through the insert/update/delete tutorial?

                              • 12. Re: Conversion Error Occurred
                                I actually ran the Insert/Update/Delete example and had the following experience:


                                For the project that I've sent you, I'm not even doing any insert/update. Just doing a submit causes the problem of "Conversion Error", even before an update/insert can be attempted. So Update/Insert is not an issue, and I've commented it out.

                                Just clicking on the submit button causes this problem, if the text fields have been bound to an Oracle rowset, and the problem does not occur occur if they are bound to a pointbase rowset.


                                • 13. Re: Conversion Error Occurred
                                  I'm having the same problem with the "Conversion Error Occurred".

                                  This occurs both with SQLServer and Oracle but not with Pointbase.

                                  Has anybody else had this issue? Is anybody else using the databinding feature with Oracle/SQLServer ?


                                  • 14. Re: Conversion Error Occurred
                                    I'm having the same problem. I'm using a SQL Server database.

                                    It's not just TextField components, though. The Conversion Error Occurred message pops up on every component I bind to the database - except OutputText of course. Bound OutputText works fine. It's only the editable fields that produce this error.

                                    I've tried using char, varChar, Integer, you name it. No matter the data type of the database field, the same Conversion Error Occurred message pops up.

                                    I could attach code samples, but it's easy to reproduce - I've done it over and over and over again building numerous small test applications to try to figure out how to get past this problem.

                                    Here's how to replicate the problem.
                                    1)Build any Master/Detail page using a listbox (or any other means) to select the master record and use OutputText, Text, and TextArea fields to show the detail.
                                    2) Add an InlineMessage component for each of your Detail fields to display the 'Conversion Error Occurred' mesage when it happens
                                    3) Add a button to submit the page.
                                    4) Test the application and it will run just fine.
                                    5) Bind the Detail fields to a RowSet from the database.
                                    6) Test the application and it will fail. The Detail fields that are bound using OutputText will display the proper detail data for the master selected. However, all of the editable fields will give the error message.

                                    Again, I could attach code examples, but this problem is way too easy to recreate.

                                    This was not a problem with the Early Access release. I could bind fields to a SQL Server database just fine then.

                                    Ahhh, I long for the good old days of the EA Release.....
                                    1 2 3 Previous Next