Author |
Message
|
Ravee Bhat |
Posted: Tue Aug 12, 2008 5:12 am Post subject: problem using SHARED variable |
|
|
Apprentice
Joined: 28 Apr 2004 Posts: 28 Location: Bangalore, INDIA
|
Hello All
am declaring one shared variable as below,
Code: |
DECLARE CacheQueueTable SHARED ROW;
CREATE COMPUTE MODULE FLOWNAME_HERE_Compute
...
|
This does not show any errors in the editor. However when I deploy this flow, I get a response back saying
Code: |
BIP2402E: (, 3.26) : Syntax error : 'SHARED'.
The token caused a syntax error.
|
Not able to figure out whats missing?! Am I doing something wrong?
The toolkit is ver 6.0.0.1.
Thanks in advance
Ravee |
|
Back to top |
|
 |
vaibhav_vy |
Posted: Tue Aug 12, 2008 9:56 pm Post subject: |
|
|
Apprentice
Joined: 04 Aug 2008 Posts: 28
|
You can't declare ROW variable like this. You have to use ROW constructor to initialize ROW variable.
Use syntax similar like,
DECLARE myVar SHARED ROW ROW('myVal' as element);
This declaration is allocwed only at module level or schema level. |
|
Back to top |
|
 |
Ravee Bhat |
Posted: Tue Aug 12, 2008 11:31 pm Post subject: |
|
|
Apprentice
Joined: 28 Apr 2004 Posts: 28 Location: Bangalore, INDIA
|
Hello Vaibhav
Am not sure about that. And in my case I have nothing to initialize it with.
Correct me if I am wrong. In the .esql file if I declare it outside the module, that makes the variable, a module level. isn't it?
thanks,
Ravee |
|
Back to top |
|
 |
vaibhav_vy |
Posted: Wed Aug 13, 2008 9:07 pm Post subject: |
|
|
Apprentice
Joined: 04 Aug 2008 Posts: 28
|
There is no way to declare the ROW variable without initializing it. And ROW constructor is one way to do that.
If you declare any variable outside any function/procedure but inside the module, its scope is MODULE level.
If you declare any variable outside module typically after SCEMA or PATH statement in a .esql file , its scope is SCHEMA level. |
|
Back to top |
|
 |
Ravee Bhat |
Posted: Wed Aug 13, 2008 11:35 pm Post subject: |
|
|
Apprentice
Joined: 28 Apr 2004 Posts: 28 Location: Bangalore, INDIA
|
Thanks for the clarification about variable scope.
Some more details on the ROW,
I tried this on a separate sandbox on (a win xp m/c with broker runtime ver 6.1.0) where it works just fine, without initializing, without any issue like its mentioned in the samples gallery.
The same code won't work on our actual runtime (broker runtime 6.0.0.1 on solaris)
somehow am getting feeling that there must be some silly oversight from my side when I say both are 'same'!!!!
thanks
Ravee |
|
Back to top |
|
 |
vaibhav_vy |
Posted: Thu Aug 14, 2008 12:51 am Post subject: |
|
|
Apprentice
Joined: 04 Aug 2008 Posts: 28
|
Its really weird. I am using Win XP / Broker Runtime 6.1 / Toolkit 6.1.0.2. But ROW variable declaration did not work without initializing it.
Lets hope some other members will throw more light on it. |
|
Back to top |
|
 |
Ravee Bhat |
Posted: Tue Aug 19, 2008 1:54 am Post subject: |
|
|
Apprentice
Joined: 28 Apr 2004 Posts: 28 Location: Bangalore, INDIA
|
still no solution...
as i am talking to the support folks here, they have asked me to remove the CREATE SCHEMA clause from my ESQL code. This clause is not something i have written and i do not have any schema defined either (using the default schema). The CREATE SCHEMA appears only in the compiled message flow. If I am not wrong, having a schema for deployment of ESQL module is internal to the broker and flow deployment! right?!
Also did small modification to the code, declared the ROW variable at module level (w/o initializing) and now it complains about the keyword 'Row' itself! heh!
thanks
Ravee |
|
Back to top |
|
 |
Ravee Bhat |
Posted: Thu Aug 21, 2008 10:53 pm Post subject: update |
|
|
Apprentice
Joined: 28 Apr 2004 Posts: 28 Location: Bangalore, INDIA
|
After all the exercise (circus) found (from support folks) that though the broker toolkit is 6.x the broker runtime is 5.x Hence it would not take the SHARED variables declared. eh!!
thanks
Ravee _________________ Lets go see The World. |
|
Back to top |
|
 |
|