[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] Temp Table Error



If you have dynamic sql in your select, most especially in the "from" portion, 
sqr will many times "convert" all the columns to strings unless you specify the 
type on the column.  Something like....

        begin-select
        my_number_col  &std_hours=number
           ....
        from my_temp_table
        ...yadda yadda yadda

should work for you. (The previous was indented for readability purposes only).

HTH,
Don


Sam McBride wrote:
> Clark,
>
> I can verify that when the table is created, the columns are defined as
> decimal. I also did a describe on the table after it was created and all
> the columns in question are "number".  I can move the values directly to
> a numeric variable without modification and the comparisons work fine.
> Maybe it's an SQR "feature?"
>
> Sam
>
> -----Original Message-----
> From: the dragon [mailto:ceprn@hotmail.com] 
> Sent: Tuesday, October 17, 2006 1:21 PM
> To: sqr-users@sqrug.org
> Cc: Sam McBride
> Subject: RE: [sqr-users] Temp Table Error
>
> Sam,
>
> I agree with Peter - it looks like the column you are selecting from in
> the temp table has been defined as a character column.
>
> Angelika - that would probably work, but should not be necessary; you
> should be able to do that compare with the sqr column variable without
> modifying it if it is coming from a numeric column.
>
> peace,
> clark 'the dragon' willis
>
>
>
> PSA: Salary <> Slavery. If you earn a salary, your employer is renting
> your services for 40 hours a week, not purchasing your soul. Your time
> is the only real finite asset that you have, and once used it can never
> be recovered, so don't waste it by giving it away.
>
> I work to live; I don't live to work.
>
> "Time is the coin of your life. It is the only coin you have, and only
> you can determine how it will be spent. Be careful lest you let other
> people spend it for you."
>
> Carl Sandburg
> (1878 - 1967)
>
> ----Original Message Follows----
>
> I'm trying to create and use a temp table in an SQR program.  Everything
> seems to work ok until I try to select from the table.  When I try to
> use the selected columns in an expression, I get the following error:
> (SQR 4048) Function or operator '=' must be a string or date argument.
> This only happens for numeric colums.  For instance
>
> if &std_hours = 0   generates this error
> if &std_hours = '0' does not and the program runs and seems to do the
> calculations correctly.
>
> Does anyone know why I can't use numeric columms this way?  Why do I
> have to treat a numeric value as a string and why does that work?
>
> Thanks in advance for your help
> Sam McBride
> Peoplesoft HR/Payroll
> 817.415.1425
> sam.mcbride@radioshack.com
>
> _________________________________________________________________
> Use your PC to make calls at very low rates
> https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx
>
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
>
>   


-- 
-----------------------------------------------------------------------
Donald Mellen  | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
donm@ontko.com |  "In the beginning, there was nothing, which exploded"


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users