Default values not appearing on INSERT

This problem isn't happening within PB, but I experience the results in PB, 
and know that this group is full of knowledgeable, helpful people. An 
application written in C# puts rows in a table used by our PB application. 
The database is MS2000. This has chortled along OK for a while, but a week 
ago, after a recent compile of the C# application (maybe just coincidence), 
the default values were not inserted into the new rows, causing the PB 
application to get upset. Example, a field with a default of 'N' shows up 
with null.

Here is the code that makes the connection. The offending fields are not 
explicitly referenced in the INSERT statement. We don't know of anything 
having changed on the server side, and all PB inserts, both in the app and 
in the db painter produce the default values. Any ideas?

Please feel free to recommend other newsgrouos.

                  connectionString = "DRIVER={SQL Server};SERVER=" + 
_xxDBServerName + ";" +

                        "DATABASE=" + _xxDBName + ";UID=" + _xxDBUserName + 
";PWD=" + _xxDBPassword + ";";

The values are fount in FWK_ConfigSettings and are similarly named but start 
with ex ..

      EXDBName
     XXTestWebDB

      EXDBUserName
     xxxxxxUser

      EXDBPassword
     xxxxxxxxxx

      EXDBServerName
     XXDEVDB\XXDEVDB



0
Laurel
7/1/2010 2:09:00 PM
sybase.powerbuilder.database 9855 articles. 2 followers. Follow

3 Replies
709 Views

Similar Articles

[PageSpeed] 59

What version of PB and what access method are you using?

I would suggest that the first step is to use SQL Profiler to see the actual 
sql that does the insert.  Also, look at the triggers on the table in 
question to see that they do not interfere.   Would suggest you upgrade to 
SQL Server 2008 R2, many useful features and performance/tools are also much 
better.


"Laurel" <FakeMail@Hotmail.com> wrote in message 
news:4c2ca17c@forums-1-dub...
> This problem isn't happening within PB, but I experience the results in 
> PB, and know that this group is full of knowledgeable, helpful people. An 
> application written in C# puts rows in a table used by our PB application. 
> The database is MS2000. This has chortled along OK for a while, but a week 
> ago, after a recent compile of the C# application (maybe just 
> coincidence), the default values were not inserted into the new rows, 
> causing the PB application to get upset. Example, a field with a default 
> of 'N' shows up with null.
>
> Here is the code that makes the connection. The offending fields are not 
> explicitly referenced in the INSERT statement. We don't know of anything 
> having changed on the server side, and all PB inserts, both in the app and 
> in the db painter produce the default values. Any ideas?
>
> Please feel free to recommend other newsgrouos.
>
>                  connectionString = "DRIVER={SQL Server};SERVER=" + 
> _xxDBServerName + ";" +
>
>                        "DATABASE=" + _xxDBName + ";UID=" + _xxDBUserName + 
> ";PWD=" + _xxDBPassword + ";";
>
> The values are fount in FWK_ConfigSettings and are similarly named but 
> start with ex ..
>
>      EXDBName
>     XXTestWebDB
>
>      EXDBUserName
>     xxxxxxUser
>
>      EXDBPassword
>     xxxxxxxxxx
>
>      EXDBServerName
>     XXDEVDB\XXDEVDB
>
>
> 
0
Tyler
7/2/2010 5:43:21 PM
I'm using PB12, sqlncli, but it's the C#, .NET application that's creating 
the invalid rows.  Doesn't the "DRIVER" in the code below tell us what 
access method is being used?  If I'm understanding your question correctly? 
I'll see if they know how to turn on the profiler.  I'll suggest the same 
way we do it in PB12.

"Tyler Cruse" <tcruse@medteam.net> wrote in message 
news:4c2e2539@forums-1-dub...
> What version of PB and what access method are you using?
>
> I would suggest that the first step is to use SQL Profiler to see the 
> actual sql that does the insert.  Also, look at the triggers on the table 
> in question to see that they do not interfere.   Would suggest you upgrade 
> to SQL Server 2008 R2, many useful features and performance/tools are also 
> much better.
>
>
> "Laurel" <FakeMail@Hotmail.com> wrote in message 
> news:4c2ca17c@forums-1-dub...
>> This problem isn't happening within PB, but I experience the results in 
>> PB, and know that this group is full of knowledgeable, helpful people. An 
>> application written in C# puts rows in a table used by our PB 
>> application. The database is MS2000. This has chortled along OK for a 
>> while, but a week ago, after a recent compile of the C# application 
>> (maybe just coincidence), the default values were not inserted into the 
>> new rows, causing the PB application to get upset. Example, a field with 
>> a default of 'N' shows up with null.
>>
>> Here is the code that makes the connection. The offending fields are not 
>> explicitly referenced in the INSERT statement. We don't know of anything 
>> having changed on the server side, and all PB inserts, both in the app 
>> and in the db painter produce the default values. Any ideas?
>>
>> Please feel free to recommend other newsgrouos.
>>
>>                  connectionString = "DRIVER={SQL Server};SERVER=" + 
>> _xxDBServerName + ";" +
>>
>>                        "DATABASE=" + _xxDBName + ";UID=" + _xxDBUserName 
>> + ";PWD=" + _xxDBPassword + ";";
>>
>> The values are fount in FWK_ConfigSettings and are similarly named but 
>> start with ex ..
>>
>>      EXDBName
>>     XXTestWebDB
>>
>>      EXDBUserName
>>     xxxxxxUser
>>
>>      EXDBPassword
>>     xxxxxxxxxx
>>
>>      EXDBServerName
>>     XXDEVDB\XXDEVDB
>>
>>
>> 


0
Laurel
7/6/2010 2:19:56 AM
The profiler is part of the SQL Server tools from MS and is included.  You 
can use profiler from new versions of SQL Server also.


"Laurel" <FakeMail@Hotmail.com> wrote in message 
news:4c3292cc$1@forums-1-dub...
> I'm using PB12, sqlncli, but it's the C#, .NET application that's creating 
> the invalid rows.  Doesn't the "DRIVER" in the code below tell us what 
> access method is being used?  If I'm understanding your question 
> correctly? I'll see if they know how to turn on the profiler.  I'll 
> suggest the same way we do it in PB12.
>
> "Tyler Cruse" <tcruse@medteam.net> wrote in message 
> news:4c2e2539@forums-1-dub...
>> What version of PB and what access method are you using?
>>
>> I would suggest that the first step is to use SQL Profiler to see the 
>> actual sql that does the insert.  Also, look at the triggers on the table 
>> in question to see that they do not interfere.   Would suggest you 
>> upgrade to SQL Server 2008 R2, many useful features and performance/tools 
>> are also much better.
>>
>>
>> "Laurel" <FakeMail@Hotmail.com> wrote in message 
>> news:4c2ca17c@forums-1-dub...
>>> This problem isn't happening within PB, but I experience the results in 
>>> PB, and know that this group is full of knowledgeable, helpful people. 
>>> An application written in C# puts rows in a table used by our PB 
>>> application. The database is MS2000. This has chortled along OK for a 
>>> while, but a week ago, after a recent compile of the C# application 
>>> (maybe just coincidence), the default values were not inserted into the 
>>> new rows, causing the PB application to get upset. Example, a field with 
>>> a default of 'N' shows up with null.
>>>
>>> Here is the code that makes the connection. The offending fields are not 
>>> explicitly referenced in the INSERT statement. We don't know of anything 
>>> having changed on the server side, and all PB inserts, both in the app 
>>> and in the db painter produce the default values. Any ideas?
>>>
>>> Please feel free to recommend other newsgrouos.
>>>
>>>                  connectionString = "DRIVER={SQL Server};SERVER=" + 
>>> _xxDBServerName + ";" +
>>>
>>>                        "DATABASE=" + _xxDBName + ";UID=" + _xxDBUserName 
>>> + ";PWD=" + _xxDBPassword + ";";
>>>
>>> The values are fount in FWK_ConfigSettings and are similarly named but 
>>> start with ex ..
>>>
>>>      EXDBName
>>>     XXTestWebDB
>>>
>>>      EXDBUserName
>>>     xxxxxxUser
>>>
>>>      EXDBPassword
>>>     xxxxxxxxxx
>>>
>>>      EXDBServerName
>>>     XXDEVDB\XXDEVDB
>>>
>>>
>>>
>
> 
0
Tyler
7/6/2010 9:32:58 PM
Reply:

Similar Artilces:

When Inserting into database, it inserts wrong value
Hi guys, I am inserting values into two column, one called HTMLSize and the other TextSize; both are set as varchar(50) When I insert the values into the database, they get inserted incorrectly and the fields just appear to be empty. However when I write the values into an e-mail later, the values come out correctly, what is going on here!? Dim InsertString as String = "EXEC InsertHistory @HTMLSize, @TextSize" Dim InsertCommand as New SQLCommand(InsertString) With Insertcommand.Parameters: .Add(New SQLParameter(&quo...

PB not accepting default values on database when insert new records
In our database, we have "audit columns" which are populated by triggers, and defined as "not null". When inserting new records via the database painter or a datawindow object, some developers in our group can successfully commit the data when our entries supply only nulls for "audit columns" which have default values defined on the database. It should be this way for all of us, but the majority of us must supply non-null values for these audit columns in order for the data to be committed. This means that something is interfering with the databas...

PB 7 and default column values not triggered or inserted from PB database painter
Is there any reason why PowerBuilder 7 would inconsistently allow inserts to tables with blanks in required fields that have default values defined in the database? About half of our development staff can successfully insert new records into tables via the database painter without providing data for the fields, while the other half must always supply the data in order to insert via the painter. We have run down the problem from the database side with no found issues there. Any insight is appreciated. Thank you Unless you have the empty string is null option set on datawind...

Can't get database values to display in the default Insert form
HI, I am using a GridView and a DetailsView and would like to be able to pre-populate about half of the form fields in the Insert screen of my details view from data in my database. I am using a sqldatasource and storedprocedures (for the "getthedata" and the "insertthedata") and the functionality of those work just fine.  The only problem is that when the user clicks on the NEW link in the details view, all of the form fields are empty and I would like to pre-populate about half of them with the same data that pre-populates the EDIT screen of the details view.&nbs...

getdate() default value / Cannot insert the value NULL into column
I'm not sure if this is a .asp issue or a SQL issue..... i've created a form on a .asp page in dreamweaver.. all fields point to the correct dataset, etc... instead of adding a field for the "date entered" , I've put a getdate() data value in the SQL Express 2005 database field.. so, theoretically, when I submit the form to the database, SQL will fill in this date entered field automatically with the current date/time stamp... but, when I submit the form, I get a message on the web page similar to this: System.Data.OleDb.OleDbException: The statement has been terminate...

How can I insert Null values in my database through my insert method??
Does anybody know if there is a Null method or object I can use here? I want to insert Null values in my table. Protected Sub btnInsert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInsert.Click 'inserts option Dim optionAdapter As New DataSetTableAdapters.OptionsTableAdapter optionAdapter.Insert(txtsort.Text.Trim,txtdescription.Text.Trim,txtcost.Text.Trim,txtprice.Text.Trim,ddloptiontype.SelectedValue,"I want to insert NULL values here") GridView1.DataBind() DropDownList1.DataBind() ddlOpti...

Can connect to Database, but how do I insert values into SQL Database?
I was able to connect to the SQL Database Pension with table clients with table values: ID, State, Name.'Create(connection)Dim conn As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)'open connectionconn.Open()However, I'm not sure how to insert a new row with an incremental ID number and a new State and Name.Sorry, I'm really new with VWD. You need to read about ADO.NET before you do anything. Google it.ASP.NET Hosting (HostingFest)...

Inserting TextBox values to database using SqlDataSource.Insert method
Hi, it is few days I posted here my question, but received no answer. Maybe the problem is just my problem, maybe I put my question some strange way. OK, I try to put it again, more simply. I have few textboxes, their values I need to transport to database. I set SqlDataSource, parameters... and used SqlDataSource.Insert() method. I got NULL values in the database's record. So I tried find problem by using Microsoft's sample code from address http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.insert.aspx. After some changes I tried that code and eve...

Database Default Value vs. Data Window Initial Value
Hi, PB 9. I have a column in the database with a Default value of 0. When I do an InsertRow to a DW, the column is set to NULL instead of the default value. I know that I can set the "Initial Value" in the DW. Is there any way to have PB use the default value from the database without having to do it in each DW where the column exists? Thanks, Chris No, not really. The default values are pretty fixed, and the datawindow painter doesn't query the database to get them when the datawindow is originally created. On 10 Oct 2004 09:40:59 -0700, "Chri...

[Inserting data from form]How to change value of TextBox before inserting it into database by FormParameter?
 How to change value of TextBox before inserting it into database by FormParameter? Here is test script. I would like to create script which add "ok" to value of TextBox with ID="name_pl" and then insert it to database using FromParameter. For example, when I write "let" in TextBox and click "Submit", script insert to database "letok". How to do this? I have tried to do this by adding name_pl = name_pl + "ok"; before links.Insert(); but this cause error "CS0029: Cannot implicitly convert type 'string' to '...

Inserting a default Value
I have populated an SQLdata table from an XML datasource usinmg the bulk command. In my SQL table is a new column that is not in the XML table which I would like to set to a default value. Would anyone know the best way to do this. So far I can's see how to add this value in the Bulk command. I am happy to create a new command that updates all the null values of this field to a default value but can't seem to do this either as a SQLdatasource or a APP Code/ Dataset. Any suggestions or examples where I can do this.Many thanks in advance A DataColumn has a DefaultValue property - see...

Insert Value in DataBase?
    int Max_Id = 0;    string OT = "";    string Final_TypeID = ""; try        {            con.Open();            string sql_Query = "select  isnull(max(counter+1),0)c from Authors";            SqlCommand cmd_Id = new SqlCommand(sql_Query, con);            ...

Default value for Dropdownlist that get's it's value from Database.
Hi, I am using an Object Data Souce to retrieve the value of a Dropdownlist from a table on MS SQL server 2005. I want to make a default value appear on the Dropdownlist intially, should i enter the default value into the database table or is that a better way of doing it? Any suggestions will be very much appreciated. E  No need for database just set sekected value after databingind protected void Page_Load(object sender, EventArgs e) { DataBind(); ListItem defaultItem = new ListItem("Select a Person", "-1"); th...

Databind for default value in INSERT
Hey guys, how can I databind a default value for my textbox in the <InsertItemTemplate>I tried an Eval but it obviously didnt't work. The data source has a Selectcommand with ID that I thought I could use in the insertitem, but i guess not.<asp:FormView ID="FormView2" DataSourceID="SqlDataSource1" runat="server">    <InsertItemTemplate>        Test<br />        <asp:TextBox ID="abc" runat="server" Text='<%# Eval("ID") %>' />    </InsertItemTemplate><...

Web resources about - Default values not appearing on INSERT - sybase.powerbuilder.database

Saturday Night Live characters appearing on Weekend Update - Wikipedia, the free encyclopedia
Weekend Update has been a platform for Saturday Night Live characters to grow and gain popularity ever since Gilda Radner used it to create Emily ...

Facebook’s Five-Star Ratings For Places Appearing In Google Search Results?
Have results from Facebook’s five-star ratings system for places found their way into search results from Google ? continued… New Career Opportunities ...

New photo feature: Options appearing on tagged photos
It appears that Facebook is adding some options on tagged photos. As pointed out to Inside Facebook by Lithuanian reader Aidis Dalikas of Socialus ...

Exclusive: Interview with Jeff Jarrett After Appearing on TNA IMPACT WR - YouTube
IMPACT WRESTLING Airs on Destination America On Wednesday Nights at 9PM E/P. Get tune information, news and more at http://www.impactwrestling.com. ...

Tony Abbott lifts ban on frontbenchers appearing on the ABC's Q&A program
Federal government ministers have been given a green light by Prime Minister Tony Abbott to appear on the ABC program Q&amp;A again.

9 science-backed tricks for appearing smarter than you are
Warning: You might have to give up beer.

Police investigating video appearing to show anti-Semitic chants by West Ham fans
Tottenham have described as "vile and unacceptable" a video appearing to portray West Ham United fans chanting an anti-Semitic song.

Channel Seven reviewing Mark Latham appearing on Sunrise - DailyTelegraph Search Search
HE has quit his Financial Review column, and it seems former federal Labor leader Mark Latham’s status us a commentator on Channel Seven’s Sunrise ...

Gillard rules out appearing on Jones's program
Gillard rules out appearing on Jones's program

Tony Abbott and Q&A: Before the boycott Abbott loved appearing on the ABC show
... his cabinet ministers to boycott the program, but it wasn't always this way. Long before Malcolm Turnbull electrified Twitter by appearing on ...

Resources last updated: 12/24/2015 3:39:51 PM