DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: urgent sqlscript

  1. #1
    Join Date
    May 2002
    Posts
    232
    hii friends I have 20 tables and their data.
    All these stored in sql file.
    So I like to execuite this sql file at clent place.
    Once i will execuite this sql file then all my tables,constraints has to created in that database.
    But when i try to execuite this file i get error.
    Here i am ging sample of my file below


    REM
    REM $Header: TABLESCRIPT.sql
    REM
    REM NAME
    REM TABLESCRIPT.sql - Build Oracle Data Digi Demonstration Tables
    REM DESCRIPTION
    REM This SQL script builds the Digi Data demonstration tables
    REM NOTES
    REM TABLESCRIPT 28/05/02 - Creation
    REM Create new datasources

    CREATE TABLE DIGI_LOGIN_TBL (
    USER_ID VARCHAR2 (10) NOT NULL,
    PASSWORD1 NUMBER (6) NOT NULL,
    PASSWORD2 VARCHAR2 (15),
    STATUS CHAR (1),
    CONSTRAINT USER_PK
    PRIMARY KEY ( USER_ID ));
    CREATE TABLE DIGI_SERVICE_TBL (
    SERVICE_ID NUMBER (10) NOT NULL,
    SERVICENAME VARCHAR2 (30) NOT NULL,
    SERVICE_DESC VARCHAR2 (300),
    OTHERS VARCHAR2 (500),
    STATUS CHAR (1), CONSTRAINT SERID_PK
    PRIMARY KEY ( SERVICE_ID ),
    CONSTRAINT SERNAME_UK
    UNIQUE (SERVICENAME));

    SQL>SP2-0552: Bind variable "TABLESCRIPT" not declared.
    WHY I GET THIS ERROR,PLS HELP ME
    THANKS
    KAVITHA
    kavitha

  2. #2
    Join Date
    May 2002
    Posts
    22
    Hi kavithared....

    I think because of this line
    (or any lines containing colon char....)
    ------------------------------
    REM $Header:TABLESCRIPT.sql
    -----------------------------

    try to remove the character of ":" (colon)...
    since sql plus consider ":tablescript" as a bind variable
    let's eat fish!

  3. #3
    Join Date
    Oct 2001
    Location
    Hyderabad
    Posts
    44
    Kavitha,
    I ran ur script in my Database, absolutely no error, the two tables were created. Better u try by removing colons.

  4. #4
    Join Date
    May 2002
    Posts
    35

    Talking

    kavitha,

    i dont think that the : ( colon ) will create any such problem /error since its a REM and a REM is a REM no matter what. i executed the script in my database and it works absolutely fine and i got the tables created

    so try it again

    sharmila

  5. #5
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587
    Kavitha,
    This urgent of yours is begginning to give me a pain in my bum.
    What is this, some kind of a mcdonald's fast food service, where people are spoon feeding you.....
    state a short description and wait!!!

    I ran it on my test db and it was fine.........
    Code:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    
    SQL> CREATE TABLE DIGI_LOGIN_TBL ( 
      2  USER_ID VARCHAR2 (10) NOT NULL, 
      3  PASSWORD1 NUMBER (6) NOT NULL, 
      4  PASSWORD2 VARCHAR2 (15), 
      5  STATUS CHAR (1), 
      6  CONSTRAINT USER_PK 
      7  PRIMARY KEY ( USER_ID )); 
    
    Table created.
    
    SQL> CREATE TABLE DIGI_SERVICE_TBL ( 
      2  SERVICE_ID NUMBER (10) NOT NULL, 
      3  SERVICENAME VARCHAR2 (30) NOT NULL, 
      4  SERVICE_DESC VARCHAR2 (300), 
      5  OTHERS VARCHAR2 (500), 
      6  STATUS CHAR (1), CONSTRAINT SERID_PK 
      7  PRIMARY KEY ( SERVICE_ID ), 
      8  CONSTRAINT SERNAME_UK 
      9  UNIQUE (SERVICENAME)); 
    
    Table created.
    
    SQL> 
    SQL>
    So something else is the case with your error....

    State where/and as who are you logging in to oracle...more specifics please.

    Tarry



    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

  6. #6
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587
    Originally posted by imron95
    Hi kavithared....

    I think because of this line
    (or any lines containing colon char....)
    ------------------------------
    REM $Header:TABLESCRIPT.sql
    -----------------------------

    try to remove the character of ":" (colon)...
    since sql plus consider ":tablescript" as a bind variable
    Or this way with the rem's........
    Code:
    SQL> drop table DIGI_LOGIN_TBL;
    
    Table dropped.
    
    SQL> drop table DIGI_SERVICE_TBL;
    
    Table dropped.
    
    SQL> REM 
    SQL> REM $Header: TABLESCRIPT.sql 
    SQL> REM 
    SQL> REM NAME 
    SQL> REM TABLESCRIPT.sql - Build Oracle Data Digi Demonstration Tables 
    SQL> REM DESCRIPTION 
    SQL> REM This SQL script builds the Digi Data demonstration tables 
    SQL> REM NOTES 
    SQL> REM TABLESCRIPT 28/05/02 - Creation 
    SQL> REM Create new datasources 
    SQL> 
    SQL> CREATE TABLE DIGI_LOGIN_TBL ( 
      2  USER_ID VARCHAR2 (10) NOT NULL, 
      3  PASSWORD1 NUMBER (6) NOT NULL, 
      4  PASSWORD2 VARCHAR2 (15), 
      5  STATUS CHAR (1), 
      6  CONSTRAINT USER_PK 
      7  PRIMARY KEY ( USER_ID )); 
    
    Table created.
    
    SQL> CREATE TABLE DIGI_SERVICE_TBL ( 
      2  SERVICE_ID NUMBER (10) NOT NULL, 
      3  SERVICENAME VARCHAR2 (30) NOT NULL, 
      4  SERVICE_DESC VARCHAR2 (300), 
      5  OTHERS VARCHAR2 (500), 
      6  STATUS CHAR (1), CONSTRAINT SERID_PK 
      7  PRIMARY KEY ( SERVICE_ID ), 
      8  CONSTRAINT SERNAME_UK 
      9  UNIQUE (SERVICENAME)); 
    
    Table created.
    Cheers!

    Tarry
    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width