by shavonne.marietta@[EMAIL PROTECTED]
("Shavonne Marietta Wijesinghe")
Jun 13, 2008 at 02:05 PM
This is a multi-part message in MIME format.
------=_NextPart_000_00A3_01C8CD5E.7B279270
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello
I'm having some trouble checking if a table exist before i create it.=20
Example:
SELECT * FROM distributors
IF (table not found) THEN
CREATE TABLE distributors (
did integer,
name varchar(40),
UNIQUE(name)
);
END IF
If i have a table like the above how can i identify if the table exists =
or not?
Thank You.
Shavonne Wijesinghe
------=_NextPart_000_00A3_01C8CD5E.7B279270
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16674" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial>Hello</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>I'm having some trouble checking if a table =
exist before i=20
create it. </FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>Example:</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3D"Courier New">SELECT * FROM distributors</FONT></DIV>
<DIV><FONT face=3D"Courier New"></FONT> </DIV>
<DIV><FONT face=3D"Courier New">IF (table not found) THEN</FONT></DIV>
<DIV><FONT face=3D"Courier New"> CREATE TABLE =
distributors=20
(<BR> did =20
integer,<BR> name =
varchar(40),<BR> =20
UNIQUE(name)<BR> );</FONT></DIV>
<DIV><FONT face=3D"Courier New">END IF</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>If i have a table like the above how can i =
identify if the=20
table exists or not?</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>Thank You.</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><B>Shavonne=20
Wijesinghe</B><BR></SPAN></DIV></BODY></HTML>
------=_NextPart_000_00A3_01C8CD5E.7B279270--