Procedure with input output and num_array sys_refcursor

Hello

I have to write a procedure with input of type of parameter num_array which will forward a list of IDs to the procedure and the output is sys_refcursor that will pass the id with the other columns in the table to the list of identifiers.

operating system is the table with the id, os_name column with more than a few columns.

create table os

(identification number,

OS_name varchar2 (30),

.. .few more columns);

I spend the os_name with id through the sys_refcursor.

So I created the following procedure.

num_array is a type of data defined by the user that is created as follows:

create or replace type num_array in the table to the number;

/

create or replace procedure get_os_lang_dtls (num_array, id_os sys_refcursor id_num)

is

Start

/ * oses is the main table with id, os_name with other columns

/ * oses_gtt is the temporary table with id number data type varchar2 os_name * /.

for indx in 1.id_num.count

loop

insert into os_gtt

SELECT id, os_name

of the operating system

where id = id_num (indx);

end loop;

commit;

Open the id_os for

Select * from os_gtt;

end;

/


I created a global temporary table with the column id and os_name.

Insert in this table by using the id of i / p and setting os_name recovery operating system for this id in the loop.


Then I open the exit sys_refcursor.


Could someone please suggest me a better way to write the same logic?


Thanks in advance

No need of the TWG or anything too flashy here.

Since you have a SQL type, you should be able to get away with...

open out_ref_cursor for
select 
from os, table(cast(id_num as num_array)) nu
where os.id = nu.column_value;

A couple of notes apart from that. ID is not a great name for a column, why not OS_ID to be online with your OS_NAME? Second, always try to avoid use of the TWG, they are handy once in awhile, but not required nearly as often as find you them.

A "rebate" in the casting of tables like that and their use in SQL is the cost based optimizer usually (depending on version) has no idea of how to do to optimize the query (it has no statistics on the table as it does on a table). In General, if you know that you have X items in this table, it is better to say Oracle. You can use the CARDINALITY indicator to tell Oracle about the number of lines, you expect your table to have on average. The default proposal is going to be your block size, so assuming that 8 k (standard) the estimate is going to be like 8000 items... probably not close to reality.

See you soon,.

Tags: Database

Similar Questions

  • A stored procedure with input & output parameter as XML

    Hello

    I have a requirement in which I need to have a stored procedure accepts with huge XML from Java and MS a process all the records in the XML file and return the output with a few messages inside XML.

    CurrentY, I have a stored procedure to process the xml code stored in the Oracle database.

    I am using the following SQL statement to read data from the XML column.
    select xmltest1.id,xmltest1.name 
      from xmltest,
           XMLTABLE(
              XMLNamespaces(default 'syncpsna/schemas'),
              '/XMLTestRequest/insert/row'
                    PASSING xmltest.data_xml
                    COLUMNS
                    "ID" number(10) PATH 'id',
                    "NAME" varchar2(50) PATH 'name') xmltest1
    where xmltest.id = 2;
    I want to run similar queries to retrieve data from the XML passed as parameter of entry of JAVA.

    If I could get some examples to read the XML and return the xml to the calling program.

    Concerning

    I can run the query to extract the different sections in the xml file when the XML is stored in a table column. How can do the same thing on XML passed as an input parameter.

    Pretty much the same path, using the clause of PASSAGE.
    Assuming that the input XML is passed as parameter 'p_inputXML', you can do:

    SELECT x.id
         , x.name
    FROM XMLTable(
           XMLNamespaces(default 'syncpsna/schemas'),
           '/XMLTestRequest/insert/row'
           PASSING p_inputXML
           COLUMNS
             "ID"   number(10)   PATH 'id',
             "NAME" varchar2(50) PATH 'name'
         ) x
    ;
    
  • Mathematical functions with input/output error

    Please refer to the attached picture. Where do you find these mathematical functions with input/output error? I saw these in response to a message.

    I think they appear when you connect a waveform or dynamic data type.  Since I rarely use these data types (just give the table!), I'm not positive.

    Lynn

  • Run the statement in a stored procedure with Out parameters and

    Hi all

    I have a stored procedure that calls a select statement. Here it is...

    CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE

    * (BLABLA_KEY IN NUMBER, *)
    XML_OUTPUT ON VARCHAR)
    AS
    BEGIN
    SELECT SYS. XMLTYPE.getStringVal (OBJECT_VALUE) in XML_OUTPUT FROM BLABLA_VIEW WHERE extractValue (OBJECT_VALUE, ' / BLABLA_TYPE/BLABLA_KEY ') = 2876;
    END;

    Is to have both IN and OUT parameters as described above. I am able to compile and run the procedure.

    The problem I want to share with everyone is...
    I want to run the stored procedure together with a single EXEC command.

    I tried different ways using the EXEC command but of no use.

    Could someone help me?
    Thanks in advance.

    Published by: user10763276 on June 3, 2010 15:47

    Please visit the following...

    sudhakar@ORCL>CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE
      2  (BLABLA_KEY IN NUMBER,
      3  XML_OUTPUT OUT VARCHAR)
      4  AS
      5  BEGIN
      6  XML_OUTPUT := BLABLA_KEY || ' and whatever else...';
      7  END;
      8  /
    
    Procedure created.
    
    sudhakar@ORCL>
    sudhakar@ORCL>var XML_OUTPPUT varchar2(100);
    sudhakar@ORCL>exec BLABLA_VIEW_PROCEDURE (9151, :XML_OUTPPUT);
    
    PL/SQL procedure successfully completed.
    
    sudhakar@ORCL>print XML_OUTPPUT;
    
    XML_OUTPPUT
    --------------------------------------------------------------------------------
    9151 and whatever else...
    
    sudhakar@ORCL>
    

    Post tells you...

    var OUTPUT VARCHAR
    exec BLABLA_VIEW_PROCEDURE (9151, :OUTPUT);
    print OUTPUT
    

    VARCHAR is not a valid TYPe to declare. Use VARCHAR2 (nnn) where nnn is a number.
    VR,
    Sudhakar B.

  • Connection of sensors with different output and floating grounds varies to NI 9205

    I need to connect three sensors for the same NOR 9205 tends in NOR cDAQ 9172. The first is a Lucas Schaevitz Inc. LVDT + -15 VDC excitation and the output signal of 0 to +-10VD. C the municipality of excitement and the common of the signal must be connected. The second is the Ellison int sensor pressure transducer. GS 4002 with 13-30 VDC excitation and 0 to 10 VDC output signal. The third is the excitement of VDC data Instruments Inc. model AB pressure sensor 5 and 0-100 mVDC signal output.

    All the resonances tensions share common ground that I've connected all the reasons for excitement. But apart from the common LVDT signal is the same as the current excitation, the other two have floating grounds.

    I have two questions. Can I have a few channels in CSR mode and some in differential mode in the same module OR 9205? Personally, I think that it might not work but I put the question just to be safe, and that leads to my second question.

    If I want to connect three sensors above in differential mode how I would do it?


  • The procedure with parameter output from test object type

    I have the sub object created with spec and body type.

    I need to test the procedure seen ino parameter object type.

    could you please help me test the procedure!

    create or replace type typ_obj_test as object
    (
       a_date   date,
       a_type   varchar2(10),
       a_status varchar2(2),
       descr    varchar2(10),
       a_id     number(10),
       constructor function typ_obj_test(a_date   date
                                        ,a_type   varchar2 default null
                                        ,a_status varchar2 default null
                                        ,descr    varchar2 default null
                                        ,a_id     number default null) return self as result
    );
    /
    create or replace type body typ_obj_test is
       constructor function typ_obj_test(a_date   date
                                        ,a_type   varchar2 default null
                                        ,a_status varchar2 default null
                                        ,descr    varchar2 default null
                                        ,a_id     number default null) return self as result is
          v_test varchar2(1);
          v_id   number(10);
       begin
          self.a_date   := a_date;
          self.a_type   := a_type;
          self.a_status := a_status;
          self.descr    := descr;
          self.a_id     := a_id;
          return;
       end;
    end;
    /
    create or replace procedure p_obj_test(p_obj_param in out typ_obj_test) is
    begin
       dbms_output.put_line('Checking the object type' || p_obj_param.a_date || '@' || p_obj_param.a_type || '@' || p_obj_param.a_status || '@' ||
                            p_obj_param.descr || '@' || p_obj_param.a_id);
    end;
    /
    

    You seem to be missing a table that could hold the object. See the next topic, especially the line # 43:

    Connected to:
    Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
    
    SQL> create or replace type typ_obj_test as object
      2  (
      3    a_date  date,
      4    a_type  varchar2(10),
      5    a_status varchar2(2),
      6    descr    varchar2(10),
      7    a_id    number(10),
      8    constructor function typ_obj_test(a_date  date
      9                                      ,a_type  varchar2 default null
    10                                      ,a_status varchar2 default null
    11                                      ,descr    varchar2 default null
    12                                      ,a_id    number default null) return self as result
    13  );
    14  /
    
    Type created.
    
    SQL> create or replace type body typ_obj_test is
      2    constructor function typ_obj_test(a_date  date
      3                                      ,a_type  varchar2 default null
      4                                      ,a_status varchar2 default null
      5                                      ,descr    varchar2 default null
      6                                      ,a_id    number default null) return self as result is
      7        v_test varchar2(1);
      8        v_id  number(10);
      9    begin
    10        self.a_date  := a_date;
    11        self.a_type  := a_type;
    12        self.a_status := a_status;
    13        self.descr    := descr;
    14        self.a_id    := a_id;
    15        return;
    16    end;
    17  end;
    18  /
    
    Type body created.
    
    -- Create a Nested table type array of above object type
    SQL> create or replace type nt_typ_obj_test as table of typ_obj_test;
      2  /
    
    Type created.
    
    -- Keep in out parameter's type as the nested table type
    -- modified the proc to do loop so that multiple records can be passed via object type
    SQL> create or replace procedure p_obj_test(p_obj_param in out nt_typ_obj_test) is
      2  begin
      3  for i in p_obj_param.first..p_obj_param.last
      4  loop
      5    dbms_output.put_line('Checking the object type' || p_obj_param(i).a_date || '@' || p_obj_param(i).a_type || '@' || p_obj_param(i).a_status || '@' ||
      6                          p_obj_param(i).descr || '@' || p_obj_param(i).a_id);
      7  end loop;
      8  end;
      9  /
    
    Procedure created.
    
    --Call the procedure
    SQL> set serveroutput on
    SQL> declare
      2  i_nt_typ nt_typ_obj_test ;
      3  begin
      4  i_nt_typ:=nt_typ_obj_test(typ_obj_test(sysdate,'A','Y','Descr',23),typ_obj_test(sysdate,'X','Z','ewe',55));
      5  p_obj_test(i_nt_typ);
      6  end;
      7  /
    Checking the object type26-MAR-15@A@Y@Descr@23
    Checking the object type26-MAR-15@X@Z@ewe@55
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
  • Using the procedure with multiple output variables in a query

    Hello

    We have a process that takes time, which returns 4 variables as out parameters:
    procedure calc_values(id in number, val1 out number, val2 out number, val3 out number, val4 out number) is
    The id uniquely identifies a product in our database.

    I would use it in a query (or view), in the form
    select s.id, val1, val2, val3, val4 from something s, product_table p
    where s.id = p.id
    I tried the following approach, but I'm kinda stuck

    define the type
    define an array of this type
    write a wrapper function that calls this procedure and returns the results as a table
    * the PivotTable in columns
    * join this with the product table

    It's like I'm on the wrong track, I'm struggling to retrieve the id of the product table in the wrapper function.

    Is there a better approach for this? I'm on oracle 10g

    Thank you!

    Rob

    Below is my interpretation of what you were asked to do. I don't really know what you want to do or what you need to do.

    CREATE TYPE prod_vals_def
    AS OBJECT
     (VAL1      NUMBER,
      VAL2      NUMBER,
      VAL3      NUMBER,
      VAL4      NUMBER
    );
    
    create or replace
    TYPE   prod_vals_tab
    AS TABLE OF prod_vals_def;
    
    CREATE FUNCTION pvals (p_prod_id  NUMBER)
    RETURN prod_vals_tab PIPELINED
    AS
    
      TYPE         ref0 IS REF CURSOR;
      cur0         ref0;
      out_rec      prod_vals_def
                := prod_vals_def(NULL,NULL,NULL,NULL);
    
    BEGIN
      -- CASE replacing SELECT against table I'm not going to create
      CASE p_prod_id
        WHEN 1 THEN
          out_rec.val1 := 1;
          out_rec.val2 := 2;
          out_rec.val3 := 3;
          out_rec.val4 := 4;
        WHEN 2 THEN
          out_rec.val1 := 2;
          out_rec.val2 := 3;
          out_rec.val3 := 4;
          out_rec.val4 := 5;
        WHEN 3 THEN
          out_rec.val1 := 3;
          out_rec.val2 := 4;
          out_rec.val3 := 5;
          out_rec.val4 := 6;
        WHEN 4 THEN
          out_rec.val1 := 4;
          out_rec.val2 := 5;
          out_rec.val3 := 6;
          out_rec.val4 := 7;
        ELSE
          out_rec.val1 := 0;
          out_rec.val2 := 0;
          out_rec.val3 := 0;
          out_rec.val4 := 0;
      END CASE;
      PIPE ROW(out_rec);
    END pvals;
    
    WITH s_tab AS
      (SELECT 1 AS prod_id FROM dual
       UNION ALL
       SELECT 2 AS prod_id FROM dual
       UNION ALL
       SELECT 3 AS prod_id FROM dual
       UNION ALL
       SELECT 4 AS prod_id FROM dual
      )
    SELECT s.prod_id, p.val1, p.val2, p.val3, p.val4
    FROM   s_tab s,
           TABLE(pvals(s.prod_id)) p
    
    PROD_ID  VAL1     VAL2     VAL3     VAL4
    -------- -------- -------- -------- --------
    1        1        2        3        4
    2        2        3        4        5
    3        3        4        5        6
    4        4        5        6        7     
    
  • LabView PID control with PWM output and ramp / soak.



  • Calling stored procedures with parameters with the database connectivity Toolkit

    Hi all

    I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work.  I have a database in which I tables and stored procedures with parameters.  Some of these stored procedures have input, output and return parameters.

    I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument

    Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table).  In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).)  I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful.  I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step.  I then try to use the VI of parameter query create to call the stored procedure and set the parameters.  I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI?  I am also having some confusion during and after these steps as well.  I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert.  Also, I would be happy to provide more information that might be useful.

    Kind regards

    Jon

    Here's what I use to do this.  I think I had to change him create parameterized query VI for him to work.  There is a post on the forum about this somewhere.

  • How to perform procedures with REF CURSOR & PLSQL settings table in SQL Dev?

    I have 3 SQL Developer. I create a procedure with a set of tables/PL/SQL as an input parameter and a SYS_REFCURSOR as output parameter.

    When I press the green arrow (Run button) block the dialog box run PL/SQL PL/SQL has no place at the PL/SQL table with records of entry and also to see the output of the SYS_REFCURSOR.

    I get the error ORA-06550 and many other errors when I run the present.

    How to do this please?

    In the debug code, lose the ABS. Prefix the SYS_REFCURSOR QC_SQL_DEVELOPER_TEST.
    Also, do not use same name of your settings on your bind variable (so e.g.: OUT_REF_CURSOR).
    REF CURSOR is supported output types, so you will get the output of their share in the output tab.
    However the output system does not recognize your own types as your PL/SQL table. You need to write an exit procedure yourself, indexing correctly, using the DBMS_OUTPUT.

    Have fun
    K.

  • Java - a stored procedure with call by result

    Hi the Oracle community,

    I'm looking for some example Code how to use a Java-Stored procedure with output parameters. Don't get me wrong. I don't want to call a procedure with the parameters Out of Java (there are many examples in this respect over there). I want to just implement the appeal of the concept of results in a Java-Stored procedure. A customer calls this procedure with certain parameters and the Java procedure will fill the. So my first question: is it possible? And my second Question: how to implement it?

    Greetings.

    I found a solution. It's very simple.

    Just setting the parameters as java array (e.g., String() P1). The first value (P1 [0]) is the returned value.

    Finally just contained JDeveloper in dialog box "Edit method Signature" the parametermode OUT.

    The dialog box are entitled on the stored procedure in the dbexport file. You can read this

    in Section 6, publishing Java Classes with call specifications-> defining the Modes parameter in

    The Oracle database Java Developer's Guide.

  • PXI-6133 Pulse frequency output and input with DAQmx

    I am trying to set a pulse meter output frequency task and read this signal with a frequency counter input task input pulses.  I use a 2 PXI-6133, each connected to a BNC-2090 case has.  I want to output a square of a certain frequency with the task frequency meter pulse output and then read the frequency of this signal using a task of cost input frequency.  I don't know how to property set up these tasks, or how to define which device to use for each heap.  I don't know what terminals on the BNC-2090 is the counter of entry/sortient channels correspond to them because that is not displayed in the documentation of the PXI-6133 or documentation of BNC-2090.

    Please see the attached VI for my attempt to put this in place.  Currently, I get two errors:

    (1) error-200452 took place at the property Node DAQmx channel meter Test - referred to as property is not supported by the device or is not applicable to the task.

    2. the error-89136 at DAQmx Start Task - specified route cannot be met because the hardware does not support.

    If I remove two channels of property DAQmx where I try to put the terminals for the counters, while the program is running, but then I know not what terminals on the BNC-2090 meters are connected to!  This causes the DAQmx read for the cost in the tasks of frequency to timeout because it does not detect a signal.

    I would really appreciate the help to properly configure these tasks and determine what terminals on the BNC-2090 case has the task of counter will work on.

    I see a few problems in the code originally:

    1. For your CI task, you type is defined as a counter entry > frequency.  But on the node property of DAQmx channel for this task, you modify the CI. Property of PulseWidth.Term.  It should be CI. Freq.Term. set the entry regardless of the PFI line you do not want the input signal on.  Tip: you don't have to type the name of the device in at all.  Enter "PFI0", it's the same as "DevN/PFI0" since the unit has already been specified in the DAQmx Virtual Channel Create function.  The name of the device, leaving aside will make your code more flexible where you decide later to change the name of the device.

    2. Maps of the S series, such as the 6133, do not have the same flexibility to change the output terminals of tasks of meter you might find with M or X series device.  Page 83 of the S series manual watch what signals can be extracted to PFI lines - Ctr0Out is not one of these.  Instead, Ctr0 out is, by default, pin 2.  Cabling to a BNC-2090 6133 is certainly difficult to understand out (probably because the 2090 was designed to work with the materials of the E and M series), but if you compare the pinout of a PXI-6255 0 with the 6133 pinout connector, you will notice that they are essentially a match 1-1.  Pin 2 is PFI12 on the 6255, so I assume the same for the 6133.  All this to say, Ctr0Out always appears on the pin 2/PFI12 for the 6133 and you therefore cannot change the output terminal that your code is trying to do, having for result error-89136.  Remove this node from the property altogether and the error should disappear.

  • Producer consumer with inputs and outputs analog and digital

    Hello world

    I'm working on a program of control system for some practical test work. Currently, I am working on the data acquisition of the Labview program component. My architecture is consumer-product loops with a what. My system will have analog inputs, outputs, analog inputs and digital outputs. It is not a criticism of time sytem, but I wish that all the acquisition of data to synchronize. I enclose my program because it is at the moment. I have difficulties to get all the data in the since that I have two types of data. In addition, I don't know if I have synced the four sequences of read/write correctly. I would be very happy if someone could take a look at my program and give me some advice. Thanks in advance.


  • stored procedure with cursor as param output

    This is the first time for me to test a stored procedure with a cursor as an out parameter. I performed the following:

    SQL > user_cur VARIABLE REFCURSOR; VARIABLE ret_code VARCHAR2; exec TEST_API. SEARCH_USER (: ret_code, ",", "John", ",: user_cur); print ret_code; print user_cur;

    I got the following error:

    Use: VAR [IABLE] [< variable > [NUMBER |]] TANK | CHAR (n [CHAR |]) BYTE]) |
    VARCHAR2 (n TANK). NCHAR. NCHAR (n) |
    NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR]]

    Can I know what is the problem?

    The purpose of the stored procedure is looking for user with the name 'john '.

    The declaration of input/output params to stored procedure is as follows:

    PROCEDURE SEARCH_USER
    (
    RETURN_CODE OUT VARCHAR2,
    USER_ID_IN IN VARCHAR2,
    POSITION_IN IN VARCHAR2,
    USERNAME_IN IN VARCHAR2,
    STATUS_IN IN VARCHAR2,
    USER_CUR_OUT ON REFCURSOR
    )

    Published by: user7383310 on October 19, 2008 21:05

    Published by: user7383310 on October 19, 2008 21:05

    refer here for the use of refcursors in pl/sql...
    http://download.Oracle.com/docs/CD/B14117_01/AppDev.101/B10807/06_ora.htm#sthref808

    You can code as...

    SQL> create or replace procedure p1(id number,csr out sys_refcursor) is  2  begin  3   open csr for select ename from emp where deptno = id;  4  end;  5  /
    
    Procedure created.SQL> var csr1 refcursorSQL> var n numberSQL> exec :n := 30;
    
    PL/SQL procedure successfully completed.
    
    SQL> exec p1(:n,:csr1);
    
    PL/SQL procedure successfully completed.
    
    SQL> print csr1
    
    ENAME----------ALLENWARDMARTINBLAKETURNERJAMES
    
    6 rows selected.
    
  • How do I get the analog input signal and send it to output analog (real time)

    Hello world

    I do a simple task in Visual C++ and I use PCI-6221(37 pin).

    Basically, I want to send the same signal of "analog input" to the "analog output".

    at the same time (or almost), to make real-time application.

    Can someone provide me with sample program please.

    I would be grateful if you could provide me with the great tutorial that explains

    step by step everything about NOR-DAQmx for C/C++ programming.

    Best regards

    Khassan

    This is my code in C++, you can optimize it if that seems too messy. This code reads the analog input signals and exports it through the analog outputs.

    To make this code additional work of the directories include and library directories must be added to OR.

    I hope it helps someone.

    #include
    #include
    #include "NIDAQmx.h".
    #include

    #define DAQmxErrChk (functionCall) {if (DAQmxFailed (error = (functionCall))) {goto error ;}}

    int main (int argc, char * argv [])
    {
    Int32 error = 0;
    TaskHandle taskHandleRead = 0, taskHandleWrite = 0;
    Read Int32 = 0;
    float64 context [1000];
    char errBuffRead [2048] = {'\0'};
    char errBuffWrite [2048] = {'\0'};
    bool32 done = 0;
    Int32 wrote;

    DAQmxErrChk (DAQmxCreateTask("",&taskHandleRead));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleRead,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleRead,"",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,0));
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleWrite));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleWrite,"Dev1/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleWrite,"ai/SampleClock",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));

    DAQmxErrChk (DAQmxStartTask (taskHandleRead));
    DAQmxErrChk (DAQmxStartTask (taskHandleWrite));

    While (! fact &! _kbhit())

    {

    DAQmxErrChk (DAQmxReadAnalogF64(taskHandleRead,1,10,DAQmx_Val_GroupByScanNumber,dataRead,1000,&read,));

    DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleWrite,read,0,10.0,DAQmx_Val_GroupByChannel,dataRead,&written,));

    }
    _getch();

    Error:
    If (DAQmxFailed (error))

    {
    DAQmxGetExtendedErrorInfo (errBuffRead, 2048);
    DAQmxGetExtendedErrorInfo (errBuffWrite, 2048);
    }
    If (taskHandleRead! = 0)

    {

    DAQmxStopTask (taskHandleRead);
    DAQmxClearTask (taskHandleRead);
    }
    If (taskHandleWrite! = 0)

    {

    DAQmxStopTask (taskHandleWrite);
    DAQmxClearTask (taskHandleWrite);
    }
    If {(DAQmxFailed (error))
    printf ("error DAQmx: %s\n",errBuffRead); ")
    printf ("error DAQmx: %s\n",errBuffWrite); ")
    }
    printf ("end of the program, press the Enter key to quit\n");
    GetChar ();
    return 0;
    }

Maybe you are looking for

  • Error Windows 8 not installed - upgraded Satellite C855 PSKCCE question

    Hello, I tried to update from Windows 7 to Windows 8. I followed all the instructions to remove all applications were asked, but, unfortunately, I received an error message from Windows 8 (Windows 8 not installed). My computer is a C855 (PSKCCE) I sa

  • How to replace battery Satellite Pro 4310

    Hi all I would like to know how to replace the battery on my old of Satellite Pro 4310, I read it in my paper user. We're supposed to a locking system, but I have not found anything close to the battery... only a drawing with two positions lock and u

  • Alongside the series to convert

    Sir good day I just want to ask how convert data parallel serial... of the vi I did, the input image is converted to a table and then converted into table 1 d of boolean... my teacher give me a task on how to convert serial... Thank you

  • AMD radeon hd 8600 m missing series

    Hello. pls hlp me out... my laptop is hp pavilion e014tx 15. WHN I 1st the used it I vedio adapter shows that use amd radeon hd series 8600. BT after awhile sound using the intel hd 400... I have upgrated amd driver many times bt whenever it updates

  • It is important to activate windows firewall

    It is important to enable the windows firewall in my personal office. I am also connected to the internet. What happens if the firewall is not enabled?