Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: SQL Problem with userdata2 Table Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: December 17 2014 at 14:11 | IP Logged Quote GadgetGuy

Dave-

This is probably for you to answer unless someone else knows.

I am trying to write a (long) number (ie, temperature like 23.1 degrees) into the userdata2 "valnum3" column, which is allegedly a numeric column.

BUT I am getting an SQL error comment saying my temperature cannot be converted to a datetime value.



I thought this column (as well as the other "valnum" columns were supposed to be defined as numeric, not timestamp fields.

ALSO note the error comment says 'EMT-FREEZER...' and not 'TEMP-FREEZER' as it should.

Am I missing something, or is this a db error?


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 17 2014 at 18:56 | IP Logged Quote dhoward

Ken,

Couple of errors. Valnum3 is indeed a numeric field of type integer (use the "select * from sys.syscolumns where tname = 'userdata2'" to see the actual layout of the table) so will not hold a decimal value. Valnum4 is a numeric of type double so you would have to use this field to store a decimal value.

Second problem is that variable substitution is not done in the SQL editor...only in the PH Formula editor. So {TEMP-FREEZER_C} means nothing to the SQL interpreter and the {T will instead be interpreted as some type of SQL escape character....probably convert the data to a timestamp, hence your error. The SQL editor is ONLY a SQL editor...no functions, variable substitution, etc.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: December 18 2014 at 07:01 | IP Logged Quote GadgetGuy

Well now that sure makes sense !!

I kinda thought that since the Editor was embedded in PH that things would get interpreted, but that was just wishful thinking.

For future reference, would you recommend this site as a good reference source for PH SQL care and feeding?

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybas e.infocenter.dc00801.1530/doc/html/san1281564727527.html

[:-)}


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 18 2014 at 09:20 | IP Logged Quote dhoward

Ken,

I checked out the link and it would be mostly relevant. The SQL reference is for Sybase IQ which is definitely a different animal from the SQL Anywhere 11 database engine used in PowerHome.

I did some more searching and was able to find a SQL Anywhere 10 SQL reference on the Sybase site. This would be ALOT closer to what is currently in use in PowerHome.

http://infocenter.sybase.com/help/topic/com.sybase.dbrfen10/ pdf/dbrfen10.pdf?noframes=true

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: December 18 2014 at 09:35 | IP Logged Quote GadgetGuy

Thanks!

Downloaded the PDF and it looks extremely helpful.

Now I am DANGEROUS!

So, I need to ask again (you may have missed my other posting at the same time as this one), can I create my own Table, as the userData Tables are not quite appropriate for my schema?

I know I can create a table, but don't know what its impact might be on PH, thus need to know if there are any special considerations I need to be aware of. I am also assuming I can view (SELECT *) and use this new table.   


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: December 18 2014 at 10:50 | IP Logged Quote dhoward

Ken,

See other post for answer concerning create table.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum