|
-
May 19th, 2013, 06:53 PM
#1
Thread Starter
Hyperactive Member
Writing an "empty" string to a MS SQL 7 database.
Am using a non MS language that doesn't recognise the concept of NULL or EMPTY fields.
When I update the table, standard ODBC connection, it writes NULL into the table fields for any variable that doesn't have a value.
Is it possible to send a character string/ESC sequence to MS SQL telling it to insert an EMPTY field rather than a NULL field?
Am unable to touch the actual SQL database, i.e provide a trigger, as it's not ours to modify.
-
May 19th, 2013, 07:17 PM
#2
Re: Writing an "empty" string to a MS SQL 7 database.
Well...
Show us the code anyway - who cares if it's a non MS language - I still want to see what you are doing.
How could I suggest a solution without seeing what you are trying?
-
May 19th, 2013, 08:19 PM
#3
Thread Starter
Hyperactive Member
Re: Writing an "empty" string to a MS SQL 7 database.
 Originally Posted by szlamany
Well...
Show us the code anyway - who cares if it's a non MS language - I still want to see what you are doing.
How could I suggest a solution without seeing what you are trying?
I would have thought the question was blatantly obvious, can you write a string to a MS SQL database that will enforce it to update a field to being an empty field.
I could post some code but it really wouldn't help you unless you understand the concepts of Multi-value coding, D3 ODBC handling, and OpenDB global triggers
-
May 20th, 2013, 04:23 AM
#4
Re: Writing an "empty" string to a MS SQL 7 database.
The question is not totally obvious, as there are important things we don't know... hence why you were asked for some clarification (even if the code isn't 'easy' for us, it would almost certainly help us, and also make it easier for us to give examples).
My thoughts after reading the first post were that if you are using an SQL statement (with or without parameters) to write to the database, the issue can probably be solved by fairly simple string building. If not, a possible solution is to run an Update afterwards.
-
May 20th, 2013, 09:40 AM
#5
Re: Writing an "empty" string to a MS SQL 7 database.
in short - yes, you can construct a SQL statement to insert or update an empty string: UPDATE SomeTable SET SomeField = '' WHERE someotherField = 'SomeValue'
-tg
-
May 20th, 2013, 01:19 PM
#6
Thread Starter
Hyperactive Member
Re: Writing an "empty" string to a MS SQL 7 database.
 Originally Posted by si_the_geek
The question is not totally obvious, as there are important things we don't know... hence why you were asked for some clarification (even if the code isn't 'easy' for us, it would almost certainly help us, and also make it easier for us to give examples).
My thoughts after reading the first post were that if you are using an SQL statement (with or without parameters) to write to the database, the issue can probably be solved by fairly simple string building. If not, a possible solution is to run an Update afterwards.
No wonder people are finding other sites to get help. It would take the size of the db in this product to explain multivalue as it doesn't work like vb or any other MS style language. The code would be meaningless to you folk, the question was simply can you generate something to tell MS SQL to insert an "empty" rather than NULL field. I explained we do not have access to the MS SQL app in order to "run an Update afterwards", though of course a trigger may have been the ideal solution otherwise.
You can close this one as got the answer in five minutes at a site that didn't need code being posted or my life story and who's posters actually read the question and explanations.
For anyone else hitting the same issue, D3 doesn't have the ability to generate "empty" strings to MS SQL in the current or next versions, but there are a few work arounds that the good folk at T-Data and a few other technical sites can point you in the direction of, bit of a kludge. TG thanks for the answer but that's the crux of the problem, was hoping for maybe an escape sequence of some sort that's undocumented. For example in D3 to enforce an empty value in our db we would use either a @VM for a multivalue or an @AM for an attribute
-
May 20th, 2013, 02:36 PM
#7
Re: Writing an "empty" string to a MS SQL 7 database.
There's no need for that kind of attitude, we were clearly just trying to help.
My post was not referring to running things in the database system itself (you had implied that you are capable of sending statements to the database from your app, which my Update suggestion was about [and I presume TG's post was too]), and we certainly did not ask for you to explain multivalue (not surprisingly people here may already know, or be able to easily work out enough, as many of us use multiple languages/databases/etc).
No matter what you think, you had not made things clear - and posting a code sample (even if it is an unknown language) generally gives a lot more clarity than you have given until now.
 Originally Posted by KiwiDexter
You can close this one
That is your task, not ours.
You can do it by clicking on "Thread tools" just above the first post in this thread, then "Mark thread resolved". (like various other features of this site, you need JavaScript enabled in your browser for this to work).
 Originally Posted by KiwiDexter
didn't need code being posted or my life story and who's posters actually read the question and explanations.
That is a ridiculous implication to make, and I find it offensive.
Not being able to give you a perfect answer straight away when you refuse to even comply with a simple request for a code sample does not mean that we didn't read what you wrote - and given that your refusal seems to be based on you not wanting to explain it (which nobody asked for, in fact we blatantly implied we didn't want it), it heavily points at you not paying enough attention.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|