0

I work with perl and sybase. I try to create view in perl:

if(condition)
  create view name_view
   as select col1,col2,col3
  from table1,table2
   where key1=key2
else (condition)
  create view name_view
   as select col1,col2,col2
  from table1,table3
   where key1=key2

And when I run it, I always get an error, that view is already exists. Even I put an if - exists condition.

drop view name_view

it is always the same error.

Please note: I cannot create a view in separate query, because when I select from view, it works very slow.

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
user2843135
  • 33
  • 1
  • 8
  • What SAP Sybase product are you using, and how are you checking to see if the view already exists? – Mike Gardner Feb 25 '14 at 18:54
  • Please remember to use the `sybase-ase` tag, and not just the `sybase` tag. It will help remove any confusion as to which Sybase DB product you are reffering to. – Mike Gardner Feb 25 '14 at 18:57

1 Answers1

0

I would recommend using prepare and execute call. Please read this excellent post from PerlMonks.org

HackerKarma
  • 620
  • 7
  • 18