variable with sql reuse various clauses

Hello

Is it possible to reuse the same variable with sql different queries in the packages...

Example:

I have a Word to say variable

name of the variable 1): filename

(2) in variable query: select 'emp.txt' of the double

so using the name of this variable in the data store, I'm passing filename dynamically, but I need to change the file name to dept.txt emp.txt missing emp.txt food.

A solution on my side uses a table dump with the file name. more without the use of db tables

Please share views

See you soon,.
Surya

You will then need the help of beanshell java technology. Variable2 take the second query in cooling mode. Now, create a procedure. At the 1st step of technology will be java beanshell with below codes.

<>
String xtr = "#variable2";
@>

Now in ko-> step use variable1 in assign mode

Variable1 =<@=xtr@>

It will certainly work.

Thank you.

Tags: Business Intelligence

Similar Questions

  • Help with SQL Loader when Clause

    I have 2 exact same structure Oracle tables.


    NUMBER OF ENO
    NUMBER OF PARENT
    NUMBER OF CHILDREN
    ENAME VARCHAR2 (50 bytes)
    ADDRESS VARCHAR2 (50 bytes)
    CITY VARCHAR2 (50 bytes)
    SRCFILENAME VARCHAR2 (50 bytes)
    SDATE VARCHAR2 (400 bytes)
    Current_Load VARCHAR2 (1 byte)




    Have a data file and a charger control file that loads data into these 2 tables.
    I need to make a conditional charge using a when clause.
    Condition: what MOTHER = CHILD, load table 2 other load in table 1

    My control file looks like this.
    LOAD DATA 
    INFILE 'TEST_20120815.txt' 
    APPEND INTO TABLE test1 
    fields terminated by "|" 
    trailing nullcols 
    ( 
    eno, 
    parent, 
    child, 
    ename, 
    address, 
    city , 
    sdate "to_date(:sdate,'DD/MM/YYYY')", 
    SrcFileName, 
    col7 filler, 
    "Current_Load" constant 'Y' 
    ) 
    INTO TABLE test2 when (parent=child) 
    fields terminated by "|" 
    trailing nullcols 
    ( 
    eno position(1), 
    parent, 
    child, 
    ename, 
    address, 
    city , 
    sdate "to_date(:sdate,'DD/MM/YYYY')", 
    SrcFileName, 
    col7 filler, 
    "Current_Load" constant 'Y' 
    ) 
    But it does not work. It works fine if I give a direct value like PARENT = 'P '.

    Any idea how compare the 2 fields while the conditional support?

    You can't compare 2 fields with the WHEN clause in SQL * file the charger control.
    only literal values as defined by the syntax:

    http://docs.Oracle.com/CD/B19306_01/server.102/b14215/ldr_control_file.htm#i1005657

    As already suggested, you'd be better to load data using an external table which allows to apply conditions you want in your SQL query, which is to get the data.

  • Mistake to link the variable with the clause "like %"?

    Hello everyone;

    I would like to know how to make a like clause to bind variables, with this code, I get ' ORA-00933: SQL not correctly completed command ' error
    :
    v_query:= 'UPDATE ' || collection(i) ||' SET REF_PLAN=:quatre_champ WHERE FAM_SIM like ''%'':prem_champ''%'' AND PRISE_V1P like ''%'':deux_champ''%'' AND BROCHE_V1P like ''%:trois_champ%''';
                                  EXECUTE IMMEDIATE v_query USING quatre_champ,prem_champ,deux_champ,trois_champ;
    Maybe my "'" are in a bad position?

    Thanks for your help, regards.

    Try this:

    v_query:= 'UPDATE ' || collection(i) ||' SET REF_PLAN=:quatre_champ
    WHERE FAM_SIM like ''%''||:prem_champ||''%''
    AND PRISE_V1P like ''%''||:deux_champ||''%''
    AND BROCHE_V1P like ''%''||:trois_champ||''%''';
    
  • Compare with variable binding sql stored proc vs

    I have a complicated logic coded in the two sql with variables and stored procedure I need to compare the performance of the two and decide which binding. with sql, I think I must watch the plan exec etc. and get metrics. How can I do to stored proc

    user8798946 wrote:
    the sql will be a plsql function. I have to choose wheter I implemting the sql code in the plsql or a version of sql plsql. hope that what I say makes sense.

    Are you meaning "I can write an SQL statement in a procedure, or I can PL/SQL code to do the same thing as the SQL statement and the loop via a slider?

    If so, then go with the SQL statement.

  • How to pass a list as a bind variable in SQL Developer?

    How can I pass a list as a bind variable in SQL Developer?

    The following query in SQL Developer so work I put ": prmRegionID = 2.

    SELECT COUNTRY_ID,
    COUNTRY_NAME
    OF HUMAN RESOURCES. COUNTRY
    WHERE IN REGION_ID (: prmRegionID);

    The problem is that I can't find how to set ": prmRegionID = 2, 3.

    I know that I can replace ": prmRegionID" by a proxy '& prmRegionID '. The above query will work well with"& prmRegionID = 2" and with "& prmRegionID = 2, 3". "

    But with this solution, I lost all the benefit of the use of bound variables (analysis hard against soft parse, possibility of SQL injection, etc.).

    I'm learning how to do this in SQL, as well as the use of UDT in this thread: How to move a list as a bind variable?

    But with this solution, I've lost nice SQL Developer user interface. In SQL developer, it is easy to test a query using the standard binding variable. When we start the application, a pop up asking for a value of the variable binding.

    With the UDT, the interface request always variable binding standard. You have an idea on how I can get a variable string binding (such as 1, 2, 10) in a set of NUMBER or VARCHAR2? This way I would be able to launch a standard query in SQL Developer to test my application.


    Can someone tell me what is the best approach to this?

    Thank you in advance,


    MB

    Hi Blais,

    Thank you for trying the SQL and PL/SQL instance before coming here - it was definitely the right approach, and you've got some very good suggestions there. Your needs for a invite only bind to the value in the clause list, I think I have a possible solution. I'll introduce you to a list of characters, so you'll have to tweak it for other types of data. First, add the following to your schema:

    create or replace
    TYPE bind_tab_typ AS TABLE OF VARCHAR2(4000);
    
    create or replace
    FUNCTION comma_to_table(iv_raw IN VARCHAR2)
    RETURN bind_tab_typ
    PIPELINED
    IS
       ltab_lname dbms_utility.lname_array;
       ln_len     BINARY_INTEGER;
    BEGIN
       dbms_utility.comma_to_table(list   => iv_raw
                                  ,tablen => ln_len
                                  ,tab    => ltab_lname);
       FOR i IN 1 .. ln_len LOOP
          PIPE ROW (ltab_lname(i));
       END LOOP;
    END;
    

    Now you can write a query, say for scott.dept, as follows, and have executed statement ask the value list in the clause as a single binding variable:

    select *
    from dept
    where dname in (
      select * from table( comma_to_table( :BNDS ))
    );
    

    When you are prompted, provide the list of values separated by a single comma without any extra spaces.

    I don't know if the Varchar2 (4000) really needs to be which is great. I use it because that's what dbms_utility.lname_array uses.

    Kind regards
    Gary
    SQL development team

  • How to replace the variable with the help OF the operator?

    Hello

    I'm creating a form where the user selects the check box which products he wants to see. After the choice, I should show all sales of this product, but the selection does not recognize the variable after the IN operator, for example:

    SELECT the product, price, quantity
    FROM the sale
    Product WHERE IN (vcProducts);

    Can someone help me?

    Cree

    I guess that vcProduct is a varchar2 variable where you have a chain of your prodids, as ' 4711,4712 concatinated, 4713'. May be you have each place value '. Is not the question, which is not part of the sql syntax set. You either have a list of enumeration or a subselect.

    Where do you need it? In the block or Pl/Sql where clause.
    In the latter case, you can configure the list in a variable (with enclosing "") and set the block where property.

    In the first of may by INSTR is useful, INSTR (vcProduct, vcDelim | table.prod_id | vcDelim) > 0. Make sure you have your list attached and separated by the vcDelim. If you prodct table with the number of lines (million), it can be slow because no index will be used.

    Dynamic sql or.
    Or write a subquery und temp-table.

  • Windows system environment variables in "Sql * more»

    Can I use/reference of Windows system environment variables in "Sql * more?
    For example, I want to create sql-script runs in the database server computer that variable is "ORA_HOME", uses this value to perform a few sentences of sql/plsql.

    Oracle 10g personal, Windows 7.

    Edited by: CharlesRoos the 12.11.2010 17:28

    CharlesRoos wrote:
    The business problem:
    I created 2 databases in my computer. The two databases needs storage created by a script. The names of data files (.dbf files) of storage are the same for the two database. The two database has its own directory, where it holds data for the moment files. At the moment the data files for Database1 are in the folder something like '% ORACLE_HOME%"\oradata\%databasename1%\*.dbf and the second base of data has its data files in the other folder, somewhere '' % ORACLE_HOME%"\oradata\%databasename1%\*.dbf'. Now I want the script to create the tablespace called "INDX" with the same data file name "indx1.dbf" in the two database. If in the two documents mentioned the 'indx1.dbf' file must be created by the script. I think the script must do following:

    1. get ORACLE_HOME.
    2. connect to database "databasename1"
    3. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename1 || indx1.dbf"
    4. connect to database "databasename2"
    5. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename2 || indx1.dbf"
    

    I don't have database Oracle close more, if the code was pseudo-code.

    ---

    I do not understand how to use?-shortcut.

    OK, my first impression is ' why must even be scripted? Creation of new spaces of storage is usually a one-off operation.

    But what side this substitution of sqlplus command line variables. This example is Linux, but works on Windows with the change in the way environment variables are referenced:

    * echo nix - $myvariable
    Windows - echo myvariable %

    First of all, sqlscript to create the TS. Note the use of the substitution variable '& 1 '.
    {code}
    [oracle@vmlnx01 ~] $ cat makets.sql cat
    set echo on the comments on check on trimsp on
    Guest & 1
    --
    CREATE TABLESPACE EDSTEST PETIT_FICHIER
    DATAFILE ' / ora01/oradata/&1/edstest.dbf'
    SIZE 5 M
    REUSE
    AUTOEXTEND ON
    NEXT 1280K
    MAXSIZE 32767M
    LOGGING
    LOCAL MANAGEMENT MEASURE
    SEGMENT SPACE MANAGEMENT AUTO
    ;
    --
    Drop tablespace edstest
    including content and data files
    ;
    output
    {code}

    Thus, the OS invites: note that the @ is separated by a space, which makes a parm from command line instead of the part of the connection string

    {code}
    [oracle@vmlnx01 ~] $ export myparm = vlnxora1
    [oracle@vmlnx01 ~] $ sqlplus system/pswd @makets $myparm

    SQL * more: Release 10.2.0.4.0 - Production on Fri Nov 12 18:13:05 2010

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > prompt & 1
    vlnxora1
    SQL >--
    SQL > CREATE TABLESPACE EDSTEST PETIT_FICHIER
    2 DATAFILE ' / ora01/oradata/&1/edstest.dbf'
    3 SIZE 5 M
    4 REUSE
    5 AUTOEXTEND ON
    6. THE NEXT 1280K
    7 MAXSIZE 32767M
    8 LOGGING
    MEASURE 9 LOCAL MANAGEMENT
    10 SEGMENT SPACE MANAGEMENT AUTO
    11;
    2 old: DATAFILE ' / ora01/oradata/&1/edstest.dbf'
    2 new: DATAFILE ' / ora01/oradata/vlnxora1/edstest.dbf'

    Created tablespace.

    SQL >--
    SQL > drop tablespace edstest
    2 content and data files including
    3;

    Tablespace has fallen.

    SQL > exit
    Disconnected from the database to Oracle 10 g Enterprise Edition Release 10.2.0.4.0 - Production
    With partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@vmlnx01 ~] $
    {code}

  • How can I report a number of variable with a precision of 127 type?

    I try to declare a variable with precision - like for example V_NUM NUMBER (1,127).

    According to oracle, it should be possible-

    http://docs.Oracle.com/CD/E11882_01/server.112/e41084/sql_elements001.htm#SQLRF30020

    2

    NUMBER[ (p [, s]) ]

    Number having precision p and scale s . Precision p may vary from 1 to 38. Wide s can vary from-84 to 127. Precision and scale are in decimal digits. A NUMBER value requires 1 to 22 bytes.

    but after the execution of the present

    declare

    Number V_NUM (1 127);

    Start

    V_NUM: = 1.2333333333333333333333234343435;

    DBMS_OUTPUT. PUT_LINE (V_NUM);

    end;

    /

    I got error (I know that p must be greater, then s - but I can't figured an example for this case s = 127)

    Error starting line: 1 at the controls.

    declare

    Number V_NUM (1 127);

    Start

    V_NUM: = 1.2333333333333333333333234343435;

    DBMS_OUTPUT. PUT_LINE (V_NUM);

    end;

    Error report-

    ORA-06502: PL/SQL: digital error or value: number too high accuracy

    ORA-06512: at line 4 level

    06502 00000 - "PL/SQL: digital error or the value of %s.

    * Cause: A digital arithmetic error, String, conversion or coercion

    has occurred. For example, this error occurs if an attempt is made to

    assign the NULL value to a variable declared NOT NULL, or if a

    attempt to assign an integer greater than 99 to a variable

    NUMBER (2) declared.

    * Action: Change the data, how it is handled, or how it is so declared

    that values do not violate the constraints.

    Is it possible to reach my goal?

    Ok. I found this ;)

    Thank you

  • Having problems with SQL Developer connection to the database on a LINUX machine

    Having problems with SQL Developer connection to the database on a LINUX machine
    Hello
    I am trying to connect my machine to windows 7 Home premium to an oracle database 11 g on RedHat 5 machine using SQL Developer. I got this error on SQL Developer
    Status: Failed - Test has failed: the network adapter could not establish the connection


    on Linux
    LSNRCTL> status
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                03-APR-2013 16:13:13
    Uptime                    7 days 22 hr. 16 min. 41 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/product/11.2.0/db_1/network/log/listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.X.X.X)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orc11g" has 1 instance(s).
    Instance "orc11g", status READY, has 1 handler(s) for this service...
    Service "orc11gXDB" has 1 instance(s).
    Instance "orc11g", status READY, has 1 handler(s) for this service...
    Service "orc11g_XPT" has 1 instance(s).
    Instance "orc11g", status READY, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL>
    and TNSPING
    tnsping 172.x.x.x
    
    TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 11-APR-2013 14:32:17
    
    Copyright (c) 1997, 2005, Oracle.  All rights reserved.
    
    Used parameter files:
    /u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
    
    Used EZCONNECT adapter to resolve the alias
    Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=172.x.x.x))(ADDRESS=(PROTOCOL=TCP)(HOST=172.x.x.x)(PORT=1521)))
    OK (0 msec)
    [oracle@ltebilling ~]$
    Tnsnames.ora on Linux,
    ORC11G =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.x.x.x)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orc11g)
    )
    )
    Listner on Linux,
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
    (PROGRAM = extproc)
    )
    )
    
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.x.x.x)(PORT = 1521))
    )
    )
    hosts/ect/Linux,
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1               localhost.localdomain localhost
    172.x.x.x             LTEBilling
    and there is no problem to ping linux from windows

    Published by: user11309581 on April 11, 2013 15:16

    user11309581 wrote:
    as I have already desciped earlier, I can't connect to the server throw Linux my Windows SQL Server, with error message below.
    tatus: failed - Test has failed: the network adapter could not establish the connection

    It's too generic to mean anything. The application is hidden the real error message. You got when you did the tnsping and obtained "TNS-12535: TNS:operation has expired. Now THAT's an error.

    This indicates a problem firewall and routing. You said earlier you could ping the server, but now we see tnsping fails. Two different protocols of usage, so that both the successful ping turns out a valid physical path, it guarantees not that all traffic will pass. What happens with

    c:\ telnet 172.x.x.x 1521
    
  • Connection problem with SQL Developer 3.0.0.4

    I have a strange problem with SQL Developer (SD) 3.0.0.4. So that the implementation of a new connection I have in double entries listed for some of the databases listed in my TNSNAMES.ora file. When I try to connect to one of the databases has entered duplicated, I get the following Oracle error:
    ORA-01034: Oracle not available ORA-27101: Kingdom does not exist SVR4 shared memory error: 2: no files or directory
    however, if I try to connect to the same database using SQL * more or TOAD, it works perfectly and TOAD has no duplicates.

    At first, I thought maybe that SD has been reading multiple copies of the TNSNAMES.ora so I checked and removed all the duplicate files and set the variable of environment TNS_ADMIN to point to that and the single instance of the TNSNAMES.ora file. Yet once, SQLPlus and TOAD to work fine, but SD is always showing entries twice and always have reported the above error when I try to connect to a database with a duplicate entry. I should mention, I'm able to connect to the database that have only a single entry listed use SD.

    If I understand correctly, SD uses JDBC as underlying connection mechanism. Based on this "agreement" I thought that maybe I had a file corrupted in the Java Cache, so I cleared the cache, but I always get errors.

    As mentioned, I use SQL Developer 3.0.0.4 with Java 1.6.0_11 (included in the download). In addition, I have installed JRE 1.6.0_24 and I am running Windows XP SP3. Any ideas or suggestions are greatly appreciated.

    Craig...

    Hi Craig,.

    Or, if I have misunderstood completely the scenario you describe, here's a post on the forum about duplicate entries appear in the drop-down list Alias network when the connection Type is TNS:

    Developer SQL 2.1.0.63 TNS name in characters of the connection

    This solution involves clean a bad TNSNAMES. ORA file with double score entries to test the death of SID.

    -Gary

  • Building the tree balanced with SQL hierarchical queries

    Hi all

    I have the following hierarchical data with different levels of subtree:

    A0
    -A001
    -A00101
    A1
    -A101
    A2
    -A201
    -A20101
    -A201010001

    A0 subtree has 3 levels, A1 subtree has 2 levels and subtree of the A3 is level 4. I want to generate a tree balanced on the data with all levels of the subtree equal to the maximum number of levels available in the whole tree which, in this particular case, is 4.

    I don't know that it is possible with SQL. Script to generate the above mentioned are as below:

    CREATE TABLE codes_tree
    (node_id VARCHAR2 (10))
    parent_node_id VARCHAR2 (10)
    );
    INSERT INTO codes_tree VALUES ('A0', NULL);
    INSERT INTO codes_tree VALUES ('A001', 'A0');
    INSERT INTO codes_tree VALUES ('A00101', 'A001');
    ---
    INSERT INTO codes_tree VALUES ('A1', NULL);
    INSERT INTO codes_tree VALUES ('A101', 'A1');
    ---
    INSERT INTO codes_tree VALUES ('A2', NULL);
    INSERT INTO codes_tree VALUES ('A201', 'A2');
    INSERT INTO codes_tree VALUES ('A20101', 'A201');
    INSERT INTO codes_tree VALUES ('A201010001', 'A20101');

    Any help will be much appreciated.

    Thank you... Best regards

    Published by: naive2Oracle on May 12, 2011 19:40

    Published by: naive2Oracle on May 12, 2011 19:41

    Hello

    Of course, you can do it in SQL.
    One way is to take the normal output of hierarchical and manipulate the result set so that the leaves are repeated as often as necessary to make all branches of the same length. I have Oracle 10.2 available right now, so here's a solution that will work in Oracle 10 (and more):

    WITH     original_hierarchy     AS
    (
         SELECT     node_id
         ,     LEVEL               AS lvl
         ,     CONNECT_BY_ISLEAF     AS isleaf
         ,     ROWNUM               AS rnum
         FROM     codes_tree
         START WITH     parent_node_id     IS NULL
         CONNECT BY     parent_node_id     = PRIOR node_id
    )
    ,     got_max_lvl     AS
    (
         SELECT     o.*
         ,     MAX (lvl) OVER ()     AS max_lvl
         FROM     original_hierarchy     o
    )
    SELECT       LPAD ( ' '
                , 3 * ( ( d.lvl
                     + NVL (c.rnum, 1)
                     - 1
                     )
                   - 1
                   )
                ) || CASE
                   WHEN c.rnum > 1
                   THEN '*' || d.node_id || '*'
                   ELSE        d.node_id
                  END          AS display_id
    FROM            got_max_lvl     d
    LEFT OUTER JOIN       got_max_lvl     c  ON     d.isleaf     = 1
                           AND     c.rnum          <= 1 + d.max_lvl - d.lvl
    ORDER BY  d.rnum
    ,       c.rnum
    ;
    

    With the help of Oracle 11.2, it would be preferable to generate original_hierarchy as above, but to manipulate using a WITH recursive clause.
    Analytical functions often interfere with CONNECT BY, so I used a separate subquery to get max_lvl, do CONNECT BY in a sub-querry and analytic function in a separate subquery. I don't know what is needed on all versions.

    Output of your sample data:

    DISPLAY_ID
    -------------------------------
    A0
       A001
          A00101
             *A00101*
    A1
       A101
          *A101*
             *A101*
    A2
       A201
          A20101
             A201010001
    

    Below is a generic version of the same query, which I used to test this on scott.emp:

    DEFINE     table_name     = scott.emp
    DEFINE     id_col          = empno
    DEFINE     parent_id_col     = mgr
    DEFINE     display_col     = ename
    
    WITH     original_hierarchy     AS
    (
         SELECT     &display_col          AS display_txt
         ,     LEVEL               AS lvl
         ,     CONNECT_BY_ISLEAF     AS isleaf
         ,     ROWNUM               AS rnum
         FROM     &table_name
         START WITH     &parent_id_col     IS NULL
         CONNECT BY     &parent_id_col     = PRIOR &id_col
    )
    ,     got_max_lvl     AS
    (
         SELECT     o.*
         ,     MAX (lvl) OVER ()     AS max_lvl
         FROM     original_hierarchy     o
    )
    SELECT       LPAD ( ' '
                , 3 * ( ( d.lvl
                     + NVL (c.rnum, 1)
                     - 1
                     )
                   - 1
                   )
                ) || CASE
                   WHEN c.rnum > 1
                   THEN '*' || d.display_txt || '*'
                   ELSE        d.display_txt
                  END          AS display_id
    FROM            got_max_lvl     d
    LEFT OUTER JOIN       got_max_lvl     c  ON     d.isleaf     = 1
                           AND     c.rnum          <= 1 + d.max_lvl - d.lvl
    ORDER BY  d.rnum
    ,       c.rnum
    ;
    

    Output:

    DISPLAY_ID
    -----------------------------
    KING
       JONES
          SCOTT
             ADAMS
          FORD
             SMITH
       BLAKE
          ALLEN
             *ALLEN*
          WARD
             *WARD*
          MARTIN
             *MARTIN*
          TURNER
             *TURNER*
          JAMES
             *JAMES*
       CLARK
          MILLER
             *MILLER*
    

    Published by: Frank Kulash, May 13, 2011 06:38
    Adding the generic version

  • How to use a variable binding in an IN clause

    I'm trying to use a variable binding in an IN clause where the column is a type varchar2. Something like:
    select *
    from test
    where test_column in (:bindVariable)
    I tried the assignment of channels bind variable separated by commas (for example, test, test, test) and separated by commas strings with quotation marks (for example. 'test', 'test', 'test'). None of these work. Anyone know the correct way to do this?

    Thanks in advance.

    http://tkyte.blogspot.com/2006/06/varying-in-lists.html

    Presents many options.

  • Variable with a value. «PURGE error: bad Argument Type.»

    
    

    Hi, my 50G calculator accuses a value for the variable 'X' but I can't find it in any directory, and when I try to delete I get the message "' PURGE error: bad Argument Type." " I also have the theta variable with the same problem. How can I remove the value of these variables? TKS

    In addition to Make suggestions, two other possibilities come to mind: 'X' can be a directory object (which would cause the error to the wrong Type of Argument because non-empty directory objects cannot be purged by PURGE, but must be purged by PGDIR), or it could be a local variable (which can only be served by putting an end to the environment that created which is usually a program).  So if Make suggestions don't work, try foster 'X' PGDIR and if that does not work, try KILL (which ends all the current environments).

    If those WHO do not work, please do 'X' TYPE HOME and tell us what object type 'X'.

    DISCLAIMER: I do not work for HP; I'm a happy user of HP Calculator.

  • Create a procedure SQL with SQL toolkit

    Hello

    I use the SQL Toolbox to get data from a MySQL database (using ODBC connectors).

    I would like to automatically create a procedure on my DB when lauching my application software, so that I do not know there is when I use it.

    But I can't figure out how to do with the SQL Toolbox.

    Indeed, you try to run this script (which works by operating on MySQL workbench) returns the following error:

    DELIMITER $$

    CREATE DEFINER='indus'@'%' PROCEDURE ' FPY'(datetime IN START_DATETIME, IN END_DATETIME datetime)
    BEGIN
    CREATE a temporary table ListingUUT
    (
    UUT_SERIAL_NUMBER VARCHAR (127).
    TEST_COUNTER INT,
    DateTime TEST_TIME,
    UUT_STATUS VARCHAR (32)
    );

    CREATE a temporary table Stat_FPY
    (
    TESTED INT,
    TESTED_ONCE INT,
    REPORT / FLOAT
    );

    INSERT INTO Stat_FPY VALUES (0,0,0).
    INSERT INTO ListingUUT
    (
    SELECT
    UUT_SERIAL_NUMBER, SUM (1), START_DATE_TIME, UUT_STATUS
    OF booster_results.uut_result
    WHERE START_DATE_TIME BETWEEN START_DATETIME AND END_DATETIME
    UUT_SERIAL_NUMBER GROUP
    ORDER BY DESC START_DATE_TIME
    )
    ;

    END

    -Online error-2147217900 took place at NI_Database_API.lvlib:Conn Execute.vi-> Untitled 1

    Possible reasons:
    ADO error: 0x80040E14
    Exception occurred in the Microsoft OLE DB provider for ODBC drivers: [MySQL] [ODBC 5.2.a Driver] [mysqld - 5.6.10 - log] you have an error in your syntax SQL; consult the manual for your version of the MySQL server for the right syntax to use near ' DELIMITER $$

    CREATE DEFINER='indus'@'%' PROCEDURE ' FPY '(IN START_DATETIME datet' à la ligne 1 en NI_Database_API.lvlib:Conn Execute.vi-> sans titre 1)

    An idea so that I can create the procedure?

    Finally, give up on the creation of the procedure with SQL Toolkit functions.

    In fact using exec.vi system to address directly the command-line mysql server...

  • How to establish links of Labview with SQL server database Toolkit

    I'm a database newbie, but I have to use MS SQL server (2008) to store my data. I am well equipped with all the features of Labview, don't know how to use it properly. I now complete development, including the toolbox database. My latest version of labview is 8.6.1. Side material, I have cFP2220 and many modules of differnet kind.

    Here is a useful link that I found on the web:

    1. I got the database creation procedure (pdf file) to link the udl.

    http://decibel.NI.com/content/docs/doc-4602

    It gives a step-by-step login procedure to MS Access, and I'm able to save data to MS Access with the database Toolbox. However, I could not understand how to establish a chain of connection or udl to SQL server. In other words, I hope someone can explain in detail what is the procedure to set up such a link.

    2. I learned about the forum that there is a LabSQL, but it takes some knowledge of SQL statement. I would walk away from him, as I am not familiar with SQL.

    3. the VI I used for the recording of data in DB are very similar to "Create database Table.vi" found in the sample.

    In short, I think that I just need someone who has experience with the connection to the server SQL with Labview to show me the steps to link to SQL.

    Thank you very much

    You may not create a database in SQL Server using the control panel ODBC or a UDL. You must create a database by using SQL Server tools. (In fact, you can use SQL statements to create a database, which is what's really going on by using SQL Server tools. However, I don't know if the database Toolbox has the screws required to send these types of SQL statements.). Once you have created the database you can create tables using SQL Server tools, or you can use the screw of toolbox database.

    You try to run SQL Server on your computer? SQL Server is usually running on a server. You try to use SQL Server Express?

    Assuming that you have SQL Server running and a database has been created, then here are the steps needed to create a UDL to connect:

    1. In Windows Explorer, create a text file and rename the text file so that there a .udl extension (like this PDF).
    2. Double-click the UDL file.
    3. Change to the tab 'supplier '.
    4. Select 'Microsoft OLE DB for SQL Server provider'.
    5. Click on the ' next > ' button. It changes you to the tab 'connection '.
    6. In the drop-down menu, select your SQL Server. If it is not listed, try clicking on the Refresh"" button. If this does not meet the list, then you will need to enter manually.
    7. In the section "#2" specify the authentication method and credentials, if necessary, to connect to SQL Server.
    8. In the section "#3" specify the database that will be used, which is the one that you created earlier using the SQL Server tools. NOT SELECT THE MASTER DATABASE. If you do, you will completely screw up your installation of SQL Server.
    9. Click "Test connection" to verify that you can connect to SQL Server.

Maybe you are looking for

  • EliteBook 850 G2: SimplePass absent of the software recovery disk

    Hello First of all, I don't know if I post the question in the right place, and I apologize if I'm not. I bought the laptop with windows 7 and received two CDs with it, one for install windows 10 and the other to re - install the software that came w

  • VI running in several sub-panels

    I am creating an application in which I can run a vi in two sub-panels, simultaneously. The only way I could make it work is by saving the vi as a template, .lives. There are concerns that I should have when using a saw instead of a vi in my applicat

  • Modulo 10G sfp + by powerconnect 7048

    Salve, Sono alla ricerca del modulo di expansion in oggetto by uno pass di UN nostro client che ha G7SYZY1 st da schede tecniche should be part n. J3PC9 You can help? Grazie

  • Smartphones blackBerry upgrade adobe flash player

    Hello! I can't play a video on my facebook mobile. It says I have to update my adobe flash player... so I'm going to the link adobe flash player, but unfortunately the flash drive says that it does not support the unit... someone knows how to treat t

  • touch not apperaring

    Has anyone ever started to develop an image and the 'done' button this normal is displayed at the bottom right is not there and the picture number appears at the top left as well