home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / database / oracle / 1489 < prev    next >
Encoding:
Text File  |  1992-09-03  |  3.2 KB  |  108 lines

  1. Newsgroups: comp.databases.oracle
  2. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsc!cbfsb!cbnewsb.cb.att.com!colten
  3. From: colten@cbnewsb.cb.att.com (marc.colten)
  4. Subject: Need help with forms and OCI
  5. Message-ID: <1992Sep4.034110.14064@cbfsb.cb.att.com>
  6. Sender: news@cbfsb.cb.att.com
  7. Organization: AT&T
  8. Date: Fri, 4 Sep 1992 03:41:10 GMT
  9. Lines: 97
  10.  
  11.  
  12. Well here I am again.  I've been using olsqlform30 to create forms
  13. and the OCI (in "C" language) to insert and extract information.
  14. I've been hitting some problems and would appreciate some advice.
  15. Please e-mail and responses and I will summarize and post.
  16.  
  17. thanks in advance,
  18.  
  19. marc colten
  20.  
  21.  
  22. 1)  I created a table with a LONG field for comments.  I can
  23.     add and edit that field just fine (I have a 
  24.     ON-NEW-FIELD-INSTANCE trigger with EDIT_FIELD in it).
  25.     However, my C program will not extract that field in any
  26.     way.
  27.  
  28.     Some code is :
  29.  
  30.      struct {
  31.             ...
  32.             ...
  33.             ...
  34.             ...
  35.             ...
  36.         char TROUBLE[65535];
  37.         } attr[3];
  38.  
  39.  
  40.      odefin(C0,5,attr[1].TROUBLE,(int) strlen(attr[1].TROUBLE),LONG,
  41.                    -1,dum,NULL,-1,-1,&dum2,&dum3);
  42.  
  43.     
  44.    When I fetch the data, everything else comes up okay, but
  45.    I get a message that the field has been truncated.  I
  46.    print it out character by character (assuming it was not
  47.    NULL terminated) and it's empty.  I have tried putting the
  48.    field length directly into the odefin, and the field length
  49.    in the structure has been anywhere from 100 to 67000.   I have
  50.    used LONG and STRCHR as identifiers.  Nothing.
  51.  
  52.  
  53. 2) I have used structures with no array:
  54.  
  55.      struct {
  56.             ...
  57.             ...
  58.             ...
  59.             ...
  60.             ...
  61.         } attr;
  62.  
  63.  
  64. and it does not work.  If I use attr[3], I can't get the
  65. data into attr[0].  But if I use a number > 1 and assign
  66. the output to attr[1].<field>, it always works.  Can anyone
  67. explain this?
  68.  
  69. 3)  Can you do a query on a detail block and have the relevant
  70.     information come up in the master block?  It works fine
  71.     the other way.  I do a query in a master block and it brings
  72.     up two records in the detail (which it should).  I've tried
  73.     doing the reverse and it won't work.  I set up a KEY-ENTQRY
  74.     trigger on the detail block with various commands:
  75.  
  76.          go_block('<master>');
  77.          :<master>.field := <detail>.field;
  78.          execute_query;
  79.     
  80.     But no luck.  execute_query wipes out the master block
  81.     before it does anything. What I wind up with is the
  82.     detail block shows the information what I wanted, while
  83.     the master block shows the data you'd get from a blank field.
  84.     
  85.     What I want to do is:
  86.         enter the query in the detail block.
  87.         execute the query.
  88.         The master block queries it's table to come up
  89.           with the appropriate information based on the data
  90.           placed in the detail.
  91.         The master executes a query so the master and the detail
  92.           (two records now) show the matching data.
  93.  
  94.     Is this possible?
  95.  
  96.  
  97. 4)  Can you do a LOV on a block, or failing that on a non-enterable
  98.     field?  I just want a list relevant to the data I've queried
  99.     as an alternative to a second page, which is not really necessary
  100.     and really slows things down.
  101.  
  102.  
  103.  
  104. Thanks
  105.  
  106.  
  107.  
  108.