CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 changing ID data type problem

Print topic Send  topic

Author Message
JerryVT
Posted: 07/06/2004, 11:47 AM

Hi,
we have decided to change a datatype for a primery key in our groupings table (used for directory).
Old datatype for id & parentid fields was "int". Now it is "varchar".
We re-generated the whole project but when you click on the category browser displays an error:
"The value in field urlid is not valid. (Adp)"

"Adp" is the new id/parentid

If I switch to an old table with numeric id/parentid - everything works.

Any advice on how to change datatype?
Thank you.
peterr


Posts: 5971
Posted: 07/06/2004, 12:43 PM

There may be several places in CCS where the datatype is specified and needs to be changed. I think that you should check the parameters in the Data Source of your forms on that page. Specifically the Directory form, but maybe you have additional forms on that page as well?
Our support may also be able to help you and check your page in more detail.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
dhempy


Posts: 40
Posted: 07/06/2004, 12:53 PM

I'm going to bypass your question about CCS, and offer some advice about database design.

I strongly recommend against changing your primary key from an int to a varchar. There are lots of reasons for this, and any DBA textbook will enumerate them. You might find some tutorials on the web by searching for "database normal form tutorial". (FWIW, you should strive to have all your databases in 3rd Normal Form. The paybpack are plenty and immediate.)

Instead, I would consider adding a new field to your table for this new index. You can give it a unique index, and do lookups against that field and so forth.

Once your user selects record, however, I would encourage you to use the int primary key for linking between pages. Not only will that resolve the problem you're seeing with your forms, (I'm not saying that CodeCharge won't do what you're asking about) but it will make things easier down the line. For example, if your primary key is "Jane Doe" or "microsoft", chances are you'll need to change that value when Jane gets married or is Microsoft is ever forced to reorganize. If Jane was 123401 and Microsoft was 9810023, you wouldn't have to change those numbers.


FWIW,
-dave


_________________
David Hempy
Director of Broadcast and Education Technology
Kentucky Educational Television
800-333-9764
View profile  Send private message
JerryVT
Posted: 07/06/2004, 12:58 PM

Thanks Peter.
This page has several grids/forms in addition to Directory/Path component.
The strange this is that if I just change data type for Varchar and leave numeric values everything works. It errors only if I put letters instead of numbers.
What do I do with Datasource parameters?
In the Directory component WHERE param looks like:
cat.parentid={id}
How do I change it?

What files do I need to send to support?
Just one php page?
JerryVT
Posted: 07/06/2004, 1:14 PM

Thank you David,
actually, I have already created a lookup table for id names and will leave ID & Parentid numeric in the groupings table.
I just wanted to know for the future how to deal with changed data types & why I had that error - because of the primary key's data type change or data type change in general?
JerryVT
Posted: 07/06/2004, 3:29 PM

Just for the record.

I created a new table with varchar id, varchar parentid & name fields.
New CCS project.
Put directory builder component on a page.
It doesn't work with varchars. Same error.
"The value in field urlid is not valid. (a)"
peterr


Posts: 5971
Posted: 07/07/2004, 12:04 AM

Jerry,
You can specify the type of a parameter in the "Table Parameter" dialog. Search for the section "Using the Table Parameter Window" at http://docs.codecharge.com/studio/html/UserGuide/Forms/FormDataSource.html to see the screenshot.
It's possible that non-numeric data type is not supported or there is a technical issue that could be resolved. Please contact our support and they may request specific files if needed.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.