Announcement

Collapse
No announcement yet.

Incorrect INSERT INTO

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Incorrect INSERT INTO

    Hi,

    for an INSERT INTO is SC generated the following sql string:

    INSERT INTO dbo.KHKAnsprechpartner (Nummer, Mandant, Adresse, Ansprechpartner, Gruppe, Titel, Vorname, Nachname, "Position", Abteilung, Anrede, Briefanrede, ZuHaendenText, Telefon, Telefax, Mobilfunk, TelefonPrivat, Autotelefon, EMail, Geburtsdatum, Memo, "Timestamp", USER_eMailPrivat, Transferadresse, USER_Newsletter, USER_NewsletterVK, USER_Weihnachsmailing) VALUES (916, 1, 15, 'Test', '', '', '', '', '', '', '', '', '', '-43', '', '', '', '', '', null, '', null, '', '', '', '', '')
    Look at the fields "Position" and "Timestamp" ...

    My form (editable grid) looks like

    sc71_bug_insert_into.jpg

    The sql command should contain only the fields that enabled at the columns insert and/or update ...
    Best regards: - Reinhard -

    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

  • #2
    Hello,

    I did not understand your question very well. I believe these are reserved words and Scriptcase doing treatment with double quotes.
    What is the database you are using? Could you explain a bit more about this problem?
    Best Regards,
    John L. Santos

    Bug Tracker Team
    NetMake - IT Solutions

    Comment


    • #3
      SC generated the SQL script in my first post for a insert instruction (MS SQL database). "Position" and "Timestamp" are reserved words yes, but this fields are not checked for insert / update (see image) and SC should not use this fields for the INSERT INTO instruction.

      I can't change this INSERT INTO instruction in a form (editable grid) ...
      Best regards: - Reinhard -

      I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

      Comment


      • #4
        It this corrected or registered as bug?
        Best regards: - Reinhard -

        I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

        Comment


        • #5
          Hello Reinhard,

          I will verify the bug status with our team.

          regards,
          Bernhard Bernsmann

          Comment


          • #6
            Very old problem... as a workaround you need to change a setting server side and choose to use "" as qualifier.
            A SR ticket is still open for that. Sql Server use [] as standard qualifier...
            Waiting for an update from SC :-(
            Giorgio Bravi
            Dolphin Software & Thinkware
            www.dolphin.it

            Comment


            • #7
              Originally posted by gbravi View Post
              Very old problem...
              The qualifier is my second problem ... the first problem is ...

              The sql command should contain only the fields that enabled at the columns insert and/or update ...
              ... look at the image in first post.

              @bartho: thanks.
              Best regards: - Reinhard -

              I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

              Comment


              • #8
                I see... sorry non idea about that
                Giorgio Bravi
                Dolphin Software & Thinkware
                www.dolphin.it

                Comment


                • #9
                  Hello,

                  This is not a bug. The options displayed in the insert and update settings fields are for the user to choose whether the field should be displayed in insert mode and/or update mode in the generated application.
                  These options are not related to the SQL command.

                  Fields, even if they are not displayed in the application, are used in the SQL command. If you want any values ​​to be entered, you can configure this on Scriptcase or the database itself.


                  Concerning the use of brackets to deal with reserved words in SQL Server with Scriptcase, we recommend that you always use double quotes because Scriptcase uses brackets for global variables and this can create conflicts.
                  If the double quotes does not work, try another driver in the connection settings.
                  Best Regards,
                  John L. Santos

                  Bug Tracker Team
                  NetMake - IT Solutions

                  Comment


                  • #10
                    Originally posted by John L. Santos View Post
                    These options are not related to the SQL command.
                    But that would be useful ...

                    Originally posted by John L. Santos View Post
                    Fields, even if they are not displayed in the application, are used in the SQL command. If you want any values ​​to be entered, you can configure this on Scriptcase or the database itself.
                    How? I have a form (editable grid) and can't influence the sql command ...
                    Best regards: - Reinhard -

                    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

                    Comment


                    • #11
                      Originally posted by RHS View Post
                      But that would be useful ...



                      How? I have a form (editable grid) and can't influence the sql command ...
                      Hello,

                      In the settings of fields there is also a setting to insert and update in the database.
                      Please, see picture for attachment.

                      edit_fields.jpg
                      Last edited by John L. Santos; 01-09-2014, 02:28 PM.
                      Best Regards,
                      John L. Santos

                      Bug Tracker Team
                      NetMake - IT Solutions

                      Comment


                      • #12
                        Yes, but what is now the difference between your image and my in my first post? For me it's still a bug ...
                        Best regards: - Reinhard -

                        I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

                        Comment


                        • #13
                          Hello,

                          This is not a bug. The options displayed in the insert and update settings fields are for the user to choose whether the field should be displayed in insert mode and/or update mode in the generated application.
                          These options are not related to the SQL command.

                          Fields, even if they are not displayed in the application, are used in the SQL command. If you want any values ​​to be entered, you can configure this on Scriptcase or the database itself.

                          What is the value being inserted in your field? If empty value or null value, you can configure this in the settings of DB value (Insert). In his picture of the first post, it is not configured.
                          Best Regards,
                          John L. Santos

                          Bug Tracker Team
                          NetMake - IT Solutions

                          Comment


                          • #14
                            Again slowly ...:

                            The options displayed in the insert and update settings fields are for the user to choose whether the field should be displayed in insert mode and/or update mode in the generated application.
                            These options are not related to the SQL command.
                            Yes. You mean Form Settings / Fields / <fieldname> / Disabled Field ... That's only for display, that's correct.

                            But I mean (and you in post #11) Form Settings / Edit Fields. And here I have no possibility to hide fields (in SQL commands). Try it ...

                            Edit: remove the update flag, save => ok. remove the new flag, save => new and update are checked ... => bug!
                            Last edited by RHS; 01-09-2014, 05:35 PM.
                            Best regards: - Reinhard -

                            I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

                            Comment


                            • #15
                              Hello,

                              Forgive me if I expressed myself badly. When you create a form, Scriptcase interprets all fields in the table, therefore it is impossible not to use a particular field in the SQL command, only if the field does not exist in your table.

                              What I meant is that if you just do not want to display a specific field, you can hide it in the editing fields (like you even know it). However, he will continue to be called in the application's SQL command. Still in the editing fields, you can set it to receive a specific, maybe empty or null value if desired.

                              Well, the SQL command is only displayed if the debug mode is on, or if any SQL error occurs in your application.

                              Originally posted by RHS View Post
                              Try it ...

                              Edit: remove the update flag, save => ok. remove the new flag, save => new and update are checked ... => bug!
                              If you uncheck the options for insert and update, is to say to the field is not displayed. Move down the field, in the fields not displayed block, and then the two options are unchecked.

                              What happens is that if the field is set to be displayed, you can not uncheck both options. The same occurs on the contrary, if the field is set to not be displayed, you can not check any of the options.

                              Anyway, I'll check with the developers to make this clearer in the configuration interface of the fields, but that this is not a bug.
                              Best Regards,
                              John L. Santos

                              Bug Tracker Team
                              NetMake - IT Solutions

                              Comment

                              Working...
                              X