PL/SQL assign an array

All i have the following code which basically i want to take a report like
EXCHANGE | TIMETRIP
J 1.44
KJ 6.77
TAG 9.99
And auto send it via email, i am using the HTMLDB_MAIL function, but the problem i have is that the loop will fill out the exch and secs value for each pass. What i need is to be able to send the email report like the above
declare
totallines number;
ret number;
exch varchar(90);
secs varchar(50);
begin
for c1 in (select distinct exchange from fastfix_customer_perf where clientname = 'CLIENT' and archive = '0') loop
select count(*) into totallines from fastfix_customer_perf where clientname = 'CLIENT' and archive = '0'
and exchange = c1.exchange; --count(*) pro value
ret := ceil(totallines * 0.25);
     select exchange, totalroundtripsecs into exch, secs
from
(select exchange,totalroundtripsecs, row_number() over (partition by exchange
order by totalroundtripsecs) rn from fastfix_customer_perf where exchange = c1.exchange)
where rn = ret;
HTMLDB_MAIL.SEND(
P_TO => '[email protected]',
P_CC => '[email protected]',
P_FROM => '[email protected]',
P_BODY => ' ',
P_SUBJ => '### ! DESHAW REPORT ! ###',
P_BODY_HTML => '<tr><td><table cellpadding="0" border="0" cellspacing="0" summary="" class="t12standardalternatingrowcolors"><tr><th class="t12header" id="EXCHANGE">EXCHANGE</th><th class="t12header" id="TOTALROUNDTRIPSECS">Totalroundtripsecs (25th) percentiles</th></tr><tr><td class="t12data">'||exch||'</td><td class="t12data">'||secs||'</td></tr></table></td></tr><br>');
end loop;
HTMLDB_MAIL.PUSH_QUEUE( 'mailhost', '25');
end;
With the code above i get an email for every exch and secs that comes out.

declare <br>
  totallines number;<br>
  ret number;<br>
  exch varchar(90);<br>
  secs varchar(50);<br>
begin<br>
  for c1 in (select distinct exchange from fastfix_customer_perf where clientname = 'CLIENTNAME' and archive = '0') loop<br>
    select count(*) into totallines from fastfix_customer_perf where clientname = 'CLIENTNAME' and archive = '0'<br>
    and exchange = c1.exchange;  --count(*) pro value<br>
    ret := ceil(totallines * 0.25); <br>
     select exchange, totalroundtripsecs into exch, secs
     from<br>
    (select exchange,totalroundtripsecs, row_number() over (partition by exchange
     order by totalroundtripsecs) rn from fastfix_customer_perf where exchange = c1.exchange)<br>
     where rn = ret;<br>
             HTMLDB_MAIL.SEND(<br>
      P_TO       => '[email protected]',<br>
      P_CC       => '[email protected]',<br>
      P_FROM     => '[email protected],<br>
      P_BODY     => ' ',<br>
      P_SUBJ     => '### ! CLIENTNAME ! ###',<br>
      P_BODY_HTML => '<tr><td><table cellpadding="0" border="0" cellspacing="0" summary="" class="t12standardalternatingrowcolors"><tr><th class="t12header" id="EXCHANGE">EXCHANGE</th><th class="t12header" id="TOTALROUNDTRIPSECS">Totalroundtripsecs (25th) percentiles</th></tr><tr><td class="t12data">'||exch||'</td><td class="t12data">'||secs||'</td></tr></table></td></tr><br>');<br>
end loop;<br>
<br>
HTMLDB_MAIL.PUSH_QUEUE( 'mailhost', '25');<br>
end;<br>

Similar Messages

  • Assigning an array to a ListCollectionView

    I have a ListCollectionView that I want to add a listener to
    so I can respond to changes, but the problem here is that I have to
    assign an array to it. When I do this:
    myListCollectionView = new ArrayCollection(myArray);
    It removes all listeners. Is there any other way to force an
    array into a ListCollectionView? When I do this:
    myListCollectionView = myArray as ArrayCollection;
    or
    myListCollectionView = ArrayCollection(myArray);
    I get an error.
    Alternately, is there an event I can listen to on a TileList
    that will let me know when the dataProvider has changed? I can't
    seem to find anything that works.
    P.S. Assigning a new ArrayCollection also seems to remove
    ChangeWatchers as well.

    Ok I ended up having to do this:
    myListCollectionView.disableAutoUpdate();
    myListCollectionView.removeAll();
    for each (var thing:Thing in thingArray) {
    myListCollectionView.addItem(thing);
    myListCollectionView.enableAutoUpdate();
    and then hooking into the onUpdateComplete event (fires after
    the TileList redraws itself:
    myTileList.addEventListener("onUpdateComplete",
    myEventHandler);

  • Problem in assigning script array to Js variable

    There is a huge list(20,000) of cities that has to be put into a script array for the further use in the jsp page. so this script array is created once for all when the login is made for the application and stored a session variable. The sample of the script array is like-----
    <script>
    strArrCityName[17463]= "Zoar";
    strArrCityID[17463]= "10599";
    strArrCityStateID[17463]= "3";
    strArrCityName[17464]= "Zoarville";
    strArrCityID[17464]= "10600";
    strArrCityStateID[17464]= "3";
    </script>
    the entire stuff from <script>---</script>(uncluding the script tags is stored as a string in the session (strSessionCityArr))
    Now the porblem is i need to store this array into a js variable on jsp page load.
    I order to that i need to declare a js variable in jsp page
    ex::
    <html>
    <body>
    This is a sample jsp page created by <%= strUserName%>
    <script>
    var cityarry = "<%=session.getAttribute('strSessionCityArr')%>";
    </script>
    </body>
    </html>
    when i assign the array to the js variable , the <script> tag inside the string is conflicting with the <script> tag that of the jsp page.
    This throws the js error and the futher loading of the page is stopped.
    The reason i am storing it in the js variable is i will be painting the script array dyanamically on click of a button.
    Also in need both the script tags in the array is in other jsp pages i will painting the array on page load by using the out.println(strCityArray)
    I need a way in which this script array can be stored in js variable or any method by which i can directly get it from the session on button click
    Thanx in advance
    Manu

    i had tired constructing the script array using the JS but JS logic is always slower ...my point was not to do it all with JS code. My point was that unless you know how to properly define it as JS-only code, then it makes it hard to figure out how to break that up to Java generated code. It's clear to me that you don't have a very good grasp of what you're trying to do.
    The second point is, in some JSPs i need the <script> tags to be included in the array. No they don't. You can always put the <script> tags around what your Java variable includes if you are using that content in several places...
    <script><%= session.getAttribute('strSessionCityArr') %></script>

  • Assign global array of structures of structures of std strings in a dll

    I have a dll which consists of three c files. Find bellow the c file of the loader and the three files of the dll. In dll, file 1 and file 2 are almost identical, static arrays names and sizes, structure names, Prepare_1() and Prepare_2() functions. There
    is a small difference in the function Prepare_1 in the way MuxStatusSupl[ u32Idx ].FileInfo.Name is assigned and there I get an exception. Another difference is that the structure StructStatus in file 2 has an extra member compare to file 1. From this point
    I couldn't strip down even more the sample code because small changes make the problem disappear without, I'm afraid, really solving the problem. That's why I have put so much code here, I'm not even sure what is relevant and what not. For example, if I add
    in file 1 in the StructStatus the extra member u32ExitPoint (and, of course, I modify Status_Init accordingly), I don't see the problem anymore.
    ///////////////////////////////////////////////////// loader file begin ////
    #include "stdafx.h"
    int main(int argc, char* argv[])
    {   HINSTANCE hDLL = LoadLibrary( DLL_FQN_FILE_NAME );
        if( void ( * pCreateDllInterface )( void ) =
                (void(*)())GetProcAddress( hDLL, "CreateDllInterface" ) )
            pCreateDllInterface();
        FreeLibrary( hDLL );
    ///////////////////////////////////////////////////// loader file end //////
    ///////////////////////////////////////////////////// dll main file begin //
    extern void Prepare_1( void );
    extern void Prepare_2( void );
    extern "C" _declspec(dllexport) void CreateDllInterface( ) { Prepare_1(); }
    ///////////////////////////////////////////////////// dll main file end ////
    ///////////////////////////////////////////////////// dll file 1 begin /////
    #include <string>
    #include <sys/stat.h>
    #define STORAGE_SIZE  254
    typedef unsigned long  int uint32;
    struct StructFileInfo
    {   std::string Name; 
        struct stat FileStatus; 
    static struct StructStatus
    {   bool bDownloaded;      bool bDownloadedLast;
        bool bCalled;          bool bCalledLast;
        uint32 u32EntryPoint;
        StructFileInfo FileInfo;
    } MuxStatusMain[ STORAGE_SIZE ], MuxStatusSupl[ STORAGE_SIZE ];
    void Prepare_1() 
    {   struct stat Stat_Init;
        memset( &Stat_Init, 0, sizeof(struct stat) );
        StructStatus Status_Init =
                        { false, false, false, false, 0, { "", Stat_Init } };
        std::fill_n( MuxStatusMain, STORAGE_SIZE, Status_Init ); //  this seems
                               // to overwrite MuxStatusSupl[ 3 ].FileInfo.Name
        for( uint32 u32Idx = 0; u32Idx < STORAGE_SIZE; u32Idx++ )
            MuxStatusSupl[ u32Idx ].FileInfo.Name = ""; // crash when u32Idx==3 
    ///////////////////////////////////////////////////// dll file 1 end ///////
    ///////////////////////////////////////////////////// dll file 2 begin /////
    #include <string>
    #include <sys/stat.h>
    #define STORAGE_SIZE  254
    typedef unsigned long  int uint32;
    struct StructFileInfo
    {   std::string Name; 
        struct stat FileStatus; 
    static struct StructStatus
    {   bool bDownloaded;      bool bDownloadedLast;
        bool bCalled;          bool bCalledLast;
        uint32 u32EntryPoint;  uint32 u32ExitPoint;
        StructFileInfo FileInfo;
    } MuxStatusMain[ STORAGE_SIZE ], MuxStatusSupl[ STORAGE_SIZE ];
    void Prepare_2()
    {   struct stat Stat_Init;
        memset( &Stat_Init, 0, sizeof(struct stat) );
        StructStatus Status_Init =
            { false, false, false, false, 0, 0xFFFFFFFF, { "", Stat_Init } };
        std::fill_n( MuxStatusMain, STORAGE_SIZE, Status_Init );
        std::fill_n( MuxStatusSupl, STORAGE_SIZE, Status_Init );
    ///////////////////////////////////////////////////// dll file 2 end ///////
    I get the crash with the message: Unhalted exception at 0x10001f90 in Test.exe: 0xC0000005: Access violation writing location 0x1006d320
    Another strange phenomena is that in watch window, expressions
        sizeof(MuxStatusMain)/sizof(MuxStatusMain[0])
        sizeof(MuxStatusMain)/sizof(MuxStatusMain[0])
    show both a value of 232 instead of 254 (but if I add in file 1 in the struct the missing member they show the correct values). On the other hand, if I printf those values, they are correct, 254.

    "Another difference is that the structure StructStatus in file 2 has an extra member compare to file 1."
    That's not going to work. It is possible to define the same struct in different translation units but the definitions need to be identical. Use different names for StructFileInfo and StructStatus.

  • Oracle.sql.BLOB as array

    Hi,
    I have a database table(say MY_BLOB_TABLE.) having one blob column
    I want to send each blob column as an attachment to a single email i.e. I for a particular case if I have 10 qualifying rows in MY_BLOB_TABLE,I want to send all these 10 blobs as different attachments with a SINGLE email.
    I have the working code (from asktom) that allows me to send one attchment per email ..so I changed the code so that it takes array types to the things..
    here is my code:
    Database Type:
    create or replace type xx_blobdata is varray(50) of blob;
    create or replace type xx_attachedfile is varray(50) of varchar2(1000);
    create or replace type xx_attachedfiletype is varray(50) of varchar2(1000);
    Java Code
    public class xx_attachments_mail
    static String dftMime = "application/octet-stream";
    static String dftName = "filename.dat";
    public static oracle.sql.NUMBER
    send(String from,
    String to,
    String cc,
    String bcc,
    String subject,
    String body,
    String SMTPHost,
    oracle.sql.BLOB[] attachmentData,
    String[] attachmentType,
    String[] attachmentFileName);
    PLSQL Wrapper
    create or replace function xx_attachments_mail_send(
    p_from in varchar2,
    p_to in varchar2,
    p_cc in varchar2,
    p_bcc in varchar2,
    p_subject in varchar2,
    p_body in varchar2,
    p_smtp_host in varchar2,
    p_attachment_data in xx_blobdata,
    p_attachment_type in xx_attachedfiletype,
    p_attachment_file_name in xx_attachedfile) return number
    as
    language java name 'xx_attachments_mail.send( java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    oracle.sql.BLOB[],
    java.lang.String[],
    java.lang.String[]
    ) return oracle.sql.NUMBER';
    Actual Call:
    attachment_data :=xx_blobdata();
    attachment_type :=xx_attachedfiletype();
    attachment_name :=xx_attachedfile();
    ret_code := xx_attachments_mail_send(
    p_from => '[email protected]',
    p_to => '[email protected]',
    p_cc => NULL,
    p_bcc => NULL,
    p_subject => 'testing',
    p_body => 'testing..',
    p_smtp_host => 'myserver.com',
    p_attachment_data => attachment_data,
    p_attachment_type => attachment_type,
    p_attachment_file_name => attachment_name);
    Everything compiles. All objects are valid in database.But when I call I get the following error:
    ORA-29531: no method send in class xx_attachments_mail
    ORA-06512: at "XX_ATTACHMENTS_MAIL_SEND", line 1
    Can anybody point out what is wrong that I am doing.
    Thanks.

    Duplicate post:
    Re: oracle.sql.BLOB array
    Devang,
    You asked:
    Can anybody point out what is wrong that I am doing?Yes, I can.
    VARRAY maps to "java.sql.Array" or "oracle.sql.ARRAY".
    You can find more details in the JDBC Developer's Guide and Reference which is part of the Oracle documentation, as well as the JDBC sample code which can be accessed from here:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    Good Luck,
    Avi.

  • SQL query with arrays.

    Hi I am having problems running my sql query.
    I have a function that returns an array of type VARRAY(100) OF NUMBER(30). I want to be able to make the following sql call
    ..... where my_table.columnA IN myFunctions()
    I get the following exception
    ORA-00932: inconsistent datatypes: expected NUMBER got IDS_ARRAY
    Any help is appreciated,
    Thanks

    SQL> create or replace type ids_array is VARRAY(100) OF NUMBER(30);
      2  /
    &nbsp
    Type created.
    &nbsp
    SQL> create or replace function my_func
      2  return ids_array
      3  is
      4   ret ids_array := ids_array();
      5  begin
      6   ret.extend(10);
      7   for i in 1..10 loop
      8    ret(i) := i;
      9   end loop;
    10   return ret;
    11  end;
    12  /
    &nbsp
    Function created.
    &nbsp
    SQL> select rn from
      2  (select rownum rn from
      3  (select 1 from dual connect by level < 20)) t,
      4  table(my_func) b
      5  where t.rn = b.column_value
      6  /
    &nbsp
            RN
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    &nbsp
    10 rows selected.
    &nbsp
    SQL> select rn from
      2  (select rownum rn from
      3  (select 1 from dual connect by level < 20)) t
      4  where rn in (select column_value from
      5  table(my_func))
      6  /
    &nbsp
            RN
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    &nbsp
    10 rows selected.Rgds.

  • Java.sql.SQLException: Byte array not long enough

    using thin jdbc returned this exception seems to be connected to the length of the statment:
    ////////create a prepared statement////////
    preUpdateStatement = dbConnection.prepareStatement(updateStatement.toString());
    // build data output stream on byte array output stream
    ByteArrayOutputStream byte_os = new ByteArrayOutputStream();
    DataOutputStream data_os = new DataOutputStream(byte_os);
    // write chars to data output stream
    data_os.writeChars(((Element)m_values_vector.elementAt(i)).m_value);
    // create input stream and pass it to prepared statement
    ByteArrayInputStream byte_is = new ByteArrayInputStream(byte_os.toByteArray());
    preStatement.setUnicodeStream(i+1, byte_is, byte_os.toByteArray().length);
    // execute
    preUpdateStatement.executeUpdate();
    preUpdateStatement.close();
    null

    stack is:
    java.sql.SQLException: Io exception: Char array not long enough: javaCharsToUtf8Bytes
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(Compiled Code)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(Compiled Code)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(Compiled Code)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(Compiled Code)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecute(Compiled Code)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled Code)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(Compiled Code)

  • Assigning javascript array with jsp array

    hi,
    I have a jsp page where I have a array in jsp. I want to assign the values to an javascipt array. how can I do that?
    the reason why I want to do this is for a perticular problem I am facing in javascript. that is....
    I have a text box in my jsp page, I want the value entered in that box to be checked (whether it exists ) against a hidden string which has some value. I want that hidden string not to be shown to the user even on seeing the html source. that is why I want these values to be stored and checked against a array object of javascript.
    any suggestion is appreciated
    Thanks
    Ashutosh

    Hai asutoshdash
    if you dont mind of viewing code u can use this else dont use, its not matters weatehr user will see you code or not if the user is professiona then its a big issue normal users not think of is for this dont send valuable infos like password etc to client u may send usernames
    ok to create a java array to javascript array do this (i took example of db to array ) write this inside <script> <%codes here%> </script>
    var aUsername =new array();
    <%
    int i=0;
    while (rs.next())
    %>
    aUsername[<%= ++i%>] = "<%= rs.getString("User_Name")%>";
    <%
    %>thats it use this array where ever you want in your client side(javascript ) usage
    hope this will help you
    archi

  • PL/SQL Sort an array Oracle 10g

    Does Oracle 10g have a built in method to sort an array (collection)?

    A quick method for sorting ( no massive data ) may be the following.
    SQL> set serveroutput on
    SQL> declare
      2     tab sys.owa_util.vc_arr;
      3     type sorted_tab is table of varchar2(32767) index by varchar2(32767);
      4     sorted sorted_tab;
      5     id1 pls_integer;
      6     id2 varchar2(32767);
      7  begin
      8     tab(1) := 'hello';
      9     tab(2) := 'george';
    10     tab(5) := 'no';
    11     id1 := tab.FIRST;
    12     WHILE id1 IS NOT NULL LOOP
    13             sorted(tab(id1)) := tab(id1);
    14             id1 := tab.NEXT(id1);
    15     END LOOP;
    16
    17
    18
    19     id2  := sorted.FIRST;
    20     WHILE id2 IS NOT NULL LOOP
    21             dbms_output.put_line(sorted(id2));
    22             id2 := sorted.NEXT(id2);
    23     END LOOP;
    24  end;
    25  /
    george
    hello
    no
    PL/SQL procedure successfully completed.But next time be correct. Index by tables defined in packages are not considered as collections.
    Bye Alessandro
    Edited by: Alessandro Rossi on 4-nov-2008 16.51

  • RE: (forte-users) SQL Array Insert

    Unfortunately that carries a tremendous overhead. Each request is a seperate
    message and forte generates alot of behind the scenes prepares for the sql.
    ---------------------- Forwarded by Amos G. Radford on 10/27/2000 02:34 PM
    "Amin, Kamran" <kamran.aminlendware.com> on 10/27/2000 02:33:07 PM
    To: Amos G. RadfordBankofAmerica
    cc:
    Class: Internal Use Only
    Subject: RE: (forte-users) SQL Array Insert
    User a for loop and call update for each row in the array.
    For Loop
    Update
    set
    1=test[1]
    end for
    ka
    -----Original Message-----
    From: Amos.G.Radfordbankofamerica.com
    [mailto:Amos.G.Radfordbankofamerica.com]
    Sent: Friday, October 27, 2000 12:07 PM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) SQL Array Insert
    I have run into a strange problem that I never really run into
    before. If I want to save an array of items into a table in TOOL
    SQL, how can I do it if the column names in the table are different
    than the column names in the class. In the past we always had
    the luxury of the column names being the same.
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Madhu,
    Do the following:
    1. create prepare statement
    e.g
    stmHnd : DBStatementHandle;
    inputData : DBDataset = new;
    stmType : integer;
    stmHnd = DBSesObj.prepare('insert into
    table_name myCOl1, myCol2, myCol3
    values(:myCol1Value, :myCol2Value, :myCol3Value)',
    inputData,stmType);
    2. Populate the input DBDataset.
    e.g
    // assign the maximum value
    inputData = myArrObj.items;
    // assign the values
    for i in 1 to myArrObj.items do
    inputdata.currentRow = i;
    inputdata.setvalue(':myCol1Value',
    myArrObj.attr1);
    inputdata.setvalue(':myCol2Value',
    myArrObj[i].attr2);
    inputdata.setvalue(':myCol3Value',
    myArrObj[i].attr3);
    end for;
    3. execute the statement:
    e.g .
    DBSesObj.execute(stmHnd, inputData);
    4. release the handle
    DBSesObj.RemoveStatement(stmHnd);
    Hope this helps,
    Babu
    --- "Epari, Madhusudhan" <meparioxhp.com> wrote:
    Babu,
    I'm not clear on how dynamic sql statement would
    access the database only
    one time for inserting an array of records in to the
    table. Could you tell
    how's it done?
    thanks in advance,
    Madhu
    -----Original Message-----
    From: Babu Raj [mailto:ibcsmartboyyahoo.com]
    Sent: Friday, October 27, 2000 8:02 PM
    To: Amos.G.Radfordbankofamerica.com;
    forte-userslists.xpedior.com
    Subject: RE: (forte-users) SQL Array Insert
    Amos,
    Why don't you use, Dyanmic SQL statement,
    where
    you need to prepare only one SQL Statement, and
    populate input place holder, which is much simpler
    and
    you need to access the database only one time(which
    is
    efficient operation). This is useful, especially,
    when
    you want to update. But for your inforamtion, Forte
    internally inserts, one by one row, even if u call
    Static SQl statement, with array of record. Os its
    advisable to use Dyanmic SQL statement.
    Hope this helps,
    Babu
    --- Amos.G.Radfordbankofamerica.com wrote:
    Unfortunately that carries a tremendous overhead.
    Each request is a seperate
    message and forte generates alot of behind the
    scenes prepares for the sql.
    ---------------------- Forwarded by Amos G.Radford
    on 10/27/2000 02:34 PM
    "Amin, Kamran" <kamran.aminlendware.com> on
    10/27/2000 02:33:07 PM
    To: Amos G. RadfordBankofAmerica
    cc:
    Class: Internal Use Only
    Subject: RE: (forte-users) SQL Array Insert
    User a for loop and call update for each row inthe
    array.
    For Loop
    Update
    set
    1=test[1]
    end for
    ka
    -----Original Message-----
    From: Amos.G.Radfordbankofamerica.com
    [mailto:Amos.G.Radfordbankofamerica.com]
    Sent: Friday, October 27, 2000 12:07 PM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) SQL Array Insert
    I have run into a strange problem that I never
    really run into
    before. If I want to save an array of items intoa
    table in TOOL
    SQL, how can I do it if the column names in the
    table are different
    than the column names in the class. In the pastwe
    always had
    the luxury of the column names being the same.
    For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To
    unsubscribe, send in a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.xpedior.com
    For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To
    unsubscribe, send in a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.xpedior.com
    For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To
    unsubscribe, send in a new
    email the word: 'Unsubscribe' to:forte-users-requestlists.xpedior.com

  • How to add byte[] array based Image to the SQL Server without using parameter

    how to add byte[] array based Image to the SQL Server without using parameter.I have a column in table with the type image in sql and i want to add image array to the sql image column like below:
    I want to add image (RESIM) to the procedur like shown above but sql accepts byte[] RESIMI like System.Drowing. I whant that  sql accepts byte [] array like sql  image type
    not using cmd.ParametersAdd() method
    here is Isle() method content

    SQL Server binary constants use a hexadecimal format:
    https://msdn.microsoft.com/en-us/library/ms179899.aspx
    You'll have to build that string from a byte array yourself:
    byte[] bytes = ...
    StringBuilder builder = new StringBuilder("0x", 2 + bytes.Length * 2);
    foreach (var b in bytes)
    builder.Append(b.ToString("X2"));
    string binhex = builder.ToString();
    That said, what you're trying to do - not using parameters - is the wrong thing to do. Not only it is insecure due to the risk of SQL injection but in the case of binary data is also inefficient since these hex strings are larger than the original byte[]
    data.

  • Can we assign "Arrays" as class properties??

    Hi there!
    Is that possible we assign an array as the class properties?
    Code:
    package
              import flash.net.URLLoader;
              import flash.net.URLRequest;
              import flash.events.Event;
              import flash.events.EventDispatcher;
              public class TextToArray
         public var urlLoader:URLLoader = new URLLoader();
         public var dataArray:Array = new Array();
         public var textURL:String = "";
         public var seperator:String = "";
         public function TextToArray(textURL:String,seperator:String)
            this.textURL = textURL;
            this.seperator = seperator;
            urlLoader.load(new URLRequest(textURL));//URL to the text file we need to import to Flash
            urlLoader.addEventListener(Event.COMPLETE, dataArrayLoaded);
         public function dataArrayLoaded(e:Event):void
           this.dataArray = e.target.data.split(seperator);//the seperator such as "\n"
           urlLoader.removeEventListener(Event.COMPLETE, dataArrayLoaded);
           trace(this.dataArray[2]);  // corret Data
         public function getArray():Array{
           trace(this.dataArray[2]);  // undefined
           trace(textURL); // correct Data
           return dataArray;
         public function getArrayLength():int{
            return dataArray.length;
    What am I doing wrong?
    Thanks for your time.

    thanks a lot for your prompt reply! I have called it in another class (Main.as) like this:
    package
              import TextToArray;
              import VerseID;
              import flash.display.MovieClip;
              public class Main extends MovieClip
          var textToArray:TextToArray = new TextToArray("data/connection.txt","\n");
          var quranData:Array = new Array();
                        public function Main()
          this.quranData = textToArray.getArray();
          trace(this.quranData[2]); // undefined

  • How to assigned array index position to database field

    Here is the sample data of my report.
    Run#     Note1     Note2       Note1 ArrayIndex      Note2 ArrayIndex
    101        CR         Work               1                              2
    102        Work      ER                  2                              3
    103        ER         Test                3                               4
    104        ER         CR                  3                              1
    104       Work                             2                           
    Page Footer:    1. CR       2. Work     3.ER       4.Test
    I have to load distinct values of note1 and note2 in to array and assigned the array index of that note1 and note2 values and on the page footer i have to print distinct note1 and note2. would like to see at the page footer like above.  I allready figer out how to load the distinct note1 and note2 values in array but i am not able to print the Not1Arrayindex and Note2Arrayindex value in the report. I am not sure how to print out the arrayindex values based on the array value.
    Thanks for your help.

    Hi Shweta,
    Thanks for your help. I already take a look that thread but still itu2019s not clear.
    I have to assigned the array index value like 1,2,3,4,5 and at the page footer
    I have to load the N1 and N2 database value in to one array and then show then array index value next to it and at the page footer I have to show corresponding array index with index value.
    Run# , N1  ,               N2             ,        Ind          ,          Ind
    101 ,       CR      ,              Wk               ,              1           ,                 2
    102 ,      Wk    ,                ER                ,              2           ,                 3
    103 ,       ER      ,              Tst                 ,            3            ,                4
    104 ,       ER      ,               CR                ,            3            ,                1
    Page Footer: 1. CR       2. Wk   3.ER        4.Tst
    Thanks for help.
    Regards,
    Shirin

  • Passing array to oracle stored procedure in VC++ 2005

    Hi,
    I am try to send an array of integers to a stored procedure via ODBC 10.2.0.3 on VC++2005 enviornment. I get the below error
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'MYPROC1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored ... Error Code = 6550
    []E R R O R
    The same code works if I use an INSERT statement.
    SQLUSMALLINT* rowsProcessed = new SQLUSMALLINT;
    RETCODE nRetCode;
    const int arraySize = 200;
    long ptrVal[arraySize];
    long ptrInd[arraySize];
    long ptrStatus[arraySize];
    for (int i = 0; i < arraySize; i++)
    ptrVal = i;
    ptrInd = 0;
    nRetCode = SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAM_BIND_TYPE, SQL_PARAM_BIND_BY_COLUMN, 0);
    // assign the number of sets of parameters that are to be inserted
    nRetCode = SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAMSET_SIZE, (SQLPOINTER)iSizeOfArray, 0);
    // assign an array to retrieve status info for each row of parameter values
    nRetCode =SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAM_STATUS_PTR, (SQLPOINTER)ptrStatus, 0);
    // assign a buffer to store the number of sets of parameters that have been processed
    nRetCode = SQLSetStmtAttr(m_hstmt, SQL_ATTR_PARAMS_PROCESSED_PTR, (SQLPOINTER)rowsProcessed, 0);
    nRetCode = SQLBindParameter(m_hstmt, nParamIndex, nDirection, SQL_C_LONG, SQL_INTEGER, 0, 0, ptrVal, 0, ptrInd);
    //suceeds
    SQLPrepare(m_hstmt, (SQLCHAR*)"INSERT INTO my_table VALUES (?)", SQL_NTS);
    //fails
    SQLPrepare(m_hstmt, (SQLCHAR*)"{CALL mypackage.myproc1(?)}", SQL_NTS);
    SQLExecute(m_hstmt);
    package is
    create or replace package mypackage
    as
    type mytable is table of binary_integer;
    procedure myproc1( l_tab in mytable);
    end;
    show errors
    create or replace package body mypackage
    as
    procedure myproc1( l_tab in mytable)
    as
    begin
    insert into my_table values (100);
    commit;
    FORALL i IN l_tab.first .. l_tab.last
    INSERT into my_table values( l_tab(i) );
    end;
    end;
    any ideas?

    I believe when you're doing it with an insert, you're saying "execute this insert statement a bunch of times, here's all the values in advance", which is different than passing an array to a stored procedure where you want it to execute once.
    Oracle's ODBC driver doesnt support Associative Arrays (aka index-by tables).
    Hope it helps,
    Greg

  • Declaring an array

    Hi,
    Can you teach me how to declare and assign an array in oracle
    forms?
    Thanks.

    use the table data type,
    You can read more about it in the pl/sql guide on otn
    documentation section.
    or you can use a record_group, check out the online help of
    forms.

Maybe you are looking for

  • Server definition goes suddenly wrong with Wordpress site and DW CS5

    Let me explain this simply. I install a worpdress site, normally, on my local server (xampp). After setting up the site with the web-install thingy, I start DW. I set a definition site with the new (not at all improved) site definition dialog-box. //

  • PLS files as web links won't open in ITunes; still say Winamp

                                                                                                                   Hello.  I apologize if this has been answered, but I searched to the best of my ability, and none of the answers I saw applied to this ques

  • Storing information within a document

    Hi everyone, Is there a proper way to store information within a InDesign document? I would like my InDesign extension to be able to synchronizes data between a document, and an online database. So in order to do this I would like to store a copy of

  • ICal & Entourage 2008 sync

    I know that this isn't a Microsoft support forum but I'm hoping that an Entourage user out there may have some insight. I have Office 2008 on my MacBook Pro. Under Preferences/Sync Services, I have the box checked to sync my Entourage calendar with i

  • Manufacturing database in use or database in use error

    Hi, B1 was stable for a couple of weeks but Friday I received an email from our Accountant (Larrry) who wanted to run a report out of MRP/Materials Management. The error indicated "Manufacturing Database in Use". I restarted the server on Saturday an