Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 7 Monaten
Letzter Beitrag:
vor 6 Monaten, 3 Wochen
Beteiligte Autoren:
Arie, Fabrice Harari, ICI, Erik Schwarz

WD21 - all fileds are NOT NULL in sqlserver

Startbeitrag von Arie am 20.01.2017 19:45

Hi again,

in addition to my previous post about the FIC extension, I'm now facing another challenge.
Dozens of tables are coming from an old WX version, maybe even V9.
At that time the NULL were not supported yet. All the fields in these tables are now create with the NOT NULL option in sql-server.
Which basuicly means the application can not save any record, because a lot of fields just an be empty, like a customer phonenumber. It is not required to fill the phonenumber in my app.

I can do that by hand (change the type of the file to hfsql, save, open the items and change each and every item to "null supported").

Is there a fast way to change all these tables in my analysis to "null supported"?

Antworten:

Hi Arie,

I'm not sure I understand the question. Even if null is not supported, you can save your phone number with an empty string content (I've been doing that for 20+ years, without using null anywhere).

So why do you say that you cannot save your records?

Best regards

von Fabrice Harari - am 20.01.2017 19:57
Fabrice,

I get this error on a number of fields, as far as I can tell now it are all date fields, fields holding the ID of a child record (like an productgroup) and memo fields (for saving logo, images and so on).
Looks like the HF framework tries to put NULL values in those fields, not empty strings. Which is good as such. But some of the tables are created with NOT NULL for all fields.

That said : it was just an exercise to see how much impact a switch to mssql would have. It definitely not a matter of flipping the switch. I did not expect that to be honest, but just thougt let's give it a chance.

What happened?
OLE DB access error (mandatory item value).
Error Number = 170166

No value defined for item of file.
The item value cannot be NULL.
Failure updating record in database.

Error code: 70710
Level: non-fatal error
WD55 error code: 710



von Arie - am 21.01.2017 10:21
Hi Arie,

I don't have a LOT of experience working with MSSQL. Mostly, it's working on customers system where the production DB is in MSSQL while the test/development one is in HFSQL. I can only tell you that I have never seen a case like what you are describing, even when the DB was develoed in HF first.

Best regards

von Fabrice Harari - am 21.01.2017 15:30
Hi Arie and Fabrice,

I am working most time with MSSQL, nevertheless all description in Analysis is hf.
Within the Analysis I then let create a script for SQL.

So anywhere in the last weeks, I don't remember, I found some tables with all 'not null' like Arie stated.
I don't know when and why it happened :confused:
Maybe it happens while creating an update script, but then it would be a MSSQL issue.

Then, of course, you cannot insert a record, if at least one value is missing.

I changed my scripts and database tables, and it's ok so far (only a few tables have been involved).

If anybody has found the reason, would appreciate to know here.

Greetings

Erik

von Erik Schwarz - am 23.01.2017 07:42
Hi to all
I agree with Arie also.

Few days ago I was install PostGreSQL and MariaDB and do Generate SQL script from analysis so I can import SQL code and create PostGreSQL and MariaDB databases.
Code is imported, databases are created (with some modifications about code page), but SQL code for creating database contain NOT NULL on all fields.
Because of that empty fields are not allowed when import or insert/modify records.
Even in HFSQL analysis if "Null authorized" is checked on field properties, empty fields are allowed with Windev, but with this checked you get "NOT NULL" when creating SQL script for external database.

Also there is a problem with Code pages, but this is not thema for now.

Regards !

von ICI - am 24.01.2017 09:51
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.