How to write a query to join and right join

Hello

With the help of 10 gr 2:

I have a scenario where generate us a report by joining a few tables.

same goes for ex:

Select col1, col2, col5, col10 col22...

from tableA, tableB.

where tableA.col1 = tableB.col1 etc.

I have a requirement where choose a flag in the front-end server must be a right join.  so, if the flag is N, I need to return the data returned by the join; but, if the flag is there I need to make a right join and returns all the data corresponding to table A and table B, as well as the data in table B.

(I did mention only two tables, as they are, they main engines, there are very many other tables joined in this request)

It is possible to write a query, so that the two scenarios can be addressed based on the flag?

Thanks in advance

Hello

user565033 wrote:

... When Oracle treats of the WHERE clause that starts from the bottom or the top?  So it's best to put filters that reject the unnecessary lines at the beginning of the place where clause or end?  Is how important it? ...

No, it does not matter.

The optimizer evaluates what condition will be faster and/or more selective (that is, will eliminate the most lines) and make the first condition.

If the optimzer cannot decide on what terms will be faster or more selective, it can arbitrarily don't close at the end of the WHERE clause first, but, even if you already knew for sure, this is exactly the kind of thing that is likely to change from one version to the other, or platform to another.

The optimizer (in recent versions, at least) is very good.  If the optimizer can not say what conditions should apply first, then, chances are, there is really no significant difference, so it would be not serious of which one was made first.

If you read something that indicates the order is important, it is very outdated.  Long ago (version 6), there was no cost-based optimizer and the order of the conditions in the WHERE clause was important.  The cost-based optimizer was introduced in Oracle 7 (1992) and has been greatly improved by Oracle 8.1 (1998).  Also later Oracle 10, the older optimizer ("regulated") was available for those who really want to continue to use it.

Tags: Database

Similar Questions

  • How to write a query to return rows with the varchar column that contains even a single occurrence of the characters, such as Ÿ and

    How to write a query to return rows with the varchar column that contains even a single occurrence of the characters, such as Ÿ and

    I have a table whose columns with values such as

    MINNEAŸPOLIS and ¿VV ¿A

    Only the characters that are allowed in this column are alphabets, numbers, spaces, points and supports.

    Please help to write a SQL SELECT with Regexp_like query or any other option.

    Thanks to you all! Under query worked for me. Thank you Frank to explain the concept of hooks inside regexp_like.

    SELECT * FROM testspecial, WHERE REGEXP_LIKE (sampletext, "[^] ^ A - Z ^ a - z ^ 0-9 ^ [^.]") ^ {^} ^]') ;

  • How to write the query option in expdp

    Hi Please someone help me how to write the query option in expdp... .in expdp using the query option...

    where AM columnname between 5 May 12 02:57:00.000' and ' 02:59:59.999 6 May 12: ';


    Please do what is necessary...

    Pavan Kumar says:
    QUERY = (columnname scott.test: "where between 5 May 12 02:57:00.000 h ' and ' 6 May 12 AM 02:59:59.999'")

    Who will fail in databases, because you assume nls_date_format. How it is difficult to put to_date() surround channels? Rather than play with quotation marks, using one parfile thusly.

    query=table_owner.table_1:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')"
    query=table_owner.table_2:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')"
    query=table_owner.table_3:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')"
    

    You do not have to have all the clauses in a single line, as they are side by side parfile, which would be enough. For this reason parfile is better than the command line in order to avoid all the back-citing dance.

  • How to write a query for the data exchange between two columns?

    How to write a query for the data exchange between two columns?

    I tried a request, does NOT work.
    update tmp t1 set t1.m1=t1.m2 and t1.m2=(select t2.m1 from tmp t2 where t2.student_id = t1.student_id)
    Thank you.

    Published by: user533361 on October 23, 2009 14:04

    Just plain and simple:

    update tmp t1
     set t1.m1=t1.m2,
         t1.m2=t1.m1
    /
    

    SY.

  • No idea how to write this query

    Hi, My Data is as below

    DocNum doc_date type of amount
    1154 15 November 11 232501.5 invoice
    200206 4 November 11 - 243672.64 credit memo
    Note flow 111 5 November 555.22 11

    Output must be

    DocNum doc_date amount Type AmountDR AmountCR
    1154 232501.5 15 November 11 Bill 232501.5
    Note credit 200206 4 November 11 - 243672.64 - 243672.64
    Note flow 111 5 November 555.22 11 555.22

    If the amount is > 0, then it must be displayed in the value of the amount to be AmountDR
    If amount < 0 then it must be displayed in the value of the sum amount CR



    Can help how to write this query
    with sample_table as (
                          select 1154 Docnum,date '2011-11-15' doc_date,232501.5 Amount,'Invoice' type from dual union all
                          select 200206,date '2011-11-04',-243672.64,'Credit Memo' from dual union all
                          select 111,date '2011-11-05',555.22,'Debit Memo' from dual
                         )
    select  Docnum,
            doc_date,
            Amount,
            type,
            case
              when Amount >= 0 then Amount
            end AmountDR,
            case
              when Amount < 0 then Amount
            end AmountCR
      from  sample_table
    /
    
        DOCNUM DOC_DATE      AMOUNT TYPE          AMOUNTDR   AMOUNTCR
    ---------- --------- ---------- ----------- ---------- ----------
          1154 15-NOV-11   232501.5 Invoice       232501.5
        200206 04-NOV-11 -243672.64 Credit Memo            -243672.64
           111 05-NOV-11     555.22 Debit Memo      555.22
    
    SQL> 
    

    SY.

  • How to write this query in the hierarchy

    Hi gurus,

    Really need your help on this query.  Thank you very much in advance.

    SELECT
      t1.key as root_key ,
    (SELECT
          t2.unit_id AS unit_id 
          level-1 AS level ,
          t2.name,
          t2.creator
        FROM
          tab t2
          START WITH t2.unit_id       =   t1.unit_id            -----check each node as root
          CONNECT BY prior t2.unit_id = t2.parent_unit_id
    
      )
       t1.name as parent_unit_name
    FROM
      tab t1
    

    I'll write a query of the hierarchy as above, and that EACH line (node, totally more than 10200) is checked as root node to see how many sheets are accessible for her... It must be implemented in a single query.

    I know inline query should NOT return multiple rows or multiple columns, but the inline elements are necessary and can certainly be made in a correct solution.

    (env):

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production

    PL/SQL Release 12.1.0.2.0

    )

    Test data:

    select 1 as unit_id, null as parent_organization_unit_id, 'U1' as name from dual
    union all
    select 2, 1, 'U2' FROM DUAL
    UNION ALL
    SELECT 3, NULL, 'U3' FROM DUAL
    UNION ALL
    SELECT 4, 3, 'U4' FROM DUAL
    UNION ALL
    SELECT 5, 2, 'U5' FROM DUAL
    UNION ALL
    SELECT 6, 5, 'U6' FROM DUAL
    UNION ALL
    SELECT 7, 6, 'U7' FROM DUAL
    UNION ALL
    SELECT 8, 5, 'U8' FROM DUAL
    UNION ALL
    SELECT 9, 5, 'U9' FROM DUAL;
    

    Final result should be like this

    key unit_id,    level,   name, parent_name
    1    1    0    u1      u1
    1    2    1    u2       u1
    1    5    2     u5      u1
    1    6    3     u6      u1
    1    7    4    u7       u1
    1    8    3    u8       u1
    1    9    3     u9      u1
    2    2    0     u2       u2
    2    5    1      u5       u2
    2    6    2     u6       u2
    2    7    3      u7      u2
    2    8    2      u8       u2
    2    9    2      u9       u2
    
    

    Don't know how get you your output, it does not match your data...

    with tab as)

    Select 1 as unit_id, null as parent_organization_unit_id 'U1' as the name of double

    Union of all the

    Select 2, 1, 'U2' FROM DUAL

    UNION ALL

    SELECT 3, NULL, 'U3' FROM DUAL

    UNION ALL

    SELECT 4, 3, 'U4' FROM DUAL

    UNION ALL

    SELECT 5, 2, 'U5' OF THE DOUBLE

    UNION ALL

    SELECT 6, 5, 'U6' OF THE DOUBLE

    UNION ALL

    SELECT 7, 6, "U7" OF THE DOUBLE

    UNION ALL

    SELECT 8, 5, 'U8' FROM DUAL

    UNION ALL

    9. SELECT, 5, 'U9' FROM DUAL

    )

    Select dense_rank() key (order by connect_by_root unit_id), unit_id, level - 1 as 'LEVEL', connect_by_root name root_parent_name

    t tab

    Start with parent_organization_unit_id is null

    Connect prior unit_id = parent_organization_unit_id

    KEY UNIT_ID LEVEL ROOT_PARENT_NAME
    1 1 0 "U1".
    1 2 1 "U1".
    1 5 2 "U1".
    1 6 3 "U1".
    1 7 4 "U1".
    1 8 3 "U1".
    1 9 3 "U1".
    2 3 0 "U3".
    2 4 1 "U3".
  • How to write conditional query?

    I have a use case-

    on the basis of the value of the entry, I need to run the query.

    for example

    Select * from employees where em em. empId =? and em.firstname =? and em.jobid =?
    Select * from employees where em em. empId =? and em.firstname =?

    I need to write a query that is used internally this time condition and return records

    Select * from employees where em
    If (EM.) JobID is nothing)
    {
    Select * from employees where em em. empId =? and em.firstname =?
    }
    on the other
    {
    Select * from employees where em em. empId =? and em.firstname =? and em.jobid =?
    }


    How could I write this problem in sql?

    Hello

    You can try the following:
    Select * from employees where em em. empId =? and em.firstname =? and (em.jobid =? or em.jobid is null).

    Kind regards
    Rommel Pino
    http://soadev.blogspot.com

  • How to write a query for the given scenario?

    Hi all

    I have two tables EMP, DEPT with data below.
    EMP TABLE: -.
    SAL DEPID EMPLOYMENT ENAME EID
    111 RAM 1500 10 MANAGER
    222 SAM ASST MANAGER 2000 20
    KALA 333 2500 10 REGISTRAR
    444. BIMA 20 3000 MANAGER
    CHALA 555 MANAGER 3500 30
    RANI 666 ASST MANAGER 4000 10
    777 KAMAL MANAGER 2400 10

    DEPT TABLE: -.

    DEPID DNAME
    XX 10
    AA 20
    30 ZZ

    Q1: I want the sum of the salary of each Department and for the particular job. Here, in each Department manager, Assistant Manager, clerk positions are there.
    I want to display the result as below...
    10-20-30 JOBS
    --------------------------------------------------------------------------
    MANAGER OF 3900 3000 3500
    ASST MANAGER 4000 2000 NULL
    THE CLERK 2500 NULL NULL

    Please tell me how to write a sql query?

    Thank you
    SAI
    SQL> SELECT job,
      2         MAX(DECODE(deptno, 10, sum_sal)) "10",
      3         MAX(DECODE(deptno, 20, sum_sal)) "20",
      4         MAX(DECODE(deptno, 30, sum_sal)) "30"
      5  FROM (SELECT deptno, job, SUM(sal) sum_sal FROM emp GROUP BY deptno, job)
      6   GROUP BY job;
    
    JOB               10         20         30
    --------- ---------- ---------- ----------
    CLERK           1300       1900        950
    SALESMAN                              5600
    PRESIDENT       5000
    MANAGER         2450       2975       2850
    ANALYST                    6000
    
    SQL> 
    
  • How to write a procedure to call and run the custom package backend

    Hi all

    Oracle 10g
    Oracle Apps R12

    I work with here oracle order management, we have a package called (Pick Release) to customize. Due to a problem, we have this concurrent program execution manually giving Route_id as parameter. The route_id comes from the road to the Table. By using this query

    Select distinct route@DB_LINK_APPS_TO_ROADSHOW route_id
    When trunc (route_date) = trunc (sysdate + 2).

    on a daily basis, we have almost 42 routes and we run this simultaneous program manually close times.

    so now how to write a procedure for this

    Step 1 make the route to the routing table. (By cursor we can get the route_id accordingly)

    Step 2 How to trigger custom backend package and run accordingly to this output of the cursor (route_id)

    If 40 routes of cursor get is - that the simultaneous program runs 40 times according to this route_id.


    can some could provide the steps to do this


    Thanks and greetings

    Srikkanth.M

    To submit a competing request from the back - end:

    FND_REQUEST. SUBMIT_REQUEST (Client or server)

    Summary

    function FND_REQUEST. SUBMIT_REQUEST

    (application IN varchar2 default NULL,

    program IN varchar2 NULL by default,

    Description IN varchar2 default NULL,

    start_time IN varchar2 default NULL,

    sub_request IN default boolean FALSE

    Argument1,

    argument2,..., argument99.

    Return to argument100 number);

    Description

    Submits a competing treatment by a simultaneous Manager. If the query is successful, this function returns the ID of the concurrent request; Otherwise, it returns 0.

    ATTENTION: FND_REQUEST needs to know information about the user and accountability whose application is submitted. Therefore, this feature works of concurrent programs or forms within the Oracle Applications.

    The FND_REQUEST. SUBMIT_REQUEST function returns the ID of the concurrent application after successfully. It is up to the caller to issue a commit to complete the application.

    Your code should retrieve and handle the error message generated if there is a problem of presentation (the ID of the concurrent request returned is 0). Use FND_MESSAGE. RETRIEVE and FND_MESSAGE. ERROR to retrieve and display the error (if the application is made on the client side).

    Related essays: overview of the Message dictionary (see page)

    You must call FND_REQUEST. SET_MODE before calling FND_REQUEST. SUBMIT_REQUEST of a database trigger.

    If FND_REQUEST. SUBMIT_REQUEST fails to go anywhere but a database trigger, database changes are cancelled until the time of the function call.

    After a call to the FND_REQUEST. SUBMIT_REQUEST function, installation of all parameters are reset to their default values.

    Arguments (input)

    short name of the application associated with the concurrent request for enforcement.
    short simultaneous program (not the executable) name of the program for which the application must be made.
    Description Description of the application that appears in the form of concurrent requests (optional).
    start_time time during which demand is expected to start running in the (optional) HH24 or HH24:MI:SS format.
    sub_request set to TRUE if the request is made by another application and should be treated as a subquery.
    From version 11, this parameter can be used if you submit requests for in a concurrent program of PL/SQL stored procedure.
    argument1... 100 arguments for the concurrent request; up to 100 arguments are allowed. If the Oracle Forms submitted, you must specify all arguments of 100.

  • How to write the query

    Hello

    How to write the sql query

    I have three type of table as

    1 table emp

    EMP_ID FIRST_NAME DEPT_ID

    ---------- -------------------- ----------

    1 kumar 10

    2 sam                          20

    3 30 damu

    2 table dept

    EMP_ID SALE_ID DEPT_ID

    ---------- ---------- ----------

    1 101 10

    2 102 20

    3 103 30

    3. table sale

    EMP_ID SALE_ID SALE_AMT

    ---------- ---------- ----------

    1 101 7

    2 102 8

    3 103 9

    I want the result as

    EMP_ID DEPT_ID SALE_AMT

    -------      ---------   -            --------

    1                10                  7

    Thank you

    Are you looking for this?

    SELECT T1. EMP_ID,

    T1. DEPT_ID,

    W3M SALE_AMT

    FROM EMP T1,

    SALE T3

    WHERE T1. EMP_ID = T3. EMP_ID;

    OUTPUT:

    EMP_ID DEPT_ID SALE_AMT

    ------- ---------- ----------

    1         10          7

    2         20          8

    3         30          9

    If this is not the case, after the actual output, you need. Because that gives you the amount of sales deptwise

  • How to write the query with parameters below and is null


    Hi, I need to recover the data if the parameter is passed on the ground, else retrieve all records where the field is null

    Example of


    CREATE TABLE DEPT
    (DEPTNO NUMBER (2),)
    DNAME VARCHAR2 (14).
    LOC VARCHAR2 (13));

    INSERT INTO DEPT VALUES (10, 'ACCOUNTING', 'NEW YORK');
    INSERT INTO VALUES DEPT (20, 'SEARCH', 'DALLAS');
    insert into dept values (30, 'SALES', 'CHICAGO');
    INSERT INTO VALUES DEPT (40, 'OPERATIONS', 'BOSTON');

    ALTER table dept add (object_id number);
    insert into dept values (50, 'OPERATIONS', 'BOSTON', 1);
    insert into dept values (60, 'OPERATIONS', 'BOSTON', 1);
    INSERT INTO VALUES DEPT (70, 'OPERATIONS', 'BOSTON', 2);

    Select * from Department where object_id =: p_object_id

    If I pass the object_id 1, it shloud retrieve the values of dept with object_id 1, but if I don't pass the object_id, it must retrieve all records where object_id is null

    IF 1 is passed as the id of the object, he must recover, 50, 60, if 1 is not passed as object_id it should 10,20,30,40 retive

    It works fine for me separately as,.

    Select * from Department where object_id =: p_object_id - 1

    Select * from Department where the object_id is null;

    Is it possible to do in a single query.

    Thank you

    SELECT *
    FROM dept
    WHERE object_id = :p_object_id
    OR (object_id is null and :p_object_id is null)
    

    is an approach.  It's a little talkative, but the meaning is clear.  If you can identify a value that would never appear in the data (for example-1)

    WHERE nvl( object_id, -1 ) = nvl(p_object_id, -1 );
    

    Justin

  • How to write this query?

    Hi people,

    I need to get a query in which a set of records, I get ONLY those which previous registry has a field with a value to this topic. Other values, the field can contain are not necessary.

    I know that sounds easy but... I can't get it.

    So, for Oracle 10 g 2... Here's my query:

    SELECT a.person_id, a.person_status, a.message_id, a.order_id

    OF t_HR one

    WHERE a.person_status = "rejected".

    AND a.id >

    (SELECT max (b.id)

    OF t_HR b

    WHERE b.person_id = a.person_id

    and b.order_id = a.order_id

    AND b.person_status! "revised =".

    B.ID AND < a.id)

    ORDER BY desc a.id

    Let me explain:

    1 - HR table is a table of people. These people has serveral STATUS.

    2 - ID is a sequential (each www.voyages-sncf.com has a different identification number).

    3 - the application must get THAT all people "rejected".

    4. - However, (subquery) I need ONLY those that previous register (the second register) holds a status of "OK". If the person holds a "revised" status he's not, he should be the next register (the third)

    5.-L' ORDER ID DESC, so is the first register must have a STATUS = "rejected" and the second a 'OK '.  IF the second register = "revised", then the third register must be 'OK '. And I need this query.

    HOW DO?

    My problem: the subquery gives you previous register of the same guy, but... it does not give you the value of the State, I need, which is 'OK '.

    I tried to add to the subquery...

    SELECT max (b.id)

    OF mod_human_resource b

    WHERE b.person_id = a.person_id

    and b.order_id = a.order_id

    AND b.person_status = 'OK '.

    AND b.id < a.id

    ... but if I have 5 records of that person, the first is "rejected", the second is "accepted", the third is 'new' and the fourth is 'OK'... the subquery gives you the 4th register and which is not correct for me, it must be only the second one (prior to the first State registry).

    I need to be a query, because I need to use it on a MERGER for a DWH.

    If there is another way (function, or even a procedure) to make the MERGER rather than with a request, which would be ok too. I am poor DWH knowledge.

    Thanks in advance.

    Hello

    So, you need to know if a line is the 'first' line, and you should also know what is the 'next' status, (even the 'first' and 'next' are already defined).  This sounds like a job for analytical functions.  ROW_NUMBER can tell you if a line is first or not, and LEAD can tell you what a value on the next row.

    Since you post CREATE TABLE and INSERT statements for your own table, I'll use the table scott.emp to illustrate.

    Consider these data from scott.emp:

    SELECT DeptNo

    ename

    work

    FROM scott.emp

    ORDER BY deptno

    ename DESC

    ;

    Output:

    DEPTNO ENAME JOB

    ---------- ---------- ---------

    10 MILLER CLERK

    PRESIDENT OF KING 10

    MANAGER 10 CLARK

    20 SMITH CLERK

    ANALYST SCOTT 20

    20 JONES MANAGER

    20 FORD ANALYST

    20 ADAMS CLERK

    30 WARD SALESMAN

    SELLER OF 30 TURNER

    30 MARTIN SALESMAN

    30 JAMES CLERK

    MANAGER BLAKE 30

    30 ALLEN SALESMAN

    Now, let's say we want only who know the departments where the forefront (in order descending ename) a job = 'CLERK', and the following line (also in descending by ename order) = "ANALYST" job, and we want to know the ename of the first row.  In other words, the correct output is:

    DEPTNO ENAME

    ---------- ----------

    20 SMITH

    Note that deptno = 10 is not included, even if the first task is to "CLERK." that was because the second job in deptno = 10 is the "PRESIDENT", not "ANALYST."

    Here's a way to get these results:

    WITH got_analytics AS

    (

    SELECT ename, deptno, job

    ROW_NUMBER () OVER (PARTITION BY deptno

    ORDER BY ename DESC

    ) AS r_num

    LEAD (employment) OVER (PARTITION BY deptno

    ORDER BY ename DESC

    ) AS next_job

    FROM scott.emp

    )

    SELECT deptno, ename

    OF got_analytics

    WHERE r_num = 1

    AND job = 'CLERK '.

    AND next_job = 'ANALYST '.

    ;

    I hope that answers your question.

    If this isn't the case, then, as Dan (and the FAQ forum) said, post CREATE TABLE and INSERT statements for some sample data and the exact results you want from these data.

    Post your query, based on the one I have posted more top and ponit out where he gets results.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

  • How to write this query procedure of ina

    IF ((drapeau = ' n ') OR (flag = 'F') OR (FLAG =' WAS))
    ) THEN
    SELECT CUSTOMER_ID, BUSINESS_PASSCODE, LOG ON TO V_CUSTOMER_ID, V_BUSINESS_PASSCODE, V_LOG OF THE CUSTOMER
    WHERE V_BUSINESS_PASSCODE AND V_CUSTOMER_ID = & ID = & CODE AND
    V_LOG IN('Y')
    SO I HAVE TO RETURN THE ISP (OF TYPE VARCHAR) CAN YOU TELL HOW DO

    Make values flag, id, code as a parameter and an output parameter. You can have any number f settings if you want to return the results of the query.

    as
    create procedure (identification number, varchar2, varcahr2, out returnvalue flag code varchar2)
    as
    Start
    -your code

    ---

    --
    IF ((drapeau = ' n ') OR (flag = 'F') OR (FLAG =' WAS))
    ) THEN
    SELECT CUSTOMER_ID, BUSINESS_PASSCODE, LOG ON TO V_CUSTOMER_ID, V_BUSINESS_PASSCODE, V_LOG OF THE CUSTOMER
    WHERE V_CUSTOMER_ID = ID AND CODE = V_BUSINESS_PASSCODE AND
    V_LOG IN('Y');
    returnValue =;

  • How to write a query in 10g

    Hi guys,.

    In 10g DB.

    I'm when extracting data value_column, the column having empids for most lines, but for some emailids lines.


    The data that I get like this: here, I associate myself with three tables. based on these data, I need to recover only emailids.

    VALUE_COLUMN

    2959345
    [email protected]
    6560043
    2392044
    [email protected]

    now, I want to get for all emailids only employees. so wherever empid is present, I need to get the email for this employee.

    Please can someone help me on this.

    Thanks in advance!

    Rgrds,
    -LRK

    Hello

    Whenever you have a problem, after a little bit database (CREATE TABLE and INSERT, only relevant columns instructions) samples and the results desired from these data.

    How do you know if value_column is an email address and empid or something else? I'm going to assume that any string containing the cahracter ' @' is an email address, and everything else is an empid.

    When value_column contains an empid, how do you have the email address? I'll assume you have another column that contains the email address in these cases.

    Here's a way to do it, given only value_column and other this column

    SELECT     CASE
             WHEN  INSTR (value_column, '@') != 0
             THEN  value_column
             ELSE  some_other_column
         END     AS email
    FROM     table_x
    ;
    

    However, it would be better to re - write a part of your existing application, to produce the same results more effectively.

  • How to write constantly to analog output and read from analog inputs

    Hi all -

    I had a question about writing continuously to analog output reading simultaneously an analog input.

    It's my first time to post a message to the community, so please let me know if I made mistakes.

    I use Labview 2011 with a NEITHER-DAQ USB 6215.

    I'm looking to generate a waveform and write it continuously in an analog output. It is then connected to an entry on the acquisition of data, where I am trying to sample the analog signal. (I realize, there is a system of trivial, but I'm hoping to build on it once I have run).

    The task of reading from the analog input works fine, as I tested it in several other cases. I have a problem writing to the analog output.

    For this task, I tried to follow the "Gen Cont Wfm Clck Int' VI to generate the wave form and start the task. I then try to write to the output of the analog timed loop. However, it does not seem to transmit a signal and doesn't give me any errors.

    I have attached the VI but also a screenshot.

    Please let me know if anyone has any ideas. I would really appreciate the help!

    Thank you

    Peter Borgstrom

    We will review your tasks one at a time.  First of all, the task of generation/Analog output Waveform.  Generate you a waveform (I'm unsure of your VI if it is a fixed waveform or not) and send it to a defined output function to produce a waveform continuously, using N-channel and samples of N (where you set not these previously).  You should not put this inside has timed loop, as the DAQ hardware has its own clock - if you simply put it in a while loop (with a stop to break out of the loop), the loop will call the function for the first points of N, wait until all N have been taken out, then call it again to another N points (up to what you press Stop).

    Now, suppose that you have the output connected to a load voltage (say a decent resistance).  You can wire the input terminals of your A/D converter through the same load and set up a similar analog input loop, running in parallel (i.e. in its own independent of the OD loop, while loop).  You pourriez start together (with, say, a merged error since the initialization code line loops HAVE and AO become lines of error in "loops of sampling" described above), but you might want to delay loop (a little) the AI so that the OD has a chance to set the voltage before the bed.

    I hope this helps.

    BS

Maybe you are looking for

  • Pull down notifications

    Updated to 1.2 on my ZTE open FFOS.I have a notification, but I can't shoot it down on the home screen as I did under FFOS 1.1.

  • How can I remove the updated in the toolbar in Firefox 20.0.1 search box?

    After you have started this morning Firefox version 20.0.1 is now updated on my Windows 7 desktop. The new "Search for update" box in the toolbar next to the tabs is a gene and redundant. How can I remove this field of research?

  • Accessories for Satellite P10

    HelloI'm looking for accessores for my P10. I guess that there is an external battery to 230V AC charger and a car adapter.Can someone tell me the name reference number? THX

  • HP laptop G72: ArcSoft Connect Daemon?

    Whenever I start my laptop, I get a pop up saying that arcsoft Connect Daemon stop working... I don't know what this program, what it does, or anything like that. Is this something that I can uninstall or disable? If so, I have tried locating the pro

  • BlackBerry smartphone security Wipe and Simm card

    If I do a wipe secturity, but do not check 'media card', it will always wipe the contacts in my simm card? Do I have to remove the simm first card and then perform the wipe (will I be able to do)? Thank you.