A question about piecewise insert(OCI), only data in the first piece ..

When i do a piecewise insert operation, only data in the first piece was inserted into the column, There is no error occured. a OCI_SUCCESS returned when the last piece operation completed.
I am really puzzled now:(.
Who can get me out of this?
The data to be insert are stored in many structs:
typedef struct test_st{
     char * buffer;
     struct test_st * next;
} TEST_ST;
I use malloc(size) to allocate the buffer of each struct, and I use strcpy() to copy some strings to these buffers.
table mc_test is like this:
id number;
message varchar(64);
The full source_code goes there:
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <oci.h>
static OCIEnv *p_env;
static OCIError *p_err;
static OCISvcCtx *p_svc;
static OCIStmt *p_sql;
static OCIDefine p_dfn    = (OCIDefine ) 0;
static OCIBind p_bnd    = (OCIBind ) 0;
const char * orausername="out_user";
const char * orapassword="user_out";
const char * oraserver="bigfish";
int oraOK=0;
int rc;
char errbuf[100];
int errcode;
int checkerr(OCIError *errhp, sword status);
int db_init(void);
int db_open(void);
int db_close(void);
typedef struct test_st{
     char * buffer;
     struct test_st * next;
} TEST_ST;
int db_save_to_test(){
     char               sql_str[512];
     ub4                    typep;
     ub4                    piec_status;
     ub1                    in_outp;
     ub4                    rownum;
     ub4                    arr;
     sb2                    indp;
     ub2                    r_code;
     int                    t_buff_len;
     int                    total_len=15;
     int                    buffer_pos=0;
     TEST_ST * content, * t;
     content=(TEST_ST *) malloc(sizeof(TEST_ST));
     content->buffer= (char *) malloc(5);
     strcpy(content->buffer,"1234");
     content->next=(TEST_ST *) malloc(sizeof(TEST_ST));
     content->next->buffer= (char *) malloc(5);
     strcpy(content->next->buffer,"5678");
     content->next->next=(TEST_ST *) malloc(sizeof(TEST_ST));
     content->next->next->buffer= (char *) malloc(5);
     strcpy(content->next->next->buffer,"9012");
     content->next->next->next=NULL;
     if(!_ora_OK){
          return 0;
     printf("-------------------------\n");
     printf("[db]save to mc_test..\n");
     printf("total: %d bytes\n",total_len);
     /* create sql */
     sprintf(sql_str,"insert into mc_test(id,message)values(1,:x)");
     //printf("%s\n",sql_str);
     rc = OCIStmtPrepare(p_sql, p_err, sql_str,
          (ub4) strlen(sql_str), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT);
     checkerr(p_err,rc);
     rc = OCIBindByPos(p_sql, &p_bnd, p_err, (ub4) 1,
               (dvoid *) content->buffer, total_len, SQLT_CHR, (dvoid *) 0,
               (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DATA_AT_EXEC);
     checkerr(p_err,rc);
     rc = OCIStmtExecute(p_svc, p_sql, p_err, (ub4) 1, (ub4) 0,
          (CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT);
     checkerr(p_err,rc);
     if(rc == OCI_NEED_DATA){
          printf("[pw] start........\n");
          // insert next pieces
          t=content;
          printf("%d bytes total.\n",total_len);
          while(t!=NULL){
               if(t==content){
                    piec_status=OCI_FIRST_PIECE;
                    t_buff_len=strlen(t->buffer);
                    buffer_pos=t_buff_len+1;
                    printf("ready for first piece: %d bytes\n",t_buff_len+1);
                    printf("__________________\n%s\n__________________\n",t->buffer);
               }else if(t->next==NULL){
                    piec_status=OCI_LAST_PIECE;
                    t_buff_len=strlen(t->buffer);
                    buffer_pos+=t_buff_len+1;
                    printf("ready for last piece: %d bytes\n",t_buff_len+1);
                    printf("__________________\n%s\n__________________\n",t->buffer);
               }else{
                    piec_status=OCI_NEXT_PIECE;
                    t_buff_len=strlen(t->buffer);
                    buffer_pos+=t_buff_len+1;
                    printf("ready for next piece: %d bytes\n",t_buff_len+1);
                    printf("__________________\n%s\n__________________\n",t->buffer);
               t_buff_len++;
               rc = OCIStmtSetPieceInfo((dvoid *)p_bnd,
(ub4)OCI_HTYPE_BIND, p_err, (dvoid *)t->buffer,
& t_buff_len, piec_status, (dvoid *) 0, &r_code);
               checkerr(p_err,rc);
               rc = OCIStmtExecute(p_svc, p_sql, p_err, (ub4) 1, (ub4) 0,
                    (CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT);
               checkerr(p_err,rc);
               t=t->next;
          if(rc==OCI_SUCCESS){
               printf("All insert OK\n");
          printf("-------------------------\n");
          return 0;
     }else if(rc==OCI_SUCCESS){
          printf("Simple inserted.\n");
          printf("-------------------------\n");
          return 1;
     }else{
          checkerr(p_err,rc);
          printf("-------------------------\n");
          return 0;
int main(){
     db_init();
     db_open();
     db_save_to_test();
     db_close();
int db_close(){
     rc = OCILogoff(p_svc, p_err); /* Disconnect */
     rc = OCIHandleFree((dvoid *) p_sql, OCI_HTYPE_STMT); /* Free handles */
     rc = OCIHandleFree((dvoid *) p_svc, OCI_HTYPE_SVCCTX);
     rc = OCIHandleFree((dvoid *) p_err, OCI_HTYPE_ERROR);
     oraOK=0;
     return rc;
int db_open(){
     /* Connect to database server */
     rc = OCILogon(p_env, p_err, &p_svc, orausername, strlen(_ora_username), orapassword, strlen(_ora_password), oraserver, strlen(_ora_server));
     if (rc != 0) {
     OCIErrorGet((dvoid *)p_err, (ub4) 1, (text *) NULL, &errcode, errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
     printf("Error - %.*s\n", 512, errbuf);
     return(8);
     /* Allocate SQL */
     rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_sql,
          OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0);
     checkerr(p_err,rc);
     oraOK=1;
     return rc;
int db_init(){
     rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */
          (dvoid * (*)(dvoid *, size_t)) 0,
          (dvoid * (*)(dvoid *, dvoid *, size_t))0,
          (void (*)(dvoid *, dvoid *)) 0 );
     /* Initialize evironment */
     rc = OCIEnvInit( (OCIEnv **) &p_env, OCI_DEFAULT, (size_t) 0, (dvoid **) 0 );
     /* Initialize handles */
     rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_err, OCI_HTYPE_ERROR,
          (size_t) 0, (dvoid **) 0);
     rc = OCIHandleAlloc( (dvoid *) p_env, (dvoid **) &p_svc, OCI_HTYPE_SVCCTX,
          (size_t) 0, (dvoid **) 0);
     checkerr(p_err,rc);
     return rc;
int checkerr(OCIError *errhp, sword status){
     text errbuf[512];
     sb4 errcode = 0;
     switch(status){
          case     OCI_SUCCESS:
                    return 0; break;
          case     OCI_SUCCESS_WITH_INFO:
                    (void) printf("Error - OCI_SUCCESS_WITH_INFO\n");
                    break;
          case     OCI_NEED_DATA:
                    (void) printf("Error - OCI_NEED_DATA\n");
                    break;
          case     OCI_NO_DATA:
                    (void) printf("Error - OCI_NODATA\n");
                    break;
          case     OCI_ERROR:
                    (void) OCIErrorGet((dvoid *)errhp, (ub4) 1, (text *) NULL, &errcode,
                                   errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
                    (void) printf("Error - %.*s\n", 512, errbuf);
                    break;
          case     OCI_INVALID_HANDLE:
                    (void) printf("Error - OCI_INVALID_HANDLE\n");
                    break;
          case     OCI_STILL_EXECUTING:
                    (void) printf("Error - OCI_STILL_EXECUTE\n");
                    break;
          case     OCI_CONTINUE:
                    (void) printf("Error - OCI_CONTINUE\n");
                    break;
          default:
                    break;
     return 1;
ref: http://www.oracle.com.cn/onlinedoc/appdev.920/a96584/oci05bnd.htm#427755

On Windows, the Flash player plugin DLL is under C:\Windows. When everything is working correctly, Firefox finds the Flash player by checking entries under a registry key. I don't know whether this check takes place every time Firefox restarts, or at other intervals.
Other plugins may install differently, e.g., copying a DLL into a folder under c:\Program Files (x86). It's rare for a plugin to be profile-specific.
If your plugin list is not updating, the pluginreg.dat file that stores plugin information might be corrupted. This article has a section on how to delete that file so Firefox will regenerate it: [https://support.mozilla.org/en-US/kb/troubleshoot-issues-with-plugins-fix-problems#w_re-initializing-the-plugins-database]. Does that help?

Similar Messages

  • Question about starting up an iPod Touch for the first time

    I just got an iPod touch but my computer kind of died. I have access to other computers though, if I get my iPod started on one of these other computers, will it still work on mine if I get it working again? Like will I be able to get music from my iTunes on my computer onto the iPod if it's not the first computer it's started with?I just got an iPod touch but my computer kind of died. I have access to other computers though, if I get my iPod started on one of these other computers, will it still work on mine if I get it working again? Like will I be able to get music from my iTunes on my computer onto the iPod if it's not the first computer it's started with?

    Yes, you can hook up your Ipod Touch to any computer. I don't think it's picky.

  • Every sync gets "You are about to synchroniz​e your calendar for the first time" - Help !!!

    I am on a MBP with the Tour and was able to successfully sync iCal and Address Book with BB. But everytime I try to sync, I get the " You are about to synchronize our Calendar data for the first time." with the options to "Replace Device Data", "Merge Data" or Cancel. Has anyone seen this and know how to fix? Replacing data makes it impossible to update Mac with changes on BB.  
    Please help! 

    Create a backup of your iCal and your BlackBerry.
    Then create a test Calendar event on the BlackBerry, in iCal then test another synchronization once again.
    The first time sync prompt usually occurs when it does not detect entries in either the BlackBerry or iCal Calendar.
    -FB
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click "Accept as a Solution" for posts that have solved your issue(s)!

  • Hello am using ios 7.0.4 I have a question about messages that it does not show the time of a particular message after first message that I recive form a paricular person so please in the next version change this and with every message show time and date

    hello am using ios 7.0.4 I have a question about messages that it does not show the time of a particular message after first message that I recive form a paricular person so please in the next version change this and with every message show time and date

    Hi,
    How is everything going? Have you checked this issue from OWA? If so, please let me know the result.
    In adition, please also try to use the following powershell commands to check if the assistant has right permissions:
    Get-MailboxFolderPermission -Identity
    CEO’s email address:\Calendar -User assistant’s email address
    Also check with:
    Get-Mailbox -Identity CEO’s mailbox
    | fl *GrantSendOnBehalfTo
    Please let me know the result.
    Best Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • I have a question about extracting pages.  When I do the function, adobe saves the individual files as " file name space page number ", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I a

    I have a question about extracting pages.  When I do the function, adobe saves the individual files as "<file name><space><page number>", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I am using excel to concatenate some data to dynamically build a hyperlink to these extraced files.  It casues me problems, however, for the space to be the the file name.  Is there any way to change the default behavoir of this function to perhaps use a dash or underscore instead of a space?

    No, you can't change the default naming scheme. You can do it yourself if you extract the pages using a script instead of using the built-in command.

  • Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in. Thanks

    Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in.

    You don't. Email comes in either by push or when you invoke the email app. Ther is no password except when you first set up the account. If your iPad is not being used as your personal device and you need to shield emails from other users, then don't use the email app.  Instead, use web mail if available from your provider.

  • Displaytag to export the only data not the url

    I am using displaytag to export the data but my data is coming like
    but I only want the data to export
    For example I want the only data not the url should be like:
    78190
    My code is as below:
    :<display:table name="bulkDetails" export="true" pagesize="100" id="row" sort="list"> <display:column title="REQUESTID" sortable="true"> <c:url value="../Status" var="url"> <c:param name="Status_Index" value="${row.REQUESTID}"/> </c:url> <a href=${url>${row.REQUESTID} </display:column> while export this data it gives me with full url likebut my need is only data not the full url .
    please help .

    Thanks Helen.
    As you said the files got saved in other location, apart from the specified folder location. However I need info on the files you got after export. Because in my server I can only see GRACSPMRCODE,GRACSPMRCODESDATA and GRACSPMRCODESYSDATA files but not the owners, fire fighters, firefighter ID files.
    Please let me know the files you received.
    Regards,
    Giridhar

  • SharePoint - MS Word Document Only specific pattern allowed. Only data in the following pattern is allowed: ',*\S.*'

    We have a SharePoint 2007 document library setup with a custom template using MS Word. This template is a doc and/or a docx (we have used both and both have the pattern error). We are using the Document Information Panel in the document
    when opening to be filled in. One of the fields - Test - is a multiple lines of text
    field. When we use the Enter key a red dotted line appears. The message for the error appears below:
    Only specific pattern allowed. Only data in the following pattern is allowed: ',*\S.*'
    Does anyone know why this is? We need the ability to use the
    Enter key. We have MS Word at 14.0.4 and it does not have an issue with using the
    Enter key. Any later version of MS Word this issue occurs.
    SharePoint Configuration database version: 12.0.0.6608
    MS Office 2010 14.0.6029.1000
    Chris

    Hi,
    Did you installed some updates recently? Many users encounter this issue after installing KB2817537 or some updates released in Sept.
    This issue occurs because the regular expression used to validate the property doesn't allow for line breaks.
    Fortunately, DPKs attached to this bug have been successfully applied by the build lab.
    We are working on this issue and it will be fixed in future update.
    To work around this issue, please temporarily uninstall the
    KB2817537. If that wouldn’t work, please also uninstall
    KB2760758, KB276041 & KB2760411 and then test the issue again.
    Thanks,
    Steve Fan
    TechNet Community Support
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • HT201303 i have tried to perchase a movie and it keeps coming up with questions about my past thet i dont remember the answer to. how do i find out the answers? i have never come across these questions until now

    i have tried to perchase a movie and it keeps coming up with questions about my past thet i dont remember the answer to. how do i find out the answers? i have never come across these questions until now

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Pie Chart Only Displays the Data of the First Row of the Table

    Hi Experts,
    I have a problem that the pie chart will not change when click on a second row or other rows on the table. It only displays the data of the first row of the table. How can I set up to make it reflect on any rows when I click the table? Please help, and I would very appreciate that.
    Thanks,
    -Don

    Thanks a lot for your response. I have realized that the pie chart behaves that way, so I just use the filter to see the specific data that I want. Also, you can drag the row and drop it right at the first row to see the data in the pie chart.

  • My ipod classic crashes after about 2-3 days of being attached to my Kenwood KDC-248U receiver in Pickup.  There are 2700  songs but only get through the first 200   Apple has replaced the Ipod 3x and Kenwood says it is not a problem with the receiver.

    My ipod classic crashes after about 2-3 days of being attached to my Kenwood KDC-248C receiver in my Pickup.  There are about 2700+ songs on the Ipod, but only get through the first 200 to 300 songs.  The screen fades, but there is still power and a charge.  Does anyone have a clue because I don't.?

    There seem to be compatibilty isuue with KDC receiver and Ipod Classic firmware 1.1.2.
    Here is an earlier post on the same problem.
    https://discussions.apple.com/message/12471279#12471279
    Good Luck on getting an earlier version ipod firmware. (Google it)

  • Read data in the first column selected in a Multicolumn listbox

    When a row is selected in a multicolumn listbox (1 item), how do I go about reading the data in the first column?
    Solved!
    Go to Solution.

    The multicolumn listbox itself is numeric array data type. If you have allowed selection of only 1 item and selection mode of select entire row, it returns the row number. Use the "Item Names" property node to return a 2d array of strings of the items in your box. Index it by the row from the value of the listbox and column 0. See attached code.
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines
    Attachments:
    MultiColumnListbox.vi ‏5 KB

  • How to make a summary column appear only once (in the first page only) in SSRS 2008?

    Hello Everyone,
    How to make a summary column appear only once (in the first page only) in SSRS 2008?
    Regards
    Gautam S
    Regards

    Hi,
    Assuming you have test data like this ;
    select 'abc'as [GROUP],'NN' name , 1 id
    union all
    select 'abc' as [GROUP] ,'PP' name , 1 id
    union all
    select 'abc'as [GROUP],'RR' name , 2 id
    Step1  : take Tablix with row group as your group Name .
    Step2 : right Click on Row Group Details -> Delete-> Delete Group Only
    Step3 : In Count Cell use below expression ;
    =CountDistinct(Fields!id.Value)
    Follow this link;
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b6b45917-0a26-4d15-be46-2c6a2697d6e9/distinct-rows-sum?forum=sqlreportingservices#5ffdee06-c2c8-44ea-a3a5-b958488bb6b5
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • Events over multiple days only show on the first day in 'Month' view

    Hi,
    I've noticed that if I create an event that spans over two days (for example 23 May 2008 at 6 PM to 24 May 2008 at 1 PM) are only displayed on the from date in Month view.
    This is unfortunate because if I look at my calendar in Month view, I think I'm free on the 24th, when in fact I'm busy until 1 PM.
    Is there a way to get the Month view to display an entry for the event on both days (other than creating one event running from 23 May 2008 at 6 PM to 11:59 PM and a second from 24 May 2008 at 1:01 AM to 1 PM)?
    Message was edited by: Sam Watterson

    Hi Sam
    I just had the exact same problem the other day. I was asked to make an appointment with someone, I checked my calendar (actually on my iPhone) and I looked available that day so agreed and even entered the event. Turns out I will be working 70 miles away on the event I entered on the day prior. I've had the embarrassment of having to reschedule - makes me look disorganised.
    The month view on iPhone is just the same as iCal - if it's not an 'all day' event it only shows on the first day. This is poor. I recall even outlook and windows mobile calendar manages to display this sensibly. Apple should be fixing this pronto.

  • Infopath submit button only works for the first row in a repeating table‏

    Hi, I have a InfoPath Email submit button issue I could not figure out. I have a master/detail repeating table in my form, and one of fields is "EmailAddress" which shows customer's email address. I created a submit button and put the "EmailAddress"
    field to "TO" object. When I tested it, the submit button only would return the first row of emailaddress from the repeating table, but not the rest of it..
    What I want is when I highlighted a customer, and click the submit button, the current customer's email address would show up in "TO" list. I did some research and saw some suggestions about using current() function. So I put current() in the front,
    like this:
    current()/dfs:dataFields/d:vw_HZLeadLists/@EmailAddress
    Still not working..Just return the first record of emailaddress from master repeating table... Does anyone know what's going on here? Thanks a lot!

    Hello,
    Use double eval to get all rows values. See my reply for more information in below thread:
    eval(eval(EmailAddress, 'concat(ToField, ";")'), "..")
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/cc22aeb7-351f-45a7-8a4c-94132c3e0db2/eval-semicolon-function-issue?forum=sharepointcustomizationprevious
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • Thunderbolt to vga (mini display to vga adapter)

    okay i got a macbook pro 2011 for christmas. i got the lg flatron 19'' w1942T and when i connect the them via mini display to vga adapter the external monitor goes into power save mode! and the mouse lags on the macbook screen...

  • Problem in tilelist with dataprovider.

    I have a problem in tilelist. with the dataprovider a get the message error ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() if i delete the images from the l

  • HT4108 Does the lightening to HDMI allowing video mirroring of items in the iBook (i.e. pdf)?

    Have a few PDF files in iBooks I want to share on an overhead projector to a large audience and plan to purchase the lightening to HDMI connector and want to check if this will work.  Have iPad 4.

  • Looking to Hire As3 / Java Programmer for Game Startup in NJ

    This is a great opportunity for a skilled actionscript 3 coder to create great games in a startup backed by Kickstarter in Hackensack, NJ. Position is on-site. Some with online multiplayer experience preferred (specifically Electroserver 5). http://w

  • Videos don't play until fully buffered?

    Every video i try to play doesn't actually start till the video is fully buffered. It's not so bad if its a 2 min video but if im trying to watch a movie or a long youtube video i have to wait ages till it'll actually work. any suggestions on how to