Array of Structs in cftree

Hi,
I am using an array of structs to populate the data in a cftree and cfloop query to fill the structs, this worked well initially, but as the data is increasing, it gets slower and slower, is there a solution for this ?
<cfcomponent name="treeComp">
<cffunction name=mytree>
<cfargument name="path" required="Yes">
<cfargument name="value" required="Yes">
     <cfset result = arrayNew(1)>
     <cfquery datasource="source" name="entries">
          SELECT value, name FROM data
     </cfquery>
     <cfloop query="entries">
               <cfset item=StructNew()>
               <cfset item.value=entries.value>
               <cfset item.display=entries.name>
               <cfset arrayappend(result,item)>
     </cfloop>
     <cfreturn result>
</cffunction>
</cfcomponent>
tree.cfm
<cfform>
<cftree name="tree" format="html">
     <cftreeitem bind="cfc:treeComp.mytree({cftreeItemPath},{cftreeItemValue})">
</cftree>
</cfform>

Hi Dan,
thank you for the suggestion, but in this case, I have the value and the display fields that need to be stored, if I just loop over a query, I do not get the desired results. can you point me to the example you have seen ?
Thanks

Similar Messages

  • Pro*C: Getting array of structs from a PL/SQL procedure

    I am trying to create a stored procedure that will take the results of a select query, put them into an array of structures and send the entire array of structs back to the calling function in the C program.
    I currently do a select into a cursor and return each row one at a time over the network.
    Any syntax suggestions would be of help.
    null

    I am trying to create a stored procedure that will take the results of a select query, put them into an array of structures and send the entire array of structs back to the calling function in the C program.
    I currently do a select into a cursor and return each row one at a time over the network.
    Any syntax suggestions would be of help.
    null

  • How do I pass an array of structs to a C function using the dll flexible prototype adapter?

    What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
    I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
    I can pass in a single struct of type TPS_Data and that works, but not an array.
    Here's the relevent code:
    typedef struct TPS_DATA
    char Report_Number[256];
    char System_Name[256];
    char Open_Date[256];
    char UUT_Part_Number[256];
    char UUT_Serial_Number[256];
    char UUT_Name[256];
    char Open_Employee_Name[256];
    char Open_Employee_Number[256];
    char Close_Employee_Name[256];
    char Close_Employee_Number[256];
    char Close_Date[256];
    } TPS_Data;
    typedef struct TPS_DATA_ARRAY
    TPS_Data DataRecord;
    } TPS_DataArray;
    long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);

    OK,
    I can pass the data to the DLL function, using the following types:
    typedef struct StringArrayType
    char string[10][256];
    } StringArray;
    typedef struct MultiStringArrayType
    StringArray Record[10];
    } MultiStringArray;
    void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
    return;
    void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
    return;
    But when the MultiStruct function Exits, TestStand reports an Error:
    -17501 "Unexpected Operating System Error" Source: 'TSAPI'
    There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
    ctions shown above.
    Any thoughts on how to get around this error would be greatly appreciated.
    Attachments:
    StructArrayPassing.seq ‏16 KB

  • Resizing an array of struct inside a DLL using the memory manager

    Hi all,
    I dug deep inside the boards, but wasn't able to find a solution for my problem.
    I'm building a dll, which does some imageprocessing and should return an array of structs to labview, with one struct for every element in the image.
    As I don't know the number of elements beforehand and the limit of the number is numbers of magnitude larger then the expected one, I don't want to allocate such a huge chunk of memory prior to the dll call in labview.
    In a former version I used a 2d array for the elements, where each row holds the values of every element. Here I used the NumericArrayResize-function, which worked quite well. But I have to add more sub-processes and using structs (or clusters in labview) appears to be more usefull and cleaner for me, in addition I had to cast some of the elements back and foreward a few times.
    So one element-struct should hold 2 singles and 1 uint32. My question is now, how can I resize this array of struct with memory manager functions as the NumericArrayResize-functions does not suit this purpose?
    (Accessing a given array of structs inside the DLL and after that reading the changed values in Labview is surprisingly easy )
    Thanks in advance
    Solved!
    Go to Solution.

    Well, I was able to solve it myself. I found this thread, where the first post of rolfk made me thinking. It appeared to me, that the numericarrayresize-function behaves very similar to the realloc-function of c. So I used the type unsigned int 8 (which is just one byte) and multiplied it by the number of bytes used by one struct, in my case 12 bytes (4+4+4) and then multiplied it by the number of structs (elements in the image) i have. Luckily it worked and the memory block was resized exactly as I wanted it to be. Important to note: do not forget to adjust the size element of the handle, otherwise Labview does not know about the changed size.

  • Simple c array in struct pointer question

    i have a two struct like so:
    typedef struct {
           uint8_t data[256];
    } foo1;
    typedef struct {
           uint32_t data_ptr;
    } foo2;
    foo1 * ctx;
    foo2    ply;
    if i want to get the pointer to the data array in ctx and assigned to data_ptr would i do it like so:
    ply.data_ptr = &(ctx->data);

    &(ctx->data) returns a pointer to an array of 256 integers. This type will look something like uint8_t (*data_ptr)[256]. Instead you should do what falconindy suggested above:
    ply.data_ptr = ctx->data
    To avoid gcc warnings (which you should always avoid), data_ptr needs to be declared the correct type of pointer. Since ctx->data by itself is nothing more than a pointer to an 8-bit wide integer you want (uint8_t *). ((void *) also works)

  • Call library function node with array of clusters using array data pointer

    Hello all.
    I am writing a LabVIEW wrapper for an existing DLL function.
    The function has, as one of its parameters, an array of structs.  The struct is very simple, containing two integers.  I am using the call library function node to access it.
    In Labview I created an array of clusters, where the cluster has two 32-bit integers as its members.  So far, so good.
    Now I have to pass this in to the Call Library Function Node.  Here I am running into trouble.
    I have used The topic in LAVA and The topic in the knowledge base as my primary sources of information, though I have read a bunch of forum topics on the subject too.
    I do understand that I could write a new function which takes as a parameter a struct with the size as the first member and an array as the second, and I might just do this and have it call the regular function, but I was hoping to do it more simply.
    According to the C file which LabVIEW generates for me from the CLFN when I choose "Adapt to Type" and "Array Data Pointer", the prototype it is expecting is:
    int32_t myFunc(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    And the prototype of the function in my DLL is
    int borland_dll myFunc(DWORD handle, usint channel,
    int FIFOnumber, struct mStruct *data, int numWords, int *actualLoaded, int *actualStartIndex);
    This looks like a match to me, but it doesn't work (I get garbage in data).  From the topic in LAVA referenced above, I understood that it would work.  It does not.
    If I cast data to the pointer-to-pointer I get when I generate c code by wiring my struct to a CIN and generating, then I seem to get what I expect. But this seems to work when I choose "pointers to handles" too, and I would expect array data pointer to give a different result.
    Is there any way to get this to work directly, or will I have to create a wrapper?  (I am currently using LabVIEW 2011, but we have customers using 2009 and 2012, if not other versions as well).
    Thank you.
    Batya
    Solved!
    Go to Solution.

    OK, here is more detailed information.
    I have attached the VI.
    This is the code from the  "C" file created by right-clicking the CLN and creating a "C" file. 
    When the parameter in the CLN is set to "array data pointer":
    /* Call Library source file */
    #include "extcode.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, void data[], int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
     When the parameter is "pointers to handles":
    /* Call Library source file */
    #include "extcode.h"
    /* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
    #include "lv_prolog.h"
    /* Typedefs */
    typedef struct {
    int32_t control;
    int32_t data;
    } TD2;
    typedef struct {
    int32_t dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    #include "lv_epilog.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
     When the parameter is set to "handles by value":
    /* Call Library source file */
    #include "extcode.h"
    /* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
    #include "lv_prolog.h"
    /* Typedefs */
    typedef struct {
    int32_t control;
    int32_t data;
    } TD2;
    typedef struct {
    int32_t dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    #include "lv_epilog.h"
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex);
    int32_t Load_Transmit_FIFO_RTx(uint32_t handle, uint16_t channel,
    int32_t FIFOnumber, TD1Hdl *data, int32_t numWords, int32_t *actualLoaded,
    int32_t *actualStartIndex)
    /* Insert code here */
    As to the DLL function, it is a bit more complicated than I explained above, in the current case.  My VI calls the function by this name in one DLL, and that DLL loads a DLL and calls a function (with the same name) in the second DLL, which does the work. (Thanks Rolfk, for helping me with that one some time back!)
    Here is the code in the first ("dispatcher") DLL:
    int borland_dll Load_Transmit_FIFO_RTx(DWORD handle, usint channel, int FIFOnumber, struct FIFO_DATA_CONTROL *data, int numWords, int *actualLoaded, int *actualStartIndex)
    t_DispatchTable *pDispatchTable = (t_DispatchTable *) handle;
    int retStat = 0;
    retStat = mCheckDispatchTable(pDispatchTable);
    if (retStat < 0)
    return retStat;
    if (pDispatchTable->pLoad_Transmit_FIFO_RTx == NULL)
    return edispatchercantfindfunction;
    return pDispatchTable->pLoad_Transmit_FIFO_RTx(pDispatchT​able->handlertx, channel, FIFOnumber, data, numWords, actualLoaded, actualStartIndex);
    borland_dll is just "__declspec(dllexport)"
    The current code in the DLL that does the work is:
    // TEMP
    typedef struct {
    int control;
    int data;
    } TD2;
    typedef struct {
    int dimSize;
    TD2 data[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    // END TEMP
    int borland_dll Load_Transmit_FIFO_RTx(int handlertx, usint channel, int FIFOnumber, struct FIFO_DATA_CONTROL *data, int numWords, int *actualLoaded, int *actualStartIndex){
    struct TRANSMIT_FIFO *ptxFIFO; //pointer to transmit FIFO structure
    usint *pFIFOlist; //pointer to array of FIFO pointers to FIFO structures
    int FIFOentry, numLoaded;
    usint *lclData;
    usint nextEntryToTransmit;
    // TEMP
    FILE *pFile;
    int i;
    TD1** ppTD = (TD1**) data;
    TD1 *pTD = *ppTD;
    pFile = fopen("LoadFIFOLog.txt", "w");
    fprintf(pFile, "Starting Load FIFO with %d data words, data pointer 0x%x, with the following data&colon; \n", numWords, data);
    for (i = 0; i < numWords; i++) {
    fprintf(pFile, "%d: control--0x%x, data--0x%x \n", i, data[i].control, data[i].data);
    fflush(pFile);
    fprintf(pFile, "OK, using CIN generated structures: dimSize %d, with the following data&colon; \n", pTD->dimSize);
    for (i = 0; i < numWords; i++) {
    fprintf(pFile, "%d: control--0x%x, data--0x%x \n", i, pTD->data[i].control, pTD->data[i].data);
    fflush(pFile);
    // END TEMP
    if ((handlertx) <0 || (handlertx >= NUMCARDS)) return ebadhandle;
    if (cardrtx[handlertx].allocated != 1) return ebadhandle;
    pFIFOlist = (usint *) (cardrtx[handlertx].segaddr + cardrtx[handlertx].glob->dpchn[channel].tr_stk_ptr​);
    pFIFOlist += FIFOnumber;
    ptxFIFO = (struct TRANSMIT_FIFO *)(cardrtx[handlertx].segaddr + *pFIFOlist);
    //use local copy of ptxFIFO->nextEntryToTransmit to simplify algorithm
    nextEntryToTransmit = ptxFIFO->nextEntryToTransmit;
    //on entering this routine nextEntryToLoad is set to the entry following the last entry loaded
    //this is what we need to load now unless it's at the end of the FIFO in which case we need to wrap around
    if ( ptxFIFO->nextEntryToLoad >= ptxFIFO->numEntries)
    *actualStartIndex = 0;
    else
    *actualStartIndex = ptxFIFO->nextEntryToLoad;
    //if nextEntryToLoad points to the last entry in the FIFO and nextEntryToTransmit points to the first, the FIFO is full
    //also if nextEntryToLoad == nextEntryToTransmit the FIFO is full and we exit without loading anything
    if (( (( ptxFIFO->nextEntryToLoad >= ptxFIFO->numEntries) && (nextEntryToTransmit == 0)) ||
    ( ptxFIFO->nextEntryToLoad == nextEntryToTransmit)) && (ptxFIFO->nextEntryToLoad != INITIAL_ENTRY)){
    *actualLoaded = 0; //FIFO is full already, we can't add anything
    return 0; //this is not a failure, we just have nothing to do, this is indicated in actualLoaded
    numLoaded = 0;
    lclData = (usint *)data; //must use 16 bit writes to the module
    //conditions are dealt with inside the for loop rather than in the for statement itself
    for (FIFOentry = *actualStartIndex; ; FIFOentry++) {
    //if we reached the end of the FIFO
    //if the module is about to transmit the first element of the FIFO, the FIFO is full and we're done
    //OR if the module is about to transmit the element we're about to fill in, we're done - the
    //exception is if this is the first element we're filling in which means the FIFO is empty
    if ((( FIFOentry >= ptxFIFO->numEntries) && (nextEntryToTransmit == 0)) ||
    ((FIFOentry == nextEntryToTransmit) && (FIFOentry != *actualStartIndex) )){
    *actualLoaded = numLoaded;
    //set nextEntryToLoad to the end of the FIFO, we'll set it to the beginning next time
    //this allows us to distinguish between full and empty: nextEntryToLoad == nextEntryToTransmit means empty
    ptxFIFO->nextEntryToLoad = FIFOentry;
    return 0;
    //we reached the end but can continue loading from the top of the FIFO
    if ( FIFOentry >= ptxFIFO->numEntries)
    FIFOentry = 0;
    //load the control word
    ptxFIFO->FifoData[FIFOentry * 3] = *lclData++;
    //skip the high of the control word, the module only has a 16 bit field for control
    lclData++;
    //now put in the data
    ptxFIFO->FifoData[(FIFOentry * 3) + 2] = *lclData++;
    ptxFIFO->FifoData[(FIFOentry * 3) + 1] = *lclData++;
    numLoaded++;
    //we're done because we loaded everything the user asked for
    if (numLoaded >= numWords) {
    *actualLoaded = numLoaded;
    ptxFIFO->nextEntryToLoad = FIFOentry+1;
    return 0;
    //if we reached here, we're done because the FIFO is full
    *actualLoaded = numLoaded;
    ptxFIFO->nextEntryToLoad = FIFOentry;
    fclose (pFile);
    return 0;
     As you can see, I added a temporary diagnostic with the structures that were created in the "Handles by value" case, and print out the data.  I see what is expected, whichever of the options I pick in the CLN!  
    I understood (from the information in the two links I mentioned in my original post, and from the name of the option itself) that "array data pointer" should pass the array of data itself, without the dimSize field.  But that does not seem to be what is happening.
    Batya
    Attachments:
    ExcM4k Load Transmit FIFO.vi ‏15 KB

  • Invoking stored procedure that returns array(oracle object type) as output

    Hi,
    We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
    JPA Class:
    import java.io.Serializable;
    import java.sql.Array;
    import java.util.List;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import org.eclipse.persistence.annotations.Direction;
    import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
    import org.eclipse.persistence.annotations.StoredProcedureParameter;
    * The persistent class for the MessagePublish database table.
    @Entity
    @NamedStoredProcedureQuery(name="GetTeamMembersDetails",
         procedureName="team_emp_maintenance_pkg.get_user_team_roles",
         resultClass=TeamMembersDetails.class,
         returnsResultSet=true,
         parameters={  
         @StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
         @StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
    public class TeamMembersDetails implements Serializable {
         private static final long serialVersionUID = 1L;
    @Id
         private long userId;
         private List<TeamMembersDetailsOT> teamMembersDetailsOT;
         public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
              this.teamMembersDetailsOT = teamMembersDetailsOT;
         public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
              return teamMembersDetailsOT;
    Procedure
    PROCEDURE get_user_team_roles (
    i_user_id IN ue_user.user_id%TYPE
    , o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
    , i_debugmode IN NUMBER :=0)
    AS
    OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
    TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.

    A few things.
    You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
    Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
    In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
    If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
    To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
    I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
    James : http://www.eclipselink.org

  • Pass an array of a user defined class to a stored procedure in java

    Hi All,
    I am trying to pass an array of a user defined class as an input parameter to a stored procedure. So far i have done the following:
    Step 1: created an object type.
    CREATE TYPE department_type AS OBJECT (
    DNO NUMBER (10),
    NAME VARCHAR2 (50),
    LOCATION VARCHAR2 (50)
    Step 2: created a varray of the above type.
    CREATE TYPE dept_array1 AS TABLE OF department_type;
    Step 3:Created a package to insert the records.
    CREATE OR REPLACE PACKAGE objecttype
    AS
    PROCEDURE insert_object (d dept_array);
    END objecttype;
    CREATE OR REPLACE PACKAGE BODY objecttype
    AS
    PROCEDURE insert_object (d dept_array)
    AS
    BEGIN
    FOR i IN d.FIRST .. d.LAST
    LOOP
    INSERT INTO department
    VALUES (d (i).dno,d (i).name,d (i).location);
    END LOOP;
    END insert_object;
    END objecttype;
    Step 4:Created a java class to map the columns of the object type.
    public class Department
    private double DNO;
    private String Name;
    private String Loation;
    public void setDNO(double DNO)
    this.DNO = DNO;
    public double getDNO()
    return DNO;
    public void setName(String Name)
    this.Name = Name;
    public String getName()
    return Name;
    public void setLoation(String Loation)
    this.Loation = Loation;
    public String getLoation()
    return Loation;
    Step 5: created a method to call the stored procedure.
    public static void main(String arg[]){
    try{
    Department d1 = new Department();
    d1.setDNO(1); d1.setName("Accounts"); d1.setLoation("LHR");
    Department d2 = new Department();
    d2.setDNO(2); d2.setName("HR"); d2.setLoation("ISB");
    Department[] deptArray = {d1,d2};
    OracleCallableStatement callStatement = null;
    DBConnection dbConnection= DBConnection.getInstance();
    Connection cn = dbConnection.getDBConnection(false); //using a framework to get connections
    ArrayDescriptor arrayDept = ArrayDescriptor.createDescriptor("DEPT_ARRAY", cn);
    ARRAY deptArrayObject = new ARRAY(arrayDept, cn, deptArray); //I get an SQLException here
    callStatement = (OracleCallableStatement)cn.prepareCall("{call objecttype.insert_object(?)}");
    ((OracleCallableStatement)callStatement).setArray(1, deptArrayObject);
    callStatement.executeUpdate();
    cn.commit();
    catch(Exception e){ 
    System.out.println(e.toString());
    I get the following exception:
    java.sql.SQLException: Fail to convert to internal representation
    My question is can I pass an array to a stored procedure like this and if so please help me reslove the exception.
    Thank you in advance.

    OK I am back again and seems like talking to myself. Anyways i had a talk with one of the java developers in my team and he said that making an array of structs is not much use to them as they already have a java bean/VO class defined and they want to send an array of its objects to the database not structs so I made the following changes to their java class. (Again hoping some one will find this useful).
    Setp1: I implemented the SQLData interface on the department VO class.
    import java.sql.SQLData;
    import java.sql.SQLOutput;
    import java.sql.SQLInput;
    import java.sql.SQLException;
    public class Department implements SQLData
    private double DNO;
    private String Name;
    private String Location;
    public void setDNO(double DNO)
    this.DNO = DNO;
    public double getDNO()
    return DNO;
    public void setName(String Name)
    this.Name = Name;
    public String getName()
    return Name;
    public void setLocation(String Location)
    this.Location = Location;
    public String getLoation()
    return Location;
    public void readSQL(SQLInput stream, String typeName)throws SQLException
    public void writeSQL(SQLOutput stream)throws SQLException
    stream.writeDouble(this.DNO);
    stream.writeString(this.Name);
    stream.writeString(this.Location);
    public String getSQLTypeName() throws SQLException
    return "DOCCOMPLY.DEPARTMENT_TYPE";
    Step 2: I made the following changes to the main method.
    public static void main(String arg[]){
    try{
    Department d1 = new Department();
    d1.setDNO(1);
    d1.setName("CPM");
    d1.setLocation("LHR");
    Department d2 = new Department();
    d2.setDNO(2);
    d2.setName("Admin");
    d2.setLocation("ISB");
    Department[] deptArray = {d1,d2};
    OracleCallableStatement callStatement = null;
    DBConnection dbConnection= DBConnection.getInstance();
    Connection cn = dbConnection.getDBConnection(false);
    ArrayDescriptor arrayDept = ArrayDescriptor.createDescriptor("DEPT_ARRAY", cn);
    ARRAY deptArrayObject = new ARRAY(arrayDept, cn, deptArray);
    callStatement = (OracleCallableStatement)cn.prepareCall("{call objecttype.insert_array_object(?)}");
    ((OracleCallableStatement)callStatement).setArray(1, deptArrayObject);
    callStatement.executeUpdate();
    cn.commit();
    catch(Exception e){
    System.out.println(e.toString());
    and it started working no more SQLException. (The changes to the department class were done manfully but they tell me JPublisher would have been better).
    Regards,
    Shiraz

  • Cycle through list and build compound array...

    I have a database that I'm pulling data from that is already existing. There is a designs table and a details table. The designs table stores the id's of the details items that are associated with the design. Since I'm using Flash remoting I would like to just get all the designs and their details back in one compound array instead of making a bunch of calls. I'm stuck on how to make the string "5,8,12,19" into an array, cycle through the array and then get the details info for each id. Then return the compound array when finished.
    I would prefer the array be like this:
    [design item 1 and it's data][details array of the design 1 items], [design item 2 and it's data][details array of the design 2 items]....
    Here is what I have so far
    <cffunction name="getDesignsByAct" access="remote" returntype="query" hint="gets activities by id">
    <cfargument name="send_id" type="numeric" required="yes" />
        <cfquery name="getDesignsByActQuery" datasource="#dsn#">
        SELECT design_id, design_items
        FROM designs_table
        WHERE design_activity = #send_id#
        </cfquery>
        <cfquery name="getDetailsQuery" datasource="#dsn#">
    SELECT
        FROM
         details_table
        WHERE <!-- cycle through the list of "design_items" in the above query -->
    </cfquery>
        <cfset this_return[1] = getDesignsByActQuery>
    <cfset this_return[2] = getDetailsQuery>
       <cfreturn this_return >
    </cffunction>
    Thanks in advance.

    Is your end goal to get a multi-dimensional array?  a query recordset object?  or an array of structs?  Based on your description, it looks like you want something like this:
    arrMultiDimArray = NewArray(2)
    arrMultiDimArray[1][1] = Query Data from Design Record 1
    ArrMultiDimArray[1][2] = Array of Detail records data structures (or query recordset object?) associated with design record 1
    If that is the case, then you should be able to put something together like this:
    1) Query your design & details data from the database as a joined recordset
    2) Initialize your multi dimensional array
    3) You can use the <cfoutput group=""> attribute to create an outer loop that only changes once for each new design ID
    4) Increment your first dimension array and add your design data to position one of your 2nd dimension
    5) Create a new array to store your Detail record items
    6) Use a nested <cfoutput> loop to loop over your detail item records and populate your new array
    7) Store your new array in position two of your 2nd dimension
    8) Return your 2D array to your flash remoting app

  • How can I set Array field which reside in a Structure field?

    I use Adobe java XMP toolkit.
    There are a few methods for setting structure and array items.
    setStructField() and appendArrayItem().
    However ducu stated that member of Structure may be array or structure, moreover array items also may be arrays or structures.
    So how can I set Array field in Structure or Structure field in Array???
    Thanks
    Andrey

    OK, it worked first time (without exception) as I tried to set value of EXISTING field.
    The trick is to add array or struct BEFORE setting their values.
    This short example shows how it works:
    XMPSchemaRegistry registry = XMPMetaFactory.getSchemaRegistry();
        registry.registerNamespace(extNS, "pdfaExtension");
        registry.registerNamespace(shemaNS, "pdfaSchema");
        registry.registerNamespace(propertyNS, "pdfaProperty");
        XMPMeta m = XMPMetaFactory.create();
        m.appendArrayItem(extNS, "pdfaExtension:schemas", new PropertyOptions().setArray(true), "", new PropertyOptions().setStruct(true));
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:prefix", "dc");
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:namespaceURI", "http://purl.org/dc/elements/1.1/");
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:schema", "Dublin Core Schema");
        m.appendArrayItem(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property", new PropertyOptions().setArrayOrdered(true), null, new PropertyOptions()
            .setStruct(true));
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[1]/pdfaProperty:name", "contributor", null);
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[1]/pdfaProperty:category", "external", null);
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[1]/pdfaProperty:description",
            "Contributors to the resource (other than the authors).", null);
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[1]/pdfaProperty:valueType", "bag ProperName", null);
        m.appendArrayItem(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property", new PropertyOptions().setArrayOrdered(true), null, new PropertyOptions()
            .setStruct(true));
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[2]/pdfaProperty:name", "coverage", null);
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[2]/pdfaProperty:category", "external", null);
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[2]/pdfaProperty:description", "The extent or scope of the resource.", null);
        m.setProperty(extNS, "pdfaExtension:schemas[1]/pdfaSchema:property[2]/pdfaProperty:valueType", "Text", null);
    Above code creates following XMP:
    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.1.1">
      <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
        <rdf:Description rdf:about=""
            xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"
            xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"
            xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#">
          <pdfaExtension:schemas>
            <rdf:Bag>
              <rdf:li rdf:parseType="Resource">
                <pdfaSchema:prefix>dc</pdfaSchema:prefix>
                <pdfaSchema:namespaceURI>http://purl.org/dc/elements/1.1/</pdfaSchema:namespaceURI>
                <pdfaSchema:schema>Dublin Core Schema</pdfaSchema:schema>
                <pdfaSchema:property>
                  <rdf:Seq>
                    <rdf:li rdf:parseType="Resource">
                      <pdfaProperty:name>contributor</pdfaProperty:name>
                      <pdfaProperty:category>external</pdfaProperty:category>
                      <pdfaProperty:description>Contributors to the resource (other than the authors).</pdfaProperty:description>
                      <pdfaProperty:valueType>bag ProperName</pdfaProperty:valueType>
                    </rdf:li>
                    <rdf:li rdf:parseType="Resource">
                      <pdfaProperty:name>coverage</pdfaProperty:name>
                      <pdfaProperty:category>external</pdfaProperty:category>
                      <pdfaProperty:description>The extent or scope of the resource.</pdfaProperty:description>
                      <pdfaProperty:valueType>Text</pdfaProperty:valueType>
                    </rdf:li>
                  </rdf:Seq>
                </pdfaSchema:property>
              </rdf:li>
            </rdf:Bag>
          </pdfaExtension:schemas>
        </rdf:Description>
      </rdf:RDF>
    </x:xmpmeta>

  • C: appending pointer to array of pointer

    Hello.
    I am trying to code a html parser in C but I ran into some troubles.
    Well... first the relevant code so that you know what I am talking about.
    I have this structure which will hold an html tag.
    struct tag {
    char *name;
    char *content;
    struct attribute *attributev;
    int attributec;
    struct tag *subtagv;
    int subtagc;
    struct tag *parent;
    Then I want to write a function which takes two tags as arguments and adds the second tag to the array of tags (subtagv) of the first tag.
    /* appends subtag in the tag's list of subtags. returns a pointer
    * to subtag (2nd argument) */
    struct tag *tag_append(struct tag *tag, struct tag *subtag) {
    /* allocate space for another tag */
    tag->subtagv = realloc(tag->subtagv, sizeof(struct tag) * (tag->subtagc + 1));
    /* set tag->subtagv[tag->subtagc]'s address to subtag ...
    * but I don't know how to handle this */
    /* FIRST TRY: I can access tag->subtagv[tag->subtagc] via
    * tag->subtagv+tag->subtagc as I can access *int[10] via
    * *int+10. But this gives a gcc error:
    * "invalid lvalue in assignment" */
    /*tag->subtagv+tag->subtagc = subtag;*/
    /* SECOND TRY: copy subtag's address into tag->subtagv +
    * tag->subtagc's address with memcpy. But this will through
    * various glibc errors */
    /* memcpy(&tag->subtagv+tag->subtagc, &subtag, sizeof(struct tag*)); */
    tag->subtagc++;
    return subtag;
    As a matter of completeness here the glibc runtime error:
    *** glibc detected *** ./main: corrupted double-linked list: 0x0000000000544060 ***
    ======= Backtrace: =========
    /lib/libc.so.6[0x2b710a876f3d]
    /lib/libc.so.6[0x2b710a876fea]
    /lib/libc.so.6[0x2b710a878d8f]
    /lib/libc.so.6(malloc+0x7d)[0x2b710a87a93d]
    ./main[0x40094a]
    ./main[0x40072d]
    ./main[0x400669]
    /lib/libc.so.6(__libc_start_main+0xf4)[0x2b710a82a2f4]
    ./main[0x4005b9]
    ======= Memory map: ========
    00400000-00401000 r-xp 00000000 fe:00 2011796 /home/harlekin/code/html/main
    00501000-00502000 rw-p 00001000 fe:00 2011796 /home/harlekin/code/html/main
    00502000-005a7000 rw-p 00502000 00:00 0 [heap]
    2b710a6f2000-2b710a70c000 r-xp 00000000 fe:00 3155971 /lib/ld-2.5.so
    2b710a70c000-2b710a70e000 rw-p 2b710a70c000 00:00 0
    2b710a80b000-2b710a80c000 r--p 00019000 fe:00 3155971 /lib/ld-2.5.so
    2b710a80c000-2b710a80d000 rw-p 0001a000 fe:00 3155971 /lib/ld-2.5.so
    2b710a80d000-2b710a93b000 r-xp 00000000 fe:00 3155977 /lib/libc-2.5.so
    2b710a93b000-2b710aa3b000 ---p 0012e000 fe:00 3155977 /lib/libc-2.5.so
    2b710aa3b000-2b710aa3e000 r--p 0012e000 fe:00 3155977 /lib/libc-2.5.so
    2b710aa3e000-2b710aa40000 rw-p 00131000 fe:00 3155977 /lib/libc-2.5.so
    2b710aa40000-2b710aa47000 rw-p 2b710aa40000 00:00 0
    2b710aa47000-2b710aa54000 r-xp 00000000 fe:00 216919 /usr/lib/libgcc_s.so.1
    2b710aa54000-2b710ab53000 ---p 0000d000 fe:00 216919 /usr/lib/libgcc_s.so.1
    2b710ab53000-2b710ab54000 rw-p 0000c000 fe:00 216919 /usr/lib/libgcc_s.so.1
    2b710c000000-2b710c021000 rw-p 2b710c000000 00:00 0
    2b710c021000-2b7110000000 ---p 2b710c021000 00:00 0
    7fffa03a2000-7fffa03b8000 rw-p 7fffa03a2000 00:00 0 [stack]
    ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vdso]
    Abgebrochen
    I think the first try would be the most elegant method but as I said I cannot realize it.
    With the second try I am not quite sure if my arguments I'm passing to memcpy are right. I always get confused with pointers to pointers as I am quite new to it.
    Thankful for any answer.
    harlekin
    Last edited by harlekin (2007-04-29 12:39:25)

    Your problem is that you've declared it as an array of structs, not as an array of pointers.  An array of pointers would be declared like this:
    struct tag **subtagv;
    If you want to continue using an array of structs, you'll need to use memcpy, like this:
    memcpy((tag->subtagv)+(tag->subtagc), subtag, sizeof(struct tag));
    If you want to use an array of pointers, then simple assignment (where you got the invalid lvalue before) will work, after changing your declaration of subtagv.
    Last edited by Cerebral (2007-04-29 13:18:55)

  • Passing an array of structures to an Oracle stored procedure (CFMX)

    I'm looking to write a Oracle stored procedure where I would pass in an array of structures and loop over each iteration to insert the bits and pieces within the structures to the DB.,
    I haven't written this type of procedure / package before.  I am planning to do an sp / package similar to what is sketched out in the second reply to this thread: http://forums.oracle.com/forums/thread.jspa?threadID=1078772
    Assuming I do, how can I call the procedure from ColdFusion (I'm using MX) and pass in my array?  As far as I can see, none of the CF_SQL_Types make sense.

    Let me know if you make any progress.  I'm fighting the same battle.  What I've done so far is to convert my array of struct into a delimited CLOB that looks like this:
    prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|
    Then I wrote a stored proc to suck it up using a pipelined function.  It's not to bad but parsing the CLOB on the ORACLE side is somewhat time consuming.
    I've also converted the array to XML and used dbms_xmlstore to convert but, on large arrays, it is very slow and the CLOB gets huge fast.
    I was hoping to use the cf_sql_refcursor but I can't figure out how.
    Warren

  • ORA-03115 on call Procedure with VARARRAY of STRUCT as IN and separate OUT

    Hello,
    I am using Oracle 11.2 and odbc6.jar of Manifest: 11.2.0.2.0 an getting the following exception
    java.sql.SQLException: ORA-03115:
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:204)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1007)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4714)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
    The Procedure is defined as following :
    CREATE OR REPLACE PROCEDURE TEST_ORACLE_PROCEDUR (
    I_CLOB IN CLOB,
    O_CLOB OUT CLOB,
    O_CURSOR1 OUT SYS_REFCURSOR,
    O_CURSOR2 OUT SYS_REFCURSOR,
    I_TESTPARAM IN NESTED_KEY_VAL_PAIR,
    O_TESTPARAM OUT NESTED_KEY_VAL_CLOB,
    I_BLOB IN BLOB ,
    O_BLOB OUT BLOB ,
    I_DATE IN DATE ,
    O_DATE OUT DATE ,
    I_ARRAY IN ARRAY_NESTED_KEY_VAL_PAIR,
    O_ARRAY OUT ARRAY_NESTED_KEY_VAL_PAIR
    Currently I am working for VarArray support in our enviroment. This error did not occour when removing the both Array parameters from SP.
    The type ARRAY_NESTED_KEY_VAL_PAIR is defined as follows:
    1.)
    ARRAY_NESTED_KEY_VAL_PAIR AS VARRAY(6) OF NESTED_KEY_VAL_PAIR;
    2.)
    NESTED_KEY_VAL_PAIR AS OBJECT
    MyStruct KEY_VAL_PAIR_REC,
    MyVarchar VARCHAR2(100)
    3.)
    KEY_VAL_PAIR_REC AS OBJECT (
    KEY VARCHAR2(400),
    VAL VARCHAR2(4000)
    I am passing an array of oracle.sql.STRUCT of type NESTED_KEY_VAL_PAIR as following:
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( typeName , connection );
    new oracle.sql.ARRAY(descriptor, connection, vector.toArray() );
    , where vector is the vector of STRUCT. The STRUCT Objects are created right as same as there are evaluated for I_TESTPARAM .
    -> So I think there must be some driver support issue of this ARRAY of STRUCT of STRUCT .. may at IN or OUT context..
    very Thanks for Help.
    rgs Andre, Berlin
    Edited by: user10426085 on 25.08.2011 03:36

    OK here the complete definition of the procedure :
    CREATE OR REPLACE PROCEDURE TEST_ORACLE_PROCEDUR (
            I_CLOB      IN      CLOB,    
            O_CLOB         OUT  CLOB,
            O_CURSOR1      OUT  SYS_REFCURSOR,
            O_CURSOR2      OUT  SYS_REFCURSOR,
            I_TESTPARAM IN      NESTED_KEY_VAL_PAIR,
            O_TESTPARAM    OUT  NESTED_KEY_VAL_CLOB,
            I_BLOB      IN      BLOB ,
            O_BLOB         OUT  BLOB ,
            I_DATE      IN      DATE ,
            O_DATE         OUT  DATE ,
            I_ARRAY     IN      ARRAY_NESTED_KEY_VAL_PAIR,
            O_ARRAY        OUT  ARRAY_NESTED_KEY_VAL_PAIR               
    ) IS
    BEGIN
       BEGIN
             /* Test IN CLOB, IN UserDefindedType , IN BLOB */
                  INSERT INTO TEST_ORACLE_PROCEDUR_TABLE (CLOBTEST,USERTYPETEST, BLOBTEST , DATETEST , ARRAYTEST ) VALUES( I_CLOB , I_TESTPARAM , I_BLOB , I_DATE , I_ARRAY );                                           
                  COMMIT;  
             /* Test OUT CLOB by IN CLOB-Value */
                  SELECT CLOBTEST     into O_CLOB       FROM  TEST_ORACLE_PROCEDUR_TABLE;      
             /* Test OUT BLOB by IN BLOB-Value */
                  SELECT BLOBTEST     into O_BLOB       FROM  TEST_ORACLE_PROCEDUR_TABLE;      
             /* Test OUT DATE by IN DATE-Value */
                  SELECT DATETEST     into O_DATE       FROM  TEST_ORACLE_PROCEDUR_TABLE;       
             /* Test OUT userdefined Type by self constructed object */
                  O_TESTPARAM := NESTED_KEY_VAL_CLOB( KEY_VAL_PAIR_REC( 'myKey_1' , 'myValue_1' ) , 'myVarcharValue' , O_CLOB );
             /* Test OUT ARRAY Type */
                  SELECT ARRAYTEST    into O_ARRAY      FROM  TEST_ORACLE_PROCEDUR_TABLE;       
             /* Test Out Cursor    */
                  OPEN O_CURSOR1 FOR  SELECT DUMMY FROM  DUAL;
                  OPEN O_CURSOR2 FOR  SELECT CLOBTEST,USERTYPETEST, BLOBTEST, DATETEST , ARRAYTEST  FROM  TEST_ORACLE_PROCEDUR_TABLE;                   
        /* return */                                                                                                                                        
             RETURN;
       EXCEPTION
         WHEN OTHERS THEN
             raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
       END;
    END;

  • Pro*C: host array insert using VARCHAR

    I followed the sample program sqlvcp.pc (explained in the ORACLE docu for Pro*C) to select severel rows from the database into an host array of varchar. This needs only one FETCH in program and works very well.
    I tried to use the same method to insert a host array of varchar into the database.
    BUT unfortunately only one row is inserted and then I get the error -01458.
    I checked data in my host array (allocated with malloc) using a debugger and I can't find an error.
    Is it possible to use this method to insert several rows out of a host array of varchar into the database using only one insert statement?
    If yes, for what do I have to take care of?
    Or do I have to use a loop with one insert for every row. This would be much slower!
    Thanks for Help.

    Hi prajithparan,
    Thanks for the response. I already looked at the link and a few other links in this forum that are related to array inserts/updates. However, I could not find answers to my specific questions. I am specifically concerned with the setup of parameters to the API calls (OCIBindByName and OCIBindArrayOfStruct) that fully reflects the two-dimensional nature of the array of structs that I am trying to insert.
    Moreover, I need to set the data type of the columns to be inserted as SQLT_STR. I think this data type requires the programmer to supply the length of the null terminated C strings as well. If we are inserting just one column, we can provide the length of each of the strings to be inserted into a VARCHAR2 column as part of a OCIBind call, for each of those columns.
    Since in an array insert, we are supplying multiple rows at the same time, how do we supply the lengths of strings to be inserted ? Should it be some form of two-dimensional array ?
    I could not get clear answers to these questions from either the Oracle documentation or the links on this forum. May be the answers are there and I am just missing them ?

  • Error unsupported memory access on variable 'Decoder.number_of_values' which is (or contain) an array with unknown size at compile time

    Dear All,
    I am a new user of Vivado HLS. I want to pass an array of struct to a function and use elements of struct multiple times in a function (read and write). I find this error "error unsupported memory access on variable 'Decoder.number_of_values' which is (or contain) an array with unknown size at compile time " . Kindly can anyone tell that is it an issue of directive? if yes then which directive to use for struct and its element. Struct and function are as follows.
    typedef struct {
    uint32_t number_of_values ;
    uint32_t  address[16];
    uint8_t Processed_bit :1 ;
    uint32_t links[6];
    } Decoder_Fields;
    void Raptor_LT_decode(int To_Send,Decoder_Fields *Decoder){
        int counter=0;
        int i=0,j=0,k=0,x,aaa;
        Raptor_LT_decode_label0:while(counter<To_Send){
            if((Decoder[counter].number_of_values ==1) &&(Decoder[counter].Processed_bit==0) ){
                Decoder[counter].Processed_bit=1;
                Raptor_LT_decode_label1:for (i=0; i<To_Send;i++){
                   Raptor_LT_decode_label2:for (k=0;k<Decoder[i].number_of_values;k++){
                         if (( Decoder[counter].links[0]==Decoder[i].links[k]) && (counter != i)&&       (Decoder[i].number_of_values!= 1)) {
                            Raptor_LT_decode_label3:for (j=0;j<BLOCK_SIZE_BYTES/4;j++){
                                     Decoder[i].address[i]= Decoder[i].address[j] ^ Decoder[counter].address[j];
                            for (x=k;x<Decoder[i].number_of_values-1;x++) Decoder[i].links[x]=Decoder[i].links[x+1];
                                      Decoder[i].number_of_values--;
                counter=0;
            else
                counter++;
     

    Hi ,
    This question is asked on the forum from time to time and should be described in the UG902
    In your top level, Decoder is a pointer; this is not supported as-is as you need to know its size when you do something like Decoder[i].XXXX : the tool need to know how many bits to size the addess bus.
    you need to change Decoder_Fields *Decoder to Decoder_Fields Decoder[YOURSIZE]
    with YOURSIZE that makes sense; in this case the tool will know that it need N=log2(YOURSIZE) to fully address the Decoder array variable.
    next when you solve that and that all is good... the question that you will need to transfer the data of the structs from host memory to your VHLS IP; you need to think about this.
    I hope this helps.

Maybe you are looking for