home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / oracle / 2224 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.4 KB  |  40 lines

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!nntp.msstate.edu!olivea!inews.Intel.COM!news
  2. From: news@inews.Intel.COM (USENET News System)
  3. Newsgroups: comp.databases.oracle
  4. Subject: Can I use struct of varchars like varchars in PRO*C
  5. Message-ID: <BxvJMt.4JF@inews.Intel.COM>
  6. Date: 17 Nov 92 19:04:04 GMT
  7. Organization: Intel Corporation, Santa Clara, CA USA
  8. Lines: 29
  9. Nntp-Posting-Host: mipos2
  10.  
  11. declaration section ......
  12. struct table_name {
  13.     varchar field1[10];
  14.     varchar    field2[10];
  15. } tab;
  16. From: kortikar@mipos2.intel.com (Aniruddha Kortikar)
  17. Path: mipos2!kortikar
  18.  
  19. I fill the tab by reading from some file.
  20.     if (sscanf(file_descriptor,"%[^|]|%[^|]",tab.field1.arr,tab.field2.arr))
  21.         .....
  22. set the length elements ..
  23.     tab.field1.len=strlen(tab.field1.arr);
  24.     ...
  25.  
  26. now how can I update the table tab2
  27. insert into tab2 field (f1,f2) values (:tab.field1,:tab.field2) fails !!!
  28. it says PCC-S-0026 : undeclared host var tab.field1 ....
  29. offcourse I can pad tab.field.arr and then use it. but can I use struct instead?
  30.  
  31. Aniruddha Kortikar(kortikar@mipos2.intel.com)
  32.  
  33.  
  34.  
  35.  
  36. -------------------------------------------------------------------------------
  37. E-mail     : kortikar@mipos2.intel.com | A billion here, a billion there ...
  38. Phone(W): 408 765 5515              | pretty soon it adds upto real money.
  39. -------------------------------------------------------------------------------
  40.