Variable titels in bookfile

Hello everyone! I have a question about a bookfile.
When I have added a document in the bookfile, I want that the header refers to a paragraphstyle on the cover (the title, another document in the same bookfile).
So when I change the title on the front, it immediatly changes in the headers of all following documents in that bookfile.
However I can't find if that's possible. It is possible if it's not a bookfile, I already know how to do that.. But with a bookfile it's a differrent story. Can somebody tell me if it is possible and how to achieve this? Thnx ! Ciao Jessica

You can do this with a cross-reference from each location in the chapter files to the single title paragraph elsewhere in the book. Search Google for terms like "InDesign cross-references," without quotes for details.
Some InDesign users report problems with cross-references across files. Search Google for terms like "InDesign cross-reference problem," without quotes for details.
If you have unsolvable cross-reference problems, a text variable in each file can do it, but if the title changes, you'll need to change the variable in each chapter. You can do it manually, file-by-file, or you can synchronize the book chapter files. Search Google for terms like "InDesign book synchronize options," without quotes for details.
HTH
Jes-Z wrote:
Hi Jump_Over! Wow that's fast! I think my goal is to be connected to the Title content. Picture this:
I'm making studybooks. And some of the chapters are re-used in different studybooks.
At this moment I type the name of that training in the masterpages. But it would be so much faster and less error-prone, if the header of a chapter was linked to the title of that studybook.
So whenever I add that chapter to a bookfile, it automatically takes over the name of that particulair studybook. Is that more clear?

Similar Messages

  • Jspc-error in WLS 6.1, SP 5

              We encountered the following error in jspc after installing SP 5 for Weblogic Server
              6.1 over SP 4.
              The following line was given in the jsp-page (the page was developed with the
              Struts-Bean-Taglib):
              <bean:define id="titel" name="lltreeForm" property="name" />
              With SP 4, the following Java-Code was generated by jspc:
              /*** sync AT_BEGIN TagExtra Vars here ***/ //[ /jsp/ll/main.jsp; Line: 116]
              /*** declare & sync AT_END TagExtra Vars here ***/ //[ /jsp/ll/main.jsp;
              Line: 116]
              java.lang.Object titel = null; //[ /jsp/ll/main.jsp; Line:
              116]
              titel = (java.lang.Object)pageContext.findAttribute("titel");
              //[ /jsp/ll/main.jsp; Line: 116]
              out.print("\r\n ");
              And with SP5, the following Code was generated, without the declaration of the
              variable titel:
              /*** sync AT_BEGIN TagExtra Vars here ***/ //[ /jsp/ll/main.jsp; Line: 116]
              out.print("\r\n ");
              Does anybody know a solution for this problem?
              

    This is probably caused by the fix CR094190. Try using a begin and end tag
              until it's fixed by bea...
              <bean:define id="titel" name="lltreeForm" property="name" ></bean:define>
              MattM
              "Frank Eichfelder" <[email protected]> wrote in message
              news:[email protected]...
              >
              > We encountered the following error in jspc after installing SP 5 for
              Weblogic Server
              > 6.1 over SP 4.
              > The following line was given in the jsp-page (the page was developed with
              the
              > Struts-Bean-Taglib):
              >
              > <bean:define id="titel" name="lltreeForm" property="name" />
              >
              > With SP 4, the following Java-Code was generated by jspc:
              >
              > /*** sync AT_BEGIN TagExtra Vars here ***/ //[ /jsp/ll/main.jsp; Line:
              116]
              > /*** declare & sync AT_END TagExtra Vars here ***/
              //[ /jsp/ll/main.jsp;
              > Line: 116]
              > java.lang.Object titel = null; //[ /jsp/ll/main.jsp;
              Line:
              > 116]
              > titel =
              (java.lang.Object)pageContext.findAttribute("titel");
              > //[ /jsp/ll/main.jsp; Line: 116]
              > out.print("\r\n ");
              >
              > And with SP5, the following Code was generated, without the declaration of
              the
              > variable titel:
              >
              > /*** sync AT_BEGIN TagExtra Vars here ***/ //[ /jsp/ll/main.jsp; Line:
              116]
              > out.print("\r\n ");
              >
              > Does anybody know a solution for this problem?
              

  • Variable Tooltip

    Hi,
    I want to add a variable tooltip to a text. The tooltip text is created by outputFormat:
    <h:outputFormat value="Welcome, {0}. You have {1} new messages.">
    <f:param value="#{userBean.user.firstName}" />
    <f:param value="#{userBean.user.messageCount}" />
    </h:outputFormat>
    The output should be the title of:
    <h:outputText value="My Text where the tooltip should be add"
    titel="XXX" />
    is this possible with JSF 2? Or have I to do this in the Java Bean?

    Title accepts an EL expression, so you don't need to use outputFormat.
    <h:outputText value="My Text where the tooltip should be add"
    title="Welcome, #{userBean.user.firstName}. You have #{userBean.user.messageCount} new messages." />That should do the trick.

  • Generate dynamic variables

    I'm kinda new to JSP, and have the following question:
    is it possible to generate dynamic variables in JSP? I searched the WWW, and it seems nobody ever used it. Or I just searched wrong :)
    So:
    String result = "";
    for(int i = 1; i <= 10; i++){
    result = "test" + i;
    // do something with result here
    I would like that the string "result" becomes a variable: test1, test2, test3, ...
    I know it is possible in PHP like this:
    for($i=1; $i<=$10; $i++){
    $result = ${"test".$i};
    // here I can do something with the generated variables $test1, $test2, $test3, ...
    Does anyone got a solution for this problem? Cause it's driving me crazy ;)

    I tried, but I keep getting error's... Anything wrong?
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import java.util.Map;
    public class AwtCalculatorFrame extends Frame{
         private Button[] btnCalc;
         private Panel pnlLabel;
         private String[][] btnArrRow;
         private Label lblRes;
         private Panel[] pnlBtnRow;
        public AwtCalculatorFrame(String titel) {
            super(titel);
            MaakLayout();
            ToonFrame();
        private void ToonFrame() {
            setSize(250, 250);
            Dimension d = getToolkit().getScreenSize();
            setLocation((d.width - getSize().width) / 2, (d.height - getSize().height) / 2);
            addWindowListener(new AwtCalculatorListeners());
            setVisible(true);
        private void MaakLayout(){
            setBackground(new Color(224, 224, 224));
            setLayout(new GridLayout(6, 1, 5, 5));
            pnlLabel = new Panel(new GridLayout(1, 1, 5, 5));
            String[][] btnArrRow = new String[5][5];
            btnArrRow[0][0] = "Sin";
            btnArrRow[0][1] = "Cos";
            btnArrRow[0][2] = "Tan";
            btnArrRow[0][3] = "C";
            btnArrRow[0][4] = "CA";
            btnArrRow[1][0] = "7";
            btnArrRow[1][1] = "8";
            btnArrRow[1][2] = "9";
            btnArrRow[1][3] = "Sqrt";
            btnArrRow[1][4] = "Pow";
            btnArrRow[2][0] = "4";
            btnArrRow[2][1] = "5";
            btnArrRow[2][2] = "6";
            btnArrRow[2][3] = "x";
            btnArrRow[2][4] = "/";
            btnArrRow[3][0] = "1";
            btnArrRow[3][1] = "2";
            btnArrRow[3][2] = "3";
            btnArrRow[3][3] = "+";
            btnArrRow[3][4] = "-";
            btnArrRow[4][0] = "+/-";
            btnArrRow[4][1] = "0";
            btnArrRow[4][2] = ".";
            btnArrRow[4][3] = "Pi";
            btnArrRow[4][4] = "=";
            Label lblRes = new Label("0.");
            add(pnlLabel);
            Button[] btnCalc = new Button[btnArrRow.length];
            for(int c = 0; c < btnArrRow.length; c++){
                pnlBtnRow[c] = new Panel(new GridLayout(1, 5, 5, 5));
                for(int i = 0; i < btnArrRow.length; i++){
                    btnCalc[i] = new Button(btnArrRow[c]);
    pnlBtnRow[c].add(btnCalc[i]);
    add(pnlBtnRow[i]);

  • 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.
    Thanks

    Thanks 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 PM

    Hi 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

  • 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 error

    Change:
    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 Administration

    OK.
    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

  • Error in using a variable

    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 B

    Hi 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 Hermans

    Hello,
    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

Maybe you are looking for