home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / sybase / 715 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.2 KB  |  76 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!psinntp!ctp!kkurk
  3. From: kkurk@ctp.com (Kendra Kurk)
  4. Subject: Why won't select into work?
  5. Message-ID: <1993Jan22.002512.11866@ctp.com>
  6. Sender: news@ctp.com
  7. Nntp-Posting-Host: luna.ctp.com
  8. Organization: Cambridge Technology Partners
  9. Distribution: us
  10. Date: Fri, 22 Jan 1993 00:25:12 GMT
  11. Lines: 63
  12.  
  13.  
  14. While creating a stored procedure, I ran into a problem that
  15. I can't seem to solve; perhaps someone out there can lend a hand!
  16.  
  17. create proc foo
  18. (
  19.     @id1    int,
  20.     @id2    char(2)
  21. )
  22. as
  23.  
  24. select
  25.     name,
  26.     dollars
  27. into
  28.     #tmp
  29. from
  30.     DATABASE_1..Record
  31. where
  32.     id1 = @id1
  33. and    id2 = @id2
  34.  
  35. This returns an error 'implicit conversion from datatype int to datatype
  36. char not allowed.'  HOWEVER, when I declare the table and insert into,
  37. there is no trouble - WHY?!!!  This is very frustrating, and we can't
  38. seem to figure out why it occurs.
  39.  
  40. create proc foo
  41.     @id1 int,
  42.     @id2 char(2)
  43. as
  44.  
  45. create table #tmp
  46. (
  47.     name char(10),
  48.     dollars int
  49. )
  50.  
  51. insert into #tmp
  52. select
  53.     name,
  54.     dollars
  55. from
  56.     DATABASE_1..Record
  57. where
  58.     id1 = @id1
  59. and    id2 = @id2
  60.  
  61.  
  62. Thanks in advance . . .
  63. Kendra
  64.  
  65. PS Running Sybase, version 4.9.0 on an HP
  66.  
  67. Kendra Kurk
  68. CTP Inc.
  69. (617) 374-9800
  70. kkurk@ctp.com
  71.  
  72. -- 
  73. Kendra Kurk
  74. kkurk@ctp.com
  75. Cambridge, Mass
  76.