Update 1st record that is from an empty set

This is how I created the table:
 
string createString = "CREATE TABLE tAZUID (MWSMerchantID VARCHAR (25), MWSMarketplaceID VARCHAR (25), " +
                "AWSAccessKey VARCHAR (25), AWSSecretKey VARCHAR (50), AWSAssocTag VARCHAR (15))";
            sqlCmd = new FbCommand(createString, maintenanceConn);
            try {
                sqlCmd.ExecuteNonQuery();
            }

Open in new window


This is how I want to update the first row:
 
string updateString = "UPDATE tAZUID SET MWSMerchantID = '" + tbMerchantID.Text + "', " +
            " MWSMarketplaceID = '" + tbMarketplaceID.Text + "', " +
            " AWSAccessKey = '" + tbAWSKey.Text + "', " +
            " AWSSecretKey = '" + tbAWSSecretKey.Text + "', " +
            " AWSAssocTag = '" + tbAZAssocTag.Text + "' ROWS 1";
            sqlCmd = new FbCommand(updateString, databaseConn);
            try {
                sqlCmd.ExecuteNonQuery();
            }

Open in new window


It's not working (nothing gets updated in the table).  What am I doing wrong?
rmmarshAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nick UpsonPrincipal Operations EngineerCommented:
unless you do a commit after the update it won't be visible to another connection (and the 2nd connection needs to commit as well in order to see it)

run the above, commit above, commit watching connection and it should be visible
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rmmarshAuthor Commented:
Hi Nick... COMMIT didn't work... I had to initialize the table's first row with blank values, then I could do the update.  BTW, I am using the Firebird .NET wrapper.

Thanks anyway, I appreciate your help as always!  Happy New Year to you and your family!
0
Nick UpsonPrincipal Operations EngineerCommented:
I just assumed you were doing an insert first, you cannot update what doesn't exist
0
rmmarshAuthor Commented:
Hi Nick... yea, I finally figured that out! :D (I apologize for the grade... sorry)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.