Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
wc67
Starting Member
2 Posts |
Posted - 2011-01-26 : 12:15:30
|
| I am have a problem being able to access and update a new column added to a table. I believe that someplace the structure of the statements is set up incorrectly and/or I just don’t understand how it should work, but since this is new to me, I am not sure on how to get it to work. I am not getting past the ‘Fetch’ statement.I added a new column to a table. The existing process does a ‘Declare Cursor’ and ‘Fetch’ and then either ‘Insert’ or ‘Update’Table_structure Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 New fieldWithin my program I am issuing the ‘Declare Cursor’ but am not going to be updating field 5 or 6 so I did not include them in the declare.Declare cursor Field 1 Field 2 Field 3 New fieldFetch Field 1 Field 2 Field 3 New fieldWhen I issue the ‘Fetch’ I get a ‘FATAL SQL ERROR HAS OCCURRED, SQLCODE = 000000001-, SQLERRMC = PERCobol SQL: 22002.R11: Null value, no indicator.Any suggestions/clarifications would be appreciated. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-01-26 : 12:21:01
|
| you can access the fields of table from information_schema.columns table------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-01-26 : 12:41:20
|
So you are using COBOL to query against a SQL Databse.Is it MS SQL Server or another DBMS like ORACLE? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
wc67
Starting Member
2 Posts |
Posted - 2011-01-26 : 12:50:48
|
| MS SQL Server |
 |
|
|
|
|
|