Variable Dispenser
I am trying to understand the use of Variable Dispenser, why do we need them, is it for locking the variable so that it do not changes
its value during execution?
below is one of the example I find in most of my package scripts
//method to read a package variable that is of type String
private string GetStringForPackageVariable(string pstrVariableName)
Variables objVar = null;
string LstrVariableValue = string.Empty;
Dts.VariableDispenser.LockOneForRead(pstrVariableName, ref objVar);
LstrVariableValue = objVar[pstrVariableName].Value.ToString();
objVar.Unlock();
objVar = null;
return LstrVariableValue;
yes thats true
it dispenses variables for read and write operations
see
http://josef-richberg.squarespace.com/journal/2010/4/8/ssis-using-the-variabledispenser-object-within-script-compon.html
https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.pipeline.pipelinecomponent.variabledispenser.aspx?f=255&MSPPError=-2147217396
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page
Similar Messages
-
How create a variable that changes (by 0.05) on each iteration in a loop?
We are trying to control New Era Syringe pumps using Labview. We want that those pumps could dispense different volumes on wells. For example 0.05ml in well one (using actuators we can move the wells), 0.1ml in well 2, 0.15ml in well 3 and so on. We think that we may need a "For loop" in which the number of iteration is the number of wells, but we do not know how to create a variable, inside the loop that can increase .05 on each iteration, and then we can use that variable as a "volume input" in our program.
Hi tbob,
multiple add operations with floats may induce more errors than a multiply/divide due to floating point representations (especially on numbers that can't be represented exactly, like 0.05)... The next step in this routine might be a comparison of setpoint and measurement value
Message Edited by GerdW on 05-10-2010 08:04 PM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Embeded derby as client variable store
I've spent considerable time trying to configure the built-in
derby embeded DB as a CF client variable store and have failed
utterly. It seems to be impossible.
I had a SQL Server client store which worked just find, but,
for various reasons that are irrelevant here, I would really prefer
not to do that and use derby instead.
I created the database, created the dsn, set the dsn as the
client store and it all looked okay. But it isn't. The CLOCAL and
CGLOBAL tables were not created as they should have been (and were
for SQL Server). So I created them by hand as described in the
help
files, but that failed as well. Changing various things yields
different errors, but there is a consisted 500 Server error. I can
only guess that the database writes are failing, but there is no
indication as to why.
I have looked all over adobe.com and all over the intertubes
and there is no further information of any kind. In fact, the
latest instructions for even creating the database date back to
May
2007 and have no resemblance to the administrators screens at
all. (I'm running CF 8,0,1,195765 standard). When I create an
embedded derby dsn, I get the generic "default"
Data & Services > Datasources > Other screen.
There's nothing "derby" about it.
So, frankly, it seems pretty pointless and useless to me. If
someone can point me DIRECTLY to relevant information, I'd
appreciate it. I cannot believe in the year plus this product has
been out that NO ONE has done this, especially when it's commented
all
over the place that this is one of the things you can do, yet
there's nothing. Even searching for just "derby" on these forums
yields only three hits, none of which are relevant.>> Well it does actually *tell you* it won't create
them automatically when
> > you go to set the DSN as the client store. I
suppose one has to read what
> > it says on the screen, which I have to say I don't
bother doing a lot of
> > the time in CFAdmin because I "know" what the text
says. This very screen
> > has caught me out with that before. Just the first
time, though.
>
> Actually, it does not tell you. The SQL Server screen
presents you with a box
> that says "create tables" but this one does not.
It doesn't say - underneath the "Description" text area "Your
data source
requires you to manually create the necessary database tables
to store your
client variables. See the Online Help for details. "?
It does for me.
You have a most curious CF install, and I would be very
hesitant continuing
with it given what you say.
What OS are you running on? Do you still have your install
logs, and do
they reveal anything relevant?
Is this an install that was fresh 8.0 (or 8.0.1), or has it
been upgraded
from an earlier release?
> The ones you expect. And the tables are there and
created correctly as per
> <cfdbinfo> which matches the <cfdbinfo>
created by CF in SQL Server. Things
> like:
> CREATE TABLE CDATA (cfid char (64), app char (64), data
clob,)
> CREATE TABLE CGLOBAL (cfid char (64), data clob, lvisit
datetime)
> CREATE UNIQUE INDEX id1 ON CDATA(cfid, app)
> CREATE INDEX id2 ON CGLOBAL(cfid)
> CREATE INDEX id3 ON CGLOBAL(lvisit)
OK, that sounds about right. The only thing I did different
was to use
timestamp rather than datetime. I'm not sure if that's worth
a try.
Can you insert / update / delete manually to/from those?
> > What are the error messages?
> As I said, the only consistent one is an Apache 500
Server error
The inconsistent ones would probably be helpful to know about
too.
What goes into the CF logs when these errors are being
raised? Do the 500
errors give an stack trace info? I think 500 errors usually
don't, but
don't exactly recall.
> > That sounds wrong. I get " Data & Services >
Datasources > Apache Derby
> > Embedded" on all three servers I have at my
disposal currently (a mix of
> > CF8 multiserver, CF8 stand-alone), and the rest of
the screen is
> > Derby-specific. It sounds to me like your install
is bung. Are you saying
> > when you select "Apache Derby Embedded" you just
get the same screen you
> > would have had you selected "other"? Odd.
>
> Also, as I said, I do not get any Derby anything.
I'm finding your tone a bit tedious to be honest.
I asked for clarification because you weren't completely
clear in your
post, and I just wanted to make sure you were sure what you
were seeing
because it's somewhat unusual to be getting completely the
wrong screens in
CFAdmin. In all the CF servers I have had responsibility for,
I've not
seen this, so I just wanted to *make sure* I was reading you
right.
> "other" jdbc data source creation screen, In fact, I
even copied the
> derby-specific URL from the create link and pasted it
into the browser, and CF
> Admin redirected it to the generic jdbc. This happens on
all three CF servers I
> have access to (all running 8.0.1 standard).
Weird. How did you create the Derby DBs themselves? It's
usually one of
the options on the create DSN screen. Did you create them
manually or
using some other client tool?
> > I think your problem here is your attitude that
because *you* can't make
> > something work then automatically nor can anyone
else. That is seldom
> > going to be the case, surely (or you lead a very
charmed life). I always
> > find that when something doesn't work for me in CF
it's almost always my
> > fault.
>
> Thank you for your opinion. It's most helpful
When trying to solve a problem that's a result of something
you've done, I
find it easy to take the mindset that *you've* done something
wrong, not
[something else] has done something wrong. Once one starts
looking more
analytically at one's own actions, sometimes a flag comes up,
and there's a
bit of a "slap forehead" moment. However if it's
predetermined that
something else is at fault and one is just the victim of
circumstance, it's
difficult to progress.
It's just better to dispense with the hand-wringing and roll
up the sleeves
and get on with fixing it.
> should have somehow psychically determined. If you read
for comprehension
> you'll see that I said I can't believe no one had done
it.
Have you not found anyone reporting to have used the Derby
DB? I have to
say that I'd never used it before y/day, because I've got the
luxury of
having Oracle or SQL Server DBs at my disposal. However I do
know of other
organisations using Derby for their demo DBs, and have read a
few things
about its usage.
I don't think you should expect to hear people reporting back
"hey I am
using Derby to store my client variables", because I don't
think it's
really that report-worthy. How many people to you see
reporting back "I'm
using my Oracle DB to store client variables"? As "storing
client
variables in a DB" is such a mundane thing, people are only
going to report
on it if they have had problems with it. Maybe no-one's done
it (except
for me, as of y/day). Maybe no-one's had a problem with it. A
case in
point: I had no problems setting it up, so I have no further
need to report
anything to anyone about it because it's "job done, move on".
> As I said the first time and again above, and will
repeat again here: I can't
> find anywhere where someone said they've actually done
it.
I've *actually done it*. I told you this y/day, as soon as
you asked.
There you go. Can we move on now please?
I'm not actually sure you want help, but if you do, follow up
with those
error message and anything from the logs that are helpful. I
think you
just want to have a moan as to how you've been so put upon,
and if that's
the case, I think we're done here. It's up to you as to how
to proceed.
Adam -
Problem with Threads and a static variable
I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
Code functionality:
A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
The problem as far I understand is:
Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
Thanks,
B.D.
Code:
private static volatile boolean bChanged = false;
private static Thread objMainProcess;
protected static void Init(){
objMainProcess = new Thread() {
public void run() {
while( objMainProcess == Thread.currentThread() ) {
GetState();
objMainProcess.setDaemon( true );
objMainProcess.start();
public static void initStatusTimer(){
if(objTimer == null)
objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
public void actionPerformed( java.awt.event.ActionEvent evt){
SetState();
private static void SetState(){
if( objMainProcess == null ) return;
synchronized( objMainProcess ) {
bChanged = true;
try{
objMainProcess.notify();
}catch( IllegalMonitorStateException e ) {}
private static boolean GetState() {
if( objMainProcess == null ) return false;
synchronized( objMainProcess ) {
if( bChanged) {
SendMessage();
bChanged = false;
return true;
try {
objMainProcess.wait();
}catch( InterruptedException e ) {}
return false;
}Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
Again as you said, There is a reason I can't call sendMessage() inside setState().
The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
Thanks,
B.D. -
Error while offsetting a variable
Hello Experts
I want to display the data for last 5 years in my query. So I tried using the SAP exit variable Current Calendar Year (0CYEAR) and the offset it by 5. However, I am getting the following error message for the query "System error in program SAPLRR12 and form REP_ASSIGN_INITIAL_OPT-01"
Any Help on this is appreciated and points will be assigned.
ThanksThanks Chetan for your prompt reply. I have assigned points.
But I would appreciate if you help me clear my understanding of offseting a variable.
Say if the Current Calendar Year variable returns 2008, then will offseting that variable by 5 return me the data for years 2008, 2007, 2006, 2005 , 2004. Or, will it just return me the data for 2008 - 5 = 2004 only.
Thanks
Rishi -
Error while Creating Presentation variable
Hi,I am new to OBIEE
I am facing this error:
"A numeric value was expected (received "max("Sales Measures".Dollars)").
Error Details
Error Codes: EHWH2A7E"
1.I am using paint rpd.I want to use presentation variable.
2.So i took two column in criteria 1.Region 2. Dollars
3.In Dollars edit formula ,I created presentation variable i.e. @{Doller_presentation}{max("Sales Measures".Dollars)} in the column formula.
4.And In the same column i use filter
Add ->presentation variable->variable exp =Doller_presentation and default =max("Sales Measures".Dollars)
5.I have added this request on dashboard page,but error is coming.
6.Also i have created dashboard prompt,
Set presentation variable to "Doller_presentation"
and in column formula :@{Doller_presentation}{max("Sales Measures".Dollars)}
and took that prompt on the same dashboard page.
so promt with 2 values are coming.1.All choces 2.13087528..may be ths is max value of dollar but on click its showing error as
"Odbc driver returned an error (SQLExecDirectW).
Error Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42021] The query does not reference any tables. (HY000)
SQL Issued: SELECT 13087529 FROM Paint ORDER BY 1"
I am confuse abt use of presentation variable
Please Help,
Thanks
Kapil
[email protected]
Edited by: user13098263 on May 9, 2010 10:58 PM
Edited by: user13098263 on May 9, 2010 11:01 PM
Edited by: user13098263 on May 9, 2010 11:02 PM
Edited by: user13098263 on May 9, 2010 11:04 PMHi Rachit
You answered my doubt.This one really works . Thanks a lot !
But i have one more doubt i.e if have created the Presentation variable in the dashboard prompt and I want to use it in a report
i.e the scenario is If I have created a new column i.e " Revised Salary " in the Presentation Services and want the values to be entered there dynamically upon end users choice. For ex the end user selecrts value of 1 then the report would display an increament of 500 to all the employees in the " Revised Salary " column and if the end user select value of 2 .. the report would display a decrement of 500 in the " Revised salary column".
I am getting the following error :
========================================================================
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59001] Binary Logical operation is not permitted on VARBINARY, INTEGER operand(s). (HY000)
SQL Issued: SELECT "D0 Time"."T05 Per Name Year" saw_0, "D2 Market"."M04 Region" saw_1, "D4 Product"."P01 Product" saw_2, "D1 Customer"."C1 Cust Name" saw_3, "F1 Revenue"."1-01 Revenue (Sum All)" saw_4, CASE WHEN 0='1' then "F1 Revenue"."1-01 Revenue (Sum All)" +500 else "F1 Revenue"."1-01 Revenue (Sum All)" - 500 end saw_5 FROM "Sample Sales" ORDER BY saw_0, saw_1, saw_2, saw_3
========================================================================
Please NOTE : The column on which I want to do an increament is : "F1 Revenue"."1-01 Revenue (Sum All)"
Thanks -
Error message into a Variable.
Dear users,
I have a rather usual (unusual from the weekend beers for me though!!) query which I can't figure out a proper way to implement.
My requirement is like this:
I have a message class in which I want to define a text 'Employee number & not found'.
I want to use this in the program, but not to raise this error. Instead, I want to move this error message with the Employee number into a Character(200) variable.
So instead of using MESSAGE e0xx(messageclass) USING employee number, I would like to move the error text into a variable which looks like:
lv_text = e0xx(messageclass) USING '1234' which stores the text 'Employee number 1234 not found' in lv_text.
How would I acheive it??
Thanks, V!Try tis way
message e999(00) with i_emp-empno into lv_text.
press f1 in message will provide you more details
a® -
Error while creating a Characteristic Variable with Replacement Path
Hi all,
I am trying to create the Characteristic Variable ZVLOWDT (Low Date') with Replacement Path on characteristic ZSTARTDT (Start Date) and it gives the error 'Source to replace 'Low Date' is not defined.
I have created a User Entry Variable VAR_DATE (Start Date) with interval like '01/01/2009 - 01/15/2009' and Customer Exit variable ZVCPDAY (does some calculation based on the input of VAR_DATE) on the same ZSTARTDT characteristic. I want to get the 01/01/2009 (lower range date of the selection) into this Characteristic Variable ZVLOWDT. We are in BI 7.0 and the following are it's properties:
General Tab:
Description: Low Date
Technical Name: ZVLOWDT
Type of Variable: Characteristic Value
Processing by: Replacement Path
Reference Characteristic: ZSTARTDT Start Date
Details Tab:
Variable Represents : Single value
Variable is: Mandatory
Variable is Ready for Input : unchecked
Replacement Path Tab: Replacement Rule
Replace Variable with : Variable
Variable : VAR_DATE
Replace with : KEY
Why I am getting this error, PLEASE ?
Thanks,
Venkat.Hi Khaja,
We could derive a Variable value from another Variable with out Customer Exit. There is a white paper.
First have the User Entry Variable (ZV_X) and it accepts the date range like '01/01/2009 - 01/31/2009'. Next create the Characteristic variable (ZV_Y) of Replacement Path for which source variable will be ZV_X and we could get the 'FROM Date' (01/01/2009) from the selection (ZV_X) into it (ZV_Y).
While creating the Characteristic variable (ZV_Y) of Replacement Path, I didn't find my newly created ZV_X variable in the list of available variables under 'Variable' header in 'Replacement Path' tab and it is causing the error 'Source to replace variable ZV_Y is not defined'. How could I create the Characteristic variable of Replacement Path, PLEASE ?
Thanks,
Venkat. -
Error while assigning a character value to a numeric variable.
I fire a sql statement and check the number of rows returned by the sql.
I check this result with the application logs.
The application logs keeps the sqls fired by the application and the no of rows returned, in the example below the sql returned 8454 rows.
My script compares the two results.
***********Application Log***********
4/14/2008 11:15:01 AM: 0059 SQL SELECT "CLUSTER_CD",
4/14/2008 11:15:01 AM: 0060 "PRODUCT_DESC",
4/14/2008 11:15:01 AM: 0061 "TEAM_CD"
4/14/2008 11:15:01 AM: 0062 FROM "OPS$TMS"."MAP_CLUSTER_TEAM_PROD"
4/14/2008 11:15:01 AM: 3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, 8,454 lines fetched
***********Application Log***********
My script:
#!/bin/ksh
typeset -i resA
typeset -i resB
opstms_conn_string="abc/[email protected]"
set `sqlplus -s $opstms_conn_string << EOF
set pages 0
WHENEVER SQLERROR CONTINUE
SELECT count(*)
FROM MAP_CLUSTER_TEAM_PROD;
exit
EOF`
resA=$1 ##returns 8454
resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
##resB returns 8,454
## here i get syntax error
if [ $resA -eq $resB ]; then
echo "QA passed for sql1"
else
echo "QA failed for sql1"
fi
The problem is as resB is integer variable it does not accept character value: 8,454 so returns a syntax error:
How do I change the value assigned to resB into a numeric variable?
error:
+ grep 3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD, BCVP_Main_Loader.qvw.log
run.ksh[52]: 8,454: syntax errorChange:
resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}'`
to this:
resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{print $10}' | tr -d ,`
to drop the comma. Or you could do it in awk(1):
resB=`grep '3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD,' BCVP_Main_Loader.qvw.log | awk '{ gsub( /,/, "", $10 ); print $10}'`
Or you could to it all in awk(1):
resB=`awk '
/3 fields found: CLUSTER_CD, PRODUCT_DESC, TEAM_CD/ {
gsub( /,/, "", $10 )
print $10
' BCVP_Main_Loader.qvw.log`
(This example was not tested, it's just for a model.)
Someone more of an SQL guru than I can probably tell you how to change your numeric locale to avoid presenting those commas in the first place and avoid the problem.
HTH -
Error while running a query-Input for variable 'Posting Period is invalid
Hi All,
NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
Diagnosis
Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
System Response
Procedure
Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
Procedure for System AdministrationOK.
Well, if the variable is not used in any interval selection, then I would say "something happened to it".
I would make a copy of the query and run it to check if I get the same problem with period 12.
-> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
If so, then try removing the variable completely from the query and hardcode restriction to 12.
-> If problem still persists, I would have to do some thinking.
If problem is gone, then add the variable again. Check.
-> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
Good luck!
Jacob
P.S: what fisc year variant are you using?
Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM -
Hi All,
I have got 2 packages, A & B. Package A includes package B and some variables.
My question out here is that i am using assigning some values to variables in the package B, i want those values to be reflected and be usable in the package A.
Can you please help.
Thanks,
Nithesh BHi Nitesh,
Please try the below steps and let me know still you face issue on this :-)
You can ping me on [email protected]
Steps :-
Ist create a Gobal variable say GLOBTest (historise , to veiw the result)
create a local variable say LocTest (historise , to veiw the result)
Now in first pcakage say PKG1
step 1 : drag and drop the GLOBTest Variable and select the mode as declare variable
step 2: call the second package scenario (say PKG2)
step 3: drag and drop the variable LocTest as assign variable :- and in assign tab put #Global.GLOBTest
Now in pcakge 2 (PKG2)
Drag and drop the global variable GLOBTest as assign mode and put the value as "This is a test case"
generate the scenarios and start the package 1 (PKG1)
once its executed without error , open the LocTest and check the historise tab , you can see the value of the global variable whcich you assigned from the child package.
Regards,
Rathish A M -
Filename in J2SE Adapter with Variable Substitution
Hello,
Within the J2EE receiver fileadapter (and ftp) from SP13 it is possible to compose the target filename and directory based on the payload of a message using variable substitution.
I wonder if it is also possible to use variable substitution with the J2SE fileadapter. For this it is not documented but i thougth that the same java libraries are used for the J2EE an J2SE file-adapters.
Aybody??
Really Nobody??
Message was edited by: Emile HermansHello,
the J2SE Adapter does not support variable subsition. Therefore we created our own class which gets called from the main SAP XI class "XMB2FileProcessor.class" wich is in the jar "aii_msg_adapter.jar". In your own class you can do what ever you need to chane the file name. In the configuration you can set your own parameter to search the payload for a string you want to replace. We also had to come up with our own timestamp, e.g. file2005-11-10 which SAP does not let you do, only the full timestamp is possible.
One other nice thing is that you can develop our JAVA class local and test it with your local J2SE Adapter Engine on you PC before you deploy it.
Steps to do:
1. JAD the SAP class
2. Put a call in the SAP class
3. Compile the class
4. Put the class back in the archive
5. Create your own class
6. Create a jar file for it
7. Put the jar file in the tech_adapter directory
8. Change the run_adapter start cmd to include your jar file
It works great, the only issue is if you patch the J2SE engine you have to do step 1 to 4 again but that should it very easy to do.
Cheers
Stefan -
Is null and regular value in where ($variable)
is there any polibility to create select depend on value in where ?
select count(x) where y = $variablebut if variable is NULLit doesn't work cause must be IS NULL or IS NOT
select count(x) where y is $variableIs there any posibility to make it working with null and regular variable?try:
select count(x) from <yourtable> where nvl(y,<not_possible_value>) = nvl($variable,<not_possible_value>);where <not_possible_value> is a value that is not possible for column y.
E.g. if y always is a positive number you could use the value -1. -
Get variable values from a stored procedure
I am using SQL 2008R2 and I want to replace a view inside a stored procedure with a new stored procedure to return multiple variable values. Currently I am using the code below to get values for 4 different variables. I would rather get the 4 variables
from a stored procedure (which returns all of these 4 values and more) but not sure how to do so. Below is the code for getting the 4 variable values in my current sp.
DECLARE @TotalCarb real;
DECLARE @TotalPro real;
DECLARE @TotalFat real;
DECLARE @TotalLiquid real;
SELECT @TotalCarb = ISNULL(TotCarb,0),
@TotalPro = ISNULL(TotPro,0),
@TotalFat = ISNULL(TotFat,0),
@TotalLiquid = ISNULL(TotLiq,0)
FROM dbo.vw_ActualFoodTotals
WHERE (MealID = @MealID);You can replace the view with inline table valued user-defined function:
http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
See example: SQL create INLINE table-valued function like a parametrized view
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
My goal is to control a device that is connected to our wired network using an Android tablet via Dashboard. I have created a vi with shared variables that controls the device as expected when it runs on a computer that is connected to the same wired network. The problem is that my Android tablet running the Dashboard app cannot connect to the shared variables on the PC running the vi on the wired network.
Our wireless network is on a separate subnet from our wired network. I am able to ping my Android tablet from the PC on the wired network but when I try to connect a variable in Dashboard, the PC running the SVE cannot be found. I tried listing it in the alternative server settings window and it still did not work. The only way I have been able to get around this is to run the vi which launches the server on a laptop that is connected to the wireless network and the wired network at the same time. My tablet can then find the server and my VI can connect to the instrument that is connected to the wired network. The laptop is somehow acting as a bridge between the subnets. I need to find a way for the Dashboard app to connect directly to the PC on the wired network. My PC IP address is 192.168.0.105. My Android IP address is 192.168.10.93.Data Dashboard doesn't care about subnets, but it has to be able to access the server using the right ports. There is probably a firewall blocking the shared variable ports. This document explains how to configure a firewall to allow shared variables to be accessed. Your challenge will probably be to figure out where the firewall is and how to configure it.
It is also possible that the router that your Android device is connected to doesn't know how to route to the other network. Again, that is an issue with your router that you need to resolve.
Maybe you are looking for
-
Mac OS X 10.5 Leopard Features
Is anyone willing to take a guess at what features we micht be able to find in Mac OS X Leopard? For me, I think these features would be great (and quite reasonable). - Finder built entirely on Spotlight metadata. The whole file structure would rely
-
HT4623 how to download itunes 11.1 to iphone 5
how to download latest itunes 11.1 to iphone 5
-
i m using halt command to shutdown my netbook , and it gives me those messages : sending SIGTERM to remaining processes... sending SIGKILL to remaining processes... Unmounting file systems. Unmounted /sys/kernel/debug. Unmounted /dev/hugepages. Unmou
-
Flex AP with strange EVT-5-NTC d0 Beacon events
Hello Support Community, I am experiencing some strange behaviour with an AIR-LAP1142N-E-K9. It is running with CAPWAP on a CT5508. Firmware; 7.4.110.0 It is one of many FLEX APs on that controller and I havent seen this behaviour on any other yet. T
-
Using ContextMenu for contextual help
Hi, I have set up the following handler for my "Help" menu item: private function onHelpMenuItemHandler(event:ContextMenuEvent):void // Contextual Help switch(event.mouseTarget.name) // Check the instance name of the