Binding a variable

Hi all,
How can we bind a variable if the column name exists in another
table.
For ex.
I have two tables lets say tab1,tab2. The tab2 holds the
column names of tab1.
table structure and data is.
tab1
id col1 col2 col3 col4
1 234 sysdate 3233 334.93
2 235 sydate 345 33.42
tab2
id inv_no date vendor
1 col1 col2 col4
2 col3 col4 col5
based on these two table values, I have to build a variable.
ex.
l_var = 234 ||sysdate||334.93;
And every time in my table 1, I will have at least 50 to 70k
rows. How can i do this. Please help me any one.
Thanks,
Swetha.

Try opening a ref cursor dynamically like this:
SQL> EDIT file_name
CREATE OR REPLACE PACKAGE package_name
AS
  TYPE cursor_type IS REF cursor;
  PROCEDURE procedure_name;
END package_name;
CREATE OR REPLACE PACKAGE BODY package_name
AS
  PROCEDURE procedure_name
  IS
    cursor_name package_name.cursor_type;
    CURSOR c_tab2 IS SELECT * FROM tab2;
    v_inv_no VARCHAR2 (30)    := NULL;
    v_date   VARCHAR2 (30)    := NULL;
    v_vendor VARCHAR2 (30)    := NULL;
    v_sql    VARCHAR2 (4000)  := NULL;
    l_inv_no VARCHAR2 (1000)  := NULL; 
    l_date   VARCHAR2 (1000)  := NULL; 
    l_vendor VARCHAR2 (1000)  := NULL; 
    l_var    VARCHAR2 (2000)  := NULL;
  BEGIN
    FOR r_tab2 IN c_tab2
    LOOP
      v_inv_no := r_tab2.inv_no;
      v_date   := r_tab2.date_col;
      v_vendor := r_tab2.vendor;
      v_sql    := 'SELECT ' || v_inv_no || ','
                            || v_date   || ','
                            || v_vendor
              || ' FROM tab1 WHERE id = :n';
      OPEN cursor_name FOR v_sql USING r_tab2.id;
      LOOP
        FETCH cursor_name INTO l_inv_no, l_date, l_vendor;
        EXIT WHEN cursor_name%NOTFOUND;
        l_var    := r_tab2.id || ' '
                 || l_inv_no  || ' '
                 || l_date    || ' '
                 || l_vendor;
        DBMS_OUTPUT.PUT_LINE (l_var);
      END LOOP;
    END LOOP;
  END procedure_name;
END package_name;
SQL> START file_name
Package created.
Package body created.
SQL> SET SERVEROUTPUT ON
SQL> EXEC package_name.procedure_name
1 234 26-OCT-01 334.93
2 345 33.42
2 346 35
PL/SQL procedure successfully completed.

Similar Messages

  • Front Panel Mass Binding Project Variables Issue

    Hello -
    When attempting to bind controls to shared variables through the front panel mass binding option, there is an issue where you can not seem to bind a "project item" to the control. The method of binding I am using is to export a text list of control names, urls, mode, and function to a text editor utilizing the front panel binding mass configuration options.  The text editor shows, in the fourth column, a "0" for no function, a "1" for network item, and a "2" for project item. when attempting to import the list back into the front panel binding mass configuration, all "2" indications become "1", as all items are treated as network. Thus one can not effectively bind to a project shared variable item.
    The binding works fine manually by means of utilizing the properties selection of the control, but it is difficult to do this for 821 controls, as in my application.
    My application is based on a OPC served group of 821 variables which are linked to controls and indicators through the shared variable representation for each item created in the multiple variable editor.
    Does anyone have a work around for this issue, as it is a showstopper right now, ie, you can not effectively bind a large quantity of controls or indicators to project located shared variables as required.
    The rationale behind utilizing project located variables instead of network located variables is to reduce the amount of calls to the OPC server which was causnig a large latency in the refresh of the 821 items. With the items defined as shared variables within the project, a single call is issued, which has tremendously sped up the refresh cycle for the list of variables.
    Thank you in advance for your insight in this matter,
    John DeCroos

    Hello Brian A.,
    In response to you comment --
    "in 2006, and John did not follow up with any more information for Efosa"
     -- a great deal of information was provided to NI (Efosa and many, many others, up to the product manager for the DCS module). I have never heard back on a fix for this bug for the identified version of LabVIEW. The reply by Efosa here was well after we had shipped our product -- (please see date + Efosa's apology) -- we had found our own solution as is identified in the original post.
    My solution was, as is also indicated in my original post, to manually bind each variable. This was unbelievably time consuming, but was all I had.
    The version of software I am now working on uses far less variables, manually bound to avoid the multiple binding issue we had in the past.
    I have checked the mass binding function in LV 8.5.1, it works fine now. I guess it would have been nice to have had a reply that the bug had been resolved ---- would have helped me out a bit.
    Thank you,
    John DeCroos

  • Queries not working with multiple bind position variables?

    still need help here - can anyone provide any direction?
    (note: this is a follow-up from prior topic, " How to use JDBC Positional Binding Style & ExecuteWithParams?")
    I created two simple view objects off of the same entity
    object to perform this test:
    #1 - ViewObject with one bind position variable - where clause: where id > ?
    #2 - ViewObject with two bind position variables - where clause: where id > ? and id < ?
    I created two separate .jspx pages, view1.jspx (one input field) and view2.jspx (two input fields), for each view object by dragging ExecuteWithParams operation onto the JSF page.
    The .jspx page with one input field works (returns result sets.) The view2.jspx page with two input fields does not work - the query does not return any result sets (no errors produced, it just does not return any rows) - I've tested my query outside of jdeveloper and it works fine. I also tried switching my inputs to make sure I did not have an illogical query (i.e., id >100 and id< 1).
    Is there anything different / extra I need to do to use two bind position variables?
    Everything in this simple test was identical except for using 2 input variables versus 1.
    Technology stack is: jdeveloper 10.1.3, jsf/ADF BC, mySQL 5.01
    Message was edited by:
    javaX

    Using the where clause: "where id > ? and id < ?” for the 2 input variables, I get the same result - no row results returned (though query works outside the browser.)
    Interestingly, I modified the where clause to “where between ? and ?”, and then used values of ‘1’ and ‘100’ to test. Using the BC4J tester, the query gave back a single row with id = 100 (should have brought back 100 rows because there are 100 records with id’s 1-100.) So I got it to return something, but not the right results. This makes me believe that a different query is being sent to MySQL other than what I'm expecting from what is shown in the SQL Statement of the View Object..
    Is there anyway to view what SQL statement is actually being sent to the database using the BC4J tester? Also, could this be an issue related to the mySQL connector drivers and JDeveloper? I’m using mysql-connector-java=3.1.11-bin.jar (10/10/2005)? First though, if I could see what query is actually being sent, this may help me to debug and figure out the problem.

  • How to bind local variables in complex query in PL/SQL

    Hi
    I have long complex query with local varibales; when I run in Dynamic SQL I get an error. Not sure which is the easiest way to bind local variables.
    L_QUERY := q'[select m.segment1 col1,
          '1' col2,
          '13' col3,
          l.operand col4,
          0 col5,
           'Y' col8,
          'N' col9,
          'N' col10,
       decode(h.name,'09_UKOR_*','EOS Credit','10_UKOR_*','TopUp','11_UKOR_*','Main') col18
    from qp_list_headers_v h,
          qp_list_lines_v l,
          mtl_system_items m
    where h.name in ('09_UKOR_*','10_UKOR_*','11_UKOR_*')
    and h.list_header_id = l.list_header_id
    and m.inventory_item_id = l.product_attr_value
    and m.organization_id  = 84
    UNION all
    SELECT qs.PRODUCT_ATTR_VALUE col1,
           hca.account_number col2,
           decode (su.site_use_code,'BILL_TO','21','SHIP_TO','18') col3,
           0 col4,
           qs.operand col5,
           null col6,
           null col7,
           'N' col8,
           'Y' col9,
           'N' col10,     
    --Local variables
          (case when (trunc(nvl(qq.start_date_active,sysdate)) between l_cur_year_from  and l_cur_year_to) and  
                      ( trunc(nvl(qq.end_date_active,l_cur_year_to)) >= trunc(l_cur_year_to) )  then    'TopUp'
                when (trunc(qq.start_date_active) between l_next_year_from  and l_next_year_to) and  
                      ( trunc(nvl(qq.end_date_active,l_next_year_to)) >= l_next_year_to)  then   'Main'              
                when (trunc(qq.start_date_active) between l_last_year_from  and l_last_year_to) and  
                      ( trunc(nvl(qq.end_date_active,l_last_year_to)) >= l_last_year_to )  then  'EOS Return'
           end )col18,
    --Local variables
           (case   when (trunc(qq.start_date_active) between l_next_year_from  and l_next_year_to) and  
                      ( trunc(nvl(qq.end_date_active,l_next_year_to)) >= l_cur_year_to )  then   'N'
              else
                    'Y'  end ) col21
       FROM qp.qp_list_headers_b qlhb,
            qp.qp_list_headers_tl qlht,
            qp.qp_qualifiers qq,
            qp_modifier_summary_v qs,
            hz_cust_site_uses_all su,
            hz_cust_acct_sites_all  sa,
            hz_cust_accounts hca
    WHERE 1=1
          and qlhb.LIST_TYPE_CODE       = 'DLT'
          and nvl(qlhb.active_flag,'Y') = 'Y'
          and qlhb.list_header_id       = qlht.list_header_id
          AND qq.list_header_id         = qlhb.list_header_id
          and qq.list_type_code         = qlhb.LIST_TYPE_CODE
          and qq.QUALIFIER_CONTEXT      = 'CUSTOMER'
          and qs.list_header_id         = qlhb.list_header_id
          and qs.LIST_LINE_TYPE_CODE    = 'DIS'
          and su.site_use_id            = qq.qualifier_attr_value --1064
          AND  su.cust_acct_site_id     = sa.cust_acct_site_id
          AND  sa.cust_account_id       = hca.cust_account_id ]';
    --call Dynamic SQL function
    l_cursor := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(l_cursor, p_QUERY , DBMS_SQL.NATIVE);
    l_rows := DBMS_SQL.EXECUTE(l_cursor);
    Any help will be much appreciated.
    iI guess I should use DBMS_SQL.BIND_VARIABLE to bind all variables seperately so not to mess with query

    1) What is the error you get?
    2) If you use bind variables inside a query, you should prefix them with colons, so use :l_cur_year_from etc.
    3) Why are you using dbms_sql instead of native dynamic sql and/or ref-cursors?
    Toon

  • Binding a variable to an LOV query, not working... Urgent!

    Hi,
    Based on a column value(which gets populated at runtime), in a table, the LOV query for another column in the same table, should be restricted with this value.
    1. My LOV is based on a VO.
    Lov query is
    SELECT ped.full_name as employee_name,
    ped.employee_number as employee_number
    FROM p_employee_details ped
    WHERE ped.value = 'Y' and ped.work in (:1, 'Both')
    2. For binding the variable, I have a method in VOImpl of the LOV.
    public void initQuery(String p_param)
    setWhereClauseParams(null);
    setWhereClauseParam(0,p_param);
    3. This method is called in the LOVAMImpl
    public void initializeVO(String p_param)
    LovVOImpl lovVO = (LovVOImpl)getLovVO1();
    lovVO.initQuery(p_param);
    4. In the CO for the LOV RN, the LOVAMimpl Method defined in step 3 is called.
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule lov_am = (OAApplicationModule) pageContext.getApplicationModule(webBean);
    Dictionary lov_dict = pageContext.getLovCriteriaItems();
    String lov_criteria = (String) lov_dict.get("work");
    Serializable lov_params[] = {lov_criteria};
    lov_am.invokeMethod("initializeVO",lov_params);
    Here "work" is the column in the table whose value is needed for binding the lov query
    But i am still getting an error saying not all variables bound.:
    Developer Mode Exception : Lov Input should by default be the queryable criteria and Result.
    I don't know what else to do.
    Thanks in advance

    HI,
    Here the code giving on starting of the thread will work,only problem is lov mapping over here which was same as mine , u have to create one more lov mapping which will have criterial item same as the field on which lov is based.
    Thanks

  • Binding a variable in DBMS_XMLGEN.newContextFromHierarchy

    Hi All,
    How to bind a variable to below query?
    SELECT XMLELEMENT("ROW",
                XMLELEMENT("AssignedPrivs",
                        (SELECT DBMS_XMLGEN.getXMLType(
                             DBMS_XMLGEN.newContextFromHierarchy('SELECT LEVEL,
                                 XMLELEMENT("record",
                                   xmlattributes(VPI.PRIVILEGEID_V AS "jsxid",
                                                  VPI.DESCRIPTION_V AS "jsxtext")
                                    FROM VMS_PRIVILEGE_INFO VPI
                                     START WITH VPI.GROUPID_N IS NULL
                                     CONNECT BY PRIOR VPI.PRIVILEGEID_V = VPI.GROUPID_N
                                     AND VPI.PRIVILEGEID_V IN (SELECT PRIVILEGEID_V
                                                                     FROM VMS_ROLEPRIVILEGES
                                                         WHERE ROLEID_N = :1)' )
                              ) FROM DUAL
                         ))) XMLDOC 
    FROM DUALScript:
    CREATE TABLE VMS_PRIVILEGE_INFO
      PRIVILEGEID_V  VARCHAR2(30 BYTE),
      DESCRIPTION_V  VARCHAR2(40 BYTE)              NOT NULL,
      GROUPID_N      NUMBER(5),
      GROUPORDER_N   NUMBER(2)
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '10', 'User Management', NULL, 1);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '100', 'eTopUp', NULL, 11);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '110', 'Application Management', NULL, 12);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '1158', 'Create User', 10, 2);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '1159', 'Modify User Details', 10, 4);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '1160', 'Create Roles', 20, 2);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '1161', 'Modify Roles', 20, 4);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '1162', 'Configure Master Settings', 110, 2);
    INSERT INTO VMS_PRIVILEGE_INFO ( PRIVILEGEID_V, DESCRIPTION_V, GROUPID_N,
    GROUPORDER_N ) VALUES (
    '1163', 'Unlock Prepaid Account', 90, 20);
    COMMIT;
    CREATE TABLE VMS_ROLEPRIVILEGES
      ROLEID_N       NUMBER(5),
      PRIVILEGEID_V  VARCHAR2(30 BYTE)              NOT NULL
    INSERT INTO VMS_ROLEPRIVILEGES ( ROLEID_N, PRIVILEGEID_V ) VALUES (
    1003, '1158');
    INSERT INTO VMS_ROLEPRIVILEGES ( ROLEID_N, PRIVILEGEID_V ) VALUES (
    1003, '1159');
    INSERT INTO VMS_ROLEPRIVILEGES ( ROLEID_N, PRIVILEGEID_V ) VALUES (
    1003, '1160');
    INSERT INTO VMS_ROLEPRIVILEGES ( ROLEID_N, PRIVILEGEID_V ) VALUES (
    1003, '1161');
    INSERT INTO VMS_ROLEPRIVILEGES ( ROLEID_N, PRIVILEGEID_V ) VALUES (
    1003, '1162');
    INSERT INTO VMS_ROLEPRIVILEGES ( ROLEID_N, PRIVILEGEID_V ) VALUES (
    1003, '1163');
    COMMIT;Regards,
    Abdul

    Hi,
    In above code i had included bind variable in string so i was not able execute the same. So i modified the code as:
    SELECT XMLELEMENT("ROW",
                XMLELEMENT("AssignedPrivs",
                        (SELECT DBMS_XMLGEN.getXMLType(
                             DBMS_XMLGEN.newContextFromHierarchy('SELECT LEVEL,
                                 XMLELEMENT("record",
                                   xmlattributes(VPI.PRIVILEGEID_V AS "jsxid",
                                                  VPI.DESCRIPTION_V AS "jsxtext")
                                    FROM VMS_PRIVILEGE_INFO VPI
                                     START WITH VPI.GROUPID_N IS NULL
                                     CONNECT BY PRIOR VPI.PRIVILEGEID_V = VPI.GROUPID_N
                                     AND VPI.PRIVILEGEID_V IN (SELECT PRIVILEGEID_V
                                                                     FROM VMS_ROLEPRIVILEGES
                                                         WHERE ROLEID_N = '||:1||')' )
                              ) FROM DUAL
                         ))) XMLDOC 
    FROM DUAL;Now its working fine.
    Regards,
    Abdul

  • Binding: Instance variable loses value.

    Hi all,
    Just making my first steps into Objective-C, I've done a lot of C, C++ and C# on win & linux. Anyhow, I've been hacking away happily and discovered a peculiar behaviour, and I'm not sure if it's my code or some obscure bug in Xcode.
    1. I have a Check Box(NSButton) directly bound to a BOOL instance variable called "checkValue" using KVC. The containing class is a custom NSView subclass.
    2. I manually implemented the setter according to KVC naming rules "setCheckValue".
    3. When debugging the UI (check box) calls the setter perfectly with the correct value, which shows up in the NSLog output.
    4. I hooked up the action for the check box as well, and inside the action handler the instance variable reports the value correctly. Everything looks fine.
    5. Now here's the rub. I put a mousedown event handler into the class as well, and it is called flawlessly when I click on the custom view. However, "checkValue" does not report the correctly set value.
    So, how can a class instance variable, which is set and reports correctly elsewhere in the same scope, all of the sudden take on a nonsense value in a event handler? If a variable has a value set, it should be the same everywhere within the same scope!
    Below is simplified code extracted from the original project for clarity. It produces exactly the same behaviour as the more complex project without the distracting code.
    #import "CheckBoxHandler.h"
    @implementation CheckBoxHandler
    @synthesize checkValue;
    //Apparently this is required for binding in NSView based classes
    //The same behaviour occurs even if you remove this.
    +(void)initialize
    [self exposeBinding:@"checkValue"];
    -(id)initWithFrame:(NSRect)frameRect
    self = [super initWithFrame:frameRect];
    if(!self)
    return nil;
    [self setCheckValue:YES];
    return self;
    //manual impelementation of KVC setter
    -(void)setCheckValue:(BOOL)v
    checkValue = v;
    NSLog(@"Setter Called: checkValue is %d", checkValue);
    //The action works fine as evidenced by Log output
    //Check and uncheck the box a few times.
    -(IBAction)checkBoxAction:(id)sender
    NSLog(@"UI State:%d Ivar State: %d", [checkBox state], checkValue);
    //Mouse clicking on the view calls into this event.
    //The problem is the value reported by [self checkValue] OR checkValue directly
    //do not match the UI state. In fact it always reports some nonsense value.
    -(void)mouseDown:(NSEvent *)event
    NSLog(@"Inside Mousedown: checkValue is: %d", [self checkValue]);
    @end
    I have a workaround, but it really bends my head when something doesn't behave as expected!

    I have synthesized against "checkValue", although I manually implemented the setter so I could set a breakpoint and observe the value. I thought [self checkValue] and self.checkValue both simply call the same getter, just different syntax.
    The setting of the value using the UI checkbox happens outside of the event call chain. I can check and uncheck the checkbox and the value changes correctly. The checkbox is in a separate space on the window, so clicking it does not activate mousedown on the view, this is correct behaviour. Clicking on the view does activate the mousedown event, this is done after I've set the checkbox so the value has been set well before the mousedown event. Thus it should already have the correct value in the event.
    For completeness this is the interface file:
    #import <Cocoa/Cocoa.h>
    @interface CheckBoxHandler : NSView {
    IBOutlet NSButton *checkBox;
    BOOL checkValue;
    -(IBAction)checkBoxAction:(id)sender;
    @property (assign, readwrite) BOOL checkValue;
    @end
    I'll change everything to self.checkValue just for the excercise. Ok, done. checkValue still reports a value of 1 in the mousedown event regardless of the value set elsewhere.

  • Binding shared variable in executable across network

    I can't seem to get a shared variable to bind from an executable on another computer back to a source variable on the main machine.
    I can get the remote variable to change with programmatic access.  Is it possible to have shared variables in an executable bind to a PSP URL on another computer?  This is labview 2011.
    I can see everything with NI Distributed System Manager, and the programmatic access changes the remote variable, so it's not a network issue.
    Thanks for any insights.  This just doesn't seem to work the way NI's online white papers say it shoud.

    What I don't understand is why after binding to a specific URL, the "Shared Variable Deployment" screen of the application builder makes the target "my computer". 
    I probably could get this to work if I changed the network address of "my computer" in the ini file created in Application Builder?
    This seem a strange way for this binding process to work.  If the absolute target (for shared variable bound to another variable and referencing "absolute") was retained when the VI goes through the application builder, it would make for sense.
    I can't get this to work any way with using bound variables.  The only way this works is using programmatic access to shared variables in the built app, and I don't consider this the same thing.
    My conclusion is that shared variable binding and appropriate absolute references to deployed variable libraries do not survive passing through the application builder with their absolute references intact.

  • How to bind DATE variables in SQL*Plus

    I have a stored procedure in a package that has a DATE OUT parameter
    myPackage.myProcedure( outDate OUT DATE )
    I am trying to test this from SQL*Plus
    How do I specify a Bind variable for the outDate? The VARIABLE command does not allow DATE types?
    If this was a CHAR type I could have done
    VARIABLE myChar CHAR
    BEGIN
    myPackage.myProcedure( :myChar )
    END;
    PRINT myChar
    How do I do this with DATE data types instead? I am using Oracle 8.1.7.

    you should use VARCHR2 type with the minimum length that can store a value defined by your NLS_DATE_FORMAT
    string. The returned date will be converted to a VARCAHR2 type and the size and format will depend on
    your NLS_DATE_FORMAT setting.
    =============================================================================
    SQL> variable dt VARCHAR2(20)
    SQL> create or replace procedure ret_date(dt OUT DATE) is
    2 begin
    3 dt := SYSDATE ;
    4 end ;
    5 /
    Procedure created.
    SQL> exec ret_date(:dt) ;
    PL/SQL procedure successfully completed.
    SQL> print dt
    DT
    13-OCT-02
    SQL> select sysdate from dual ;
    SYSDATE
    13-OCT-02
    SQL> alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS' ;
    Session altered.
    SQL> exec ret_date(:dt) ;
    PL/SQL procedure successfully completed.
    SQL> print dt
    DT
    13-OCT-2002 10:43:23
    SQL>
    ================================================================

  • Binding Shared Variable to Source

    Dear all,
    I'm currently working on a project that requires the use of shared variables. The shared variables will be network published and programmatically created using properties nodes. However I encounter one error and one problem in the process of doing so.
    1) I programmatically bind the shared variable directly to the fieldpoint channel (data item) by writing the URL \\10.0.0.1\FP\1AIO\00 when i create the shared variable. The shared variable can be created successfully but when i deploy it, it generates an error which seems to tell me "it is out of range". Can anyone help me to rectify this problem?
    2) The 2nd question will be, as my fieldpoint is connected to a DHCP server. At the start when i create the shared variable programmatically, i could bind the shared variable directly to the data item by writing the URL to its property. However, during the process of deployment, the dynamic IP address assigned to my fieldpoint may change . How can I ensure that the shared variable continue to bind to the right fieldpoint channels respectively? even though the IP address changes?
    - Or is there any method that I could view all the network data items in a table? a list? or an array? so that I can link them to the URL.
    I tried using the data socket URL.vi, I can only select the data item one by one.. this will be tedious for 100 or 200 I/O points..
    Will greatly appreciate for any advice and help. Thanks in advance.

    Try this.
    Give your fieldpoint controller a computer name through MAX.  Then instead of referencing it by 10.0.0.1 in the URL's of the shared variables reference it by computer name.  So  \\MyFPmachine\FP\1AIO\00 instead of  \\10.0.0.1\FP\1AIO\00.
    Dynamic IP's can definitely cause headaches, and it would be best to use static IP's if possible, but doing this method should help.  It seemed to work for me.  I found when you browse for the channel in LV, it wants to give it the IP address by default, but it was possible to edit the string and paste in the computer name.
    Message Edited by Ravens Fan on 01-10-2007 11:01 AM

  • Bind shared variable to multi-chan​nel item

    How do i bind a shared variable (array) to a Fieldpoint multi-channel item?
    When i configure the shared variable, and click browse to select the network item to bind to, i can select individual channels but there's no "All" tag.

    Actually I suspect that the problem is in the National Instruments OPC Server.
    DataSocket can read array data types from an OPC Server, but National Instruments' OPC Servers do not publish data in an array format.
    Probably the easiest solution is to publish your shared variable in your network but don’t bind it trough the opc server, instead you have to use it like a standard global variable (bind to source method).
    Give a look to this document may lead you to a better solution.
    http://digital.ni.com/public.nsf/websearch/FA61036​7EC62574186257118005089F2?OpenDocument
    Hope these two tips can help you
    FiloP
    It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
    Richard P. Feynman

  • Binding a variable to a shared variable is taking the attributes of that variable?

    Is it possible that binding to a shared variable to have the attributes of that variable? With other words shared variable shares attributes also?
    Thank you,
    Virginia

    I builed a vi server that prepears data to be updated to an interface and data has all type of attributs such as color, background and foreground, and for this reason I wanted to be able to be updated with attributs.
    I will give up to have like an updated control in my interface but to updated it from the server with detailed attributs in a continous loop instead.
    Data with attributs give me not only the value but the status also.
    Thank you!

  • Drill Reports (Binding Item Variables)

    Hi
    Does anyone know how to bind to an item variable that does not have a value to return i.e. because the value is blank or missing?
    I have summarised data on one page, and when I drillin, I would like to see the detail for the bound items that have missing data.
    Thanks in advance
    Kezie

    Any suggestions about this?

  • Bind a variable in a View object

    i built a new ADF application and i need to use the user in the where clause of the SQL of the view objects, the applicaton users aren't database users so i can't use the 'user' variable in the SQL. i know how to get the user as above
    Expression Language
    <af:outputText value="#{facesContext.externalContext.userPrincipal.name}"/>
    Managed / Backing Bean
    ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
    String userName = ectx.getUserPrincipal().getName();
    System.out.println("Current user: " + userName);
    ADF BC Application Module
    String userName = getUserPrincipalName();
    System.out.println("Current user: " + userName);
    but i don't know how to use it in the SQL of the VO??
    Appreciate any help

    Hello,
    Yes a bind variable is the correct way.
    Maybe these steps will help you:
    1) Create a viewobject with the bindparameter
    2) On the page you need to call it, rightclick the page and select goto pagedef.
    3) Select the STRUCTURE window, select BINDINGS
    4) right click, Select insert inside, action
    5) select the viewobject you need to query, select EXECUITEWITHPARAMS as method, it will show your bind variable, put: "#{facesContext.externalContext.userPrincipal.name}"
    6) now in the STRUCTURE window, select EXECUTABLES
    7) right click, select insert inside, invokeAction
    8) give it some name and for BINDS select the action you just created, mose likely named executeWithParams, goto advanced properties and select refresh=always
    Now each time the page is loaded the query will execute.
    -Anton

  • Do I have to Bind Shared Variables in Executables?

    I want to have shared variables work between two executables that will be installed on seperate machines.  I've managed to get the code working, but am not satisfied with the approach.
    Attached is a .zip file with my project files that contain what I've been able to get to work.
    What I don't like, is how I need to have double the amount of network variables.  Right now I have a program that is a publisher and another is a subscriber (based on an example provided on this forum at some point).  The Publisher has its own shared variables inside a library, and the subscriber has its own shared variables inside a different library.  The Subscriber's shared variables are "bound" to the Publisher's shared variables in the project file and is a concrete physical network path that cannot be changed.
    Once the executable is made and installed, this works.  I've tried getting it to work w/o one of the executables using a shared variable library that contain bound shared variables through a concrete physical network path but I obviously do not know what I am doing.  Ultimatly, I would like to have a single shared variable library that both the publisher and subscriber use.  I want the publisher executable to post the variables to the variable manager running on the publishers machine, and then have the subscriber program running on the subscriber's machine to consume the shared variables from the variable manager on the publisher's machine.
    Please help me!
    -Nic

    Hey Nic,
    I am going to try and answer those questions for you.
    If you use the DataSocket API to connect to a variable that resides on another machine, is your local machine's variable engine involved at all?
    No, it should not be involved at all.
    If the Variable Engine is not used locally, does it need to be included with your application installer?
    Yes, it is going to need to included with the installer.
    If I'm correct, whats better?  To use the variable engine locally, or to connect directly to a remote variable engine?
    Can you please give a little more information here?  I'm not quite sure if I understand your question.
    The default time-out on the DataSocket Read vi is 10 seconds.  If you are doing multiple DataSocket reads in the same polling loop, one variable may update but the other datasocket read is waiting for its timeout before allowing the loop to itterate.  This creates a really laggy scenario (see progmatic subscriber.vi in the attached .zip).  Setting the timeout to something low, say 10msecs, reduce the "lag" but...
    Having the ability to set a decent time-out is a really nice performance feature that isn't availabe to you when you Bind to a shared variable (I don't think).  It may make performance since to not do any loop iterations until the data from the host has changed.... how to manage this w/o seperating each read into its own loop however is my question.... ???
    Can you please explain this a little more as well?  If I understand you correctly, it sounds like you have many datasockets open in one while loop.  Are you using one datasocket per variable?
    Is there any unseen advantages with using the National Instrument's Shared Variable API over the DataSockets API?
    Shared variables are in general more easier to use, and provide a simple way to implement the idea of passing data between machines.  Obviously, using TCP, you can create more control using your own protocol to exchange information, but in general, Shared Variables are normally just easier to use.
    Feel free to post any questions or dicussion issues here.
    Regards,
    Kevin H
    National Instruments
    WSN/Wireless DAQ Product Support Engineer

Maybe you are looking for