Print Thread
SetVariable and Variants.
#9303 06/07/07 11:10 AM
Joined: May 2004
Posts: 23
Australia
S
Speed Offline OP
Member
OP Offline
Member
S
Joined: May 2004
Posts: 23
Australia
I need to set the value of a field in a table without knowing what type of field it is, but there is no otVariant type for DeclareVariable.

How can I set the value of a field using a variant? confused

Thanks.

Regards,

Steve

Re: SetVariable and Variants.
#9304 06/07/07 11:26 AM
Joined: May 2004
Posts: 23
Australia
S
Speed Offline OP
Member
OP Offline
Member
S
Joined: May 2004
Posts: 23
Australia
The fields are generally either Number or VarChar2, so I'm declaring the variable as an otString and then passing the value using VarToStr. Not sure if this is the right way to do it but it seems to work ok.

Regards,

Steve

Re: SetVariable and Variants.
#9305 06/07/07 07:52 PM
Joined: Aug 1999
Posts: 22,217
Member
Offline
Member
Joined: Aug 1999
Posts: 22,217
That is probably the best way to go. A string is the closest thing to a variant in Oracle. If the numbers include decimals, make sure that the decimal point matches the Oracle NLS settings.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.031s Queries: 14 (0.009s) Memory: 2.5010 MB (Peak: 3.0405 MB) Data Comp: Off Server Time: 2024-05-14 03:58:53 UTC
Valid HTML 5 and Valid CSS