OnLine Workgroup Server quesions
Posted in 1996
Topics: Stored Procedures & SPL, Data Types & Schema Design, Triggers, Constraints & Referential Integrity
Hello, we have Informix OnLine Workgroup Server version 7.12 for
Windows NT and I've got a few questions which I'm hoping someone can
help me with.
I'm working on converting a large number of SQL scripts from MS SQL
Server syntax to Informix syntax and there are a few things I'm having
problems with. I should let you know that I'm running these scripts
in the SQL Editor which came with Workgroup Server (SQLEDITOR.EXE).
1) Is there an "If Then" syntax which I can use in the SQL Editor? I
know that this is available in stored procedures but the SQL Editor
chokes on it. In SQL Server we had a clause similar to the following
at the top of every table creation script:
if exists (select * from systables where tabname = 'customer' and
tabtype = 'T')
begin
drop table customer;end;
Is there something similar I can do in SQL Editor? If not, is there a
way that I can issue a "drop table" command and not have the script
terminate if the table doesn't exist?
2) In SQL Server, a VARCHAR(10) will let you store all 10 characters.
In Informix, it looks like I can only store 9 characters since
Informix uses one byte to store the length. Do I have to go through
the hundreds of scripts that I have and increase all the VARCHARs by 1
or is there a simpler way that I'm not thinking of?
3) It's a long story as to why we need to do this but, is there any
way to have a foreign key point to a view instead of a table?
Thanks for you help.
Jay Sullivan
jsulliva@eag.mhs.compuserve.com