Isql*plus 9.2 problem: Substitution variables

hi, i'm new to using isql*plus.
i have written the following script to setup my the structure of a database, it works but when i execute it it asks me to:
Substitution Variables
Enter values for substitution variables in the script to execute:
Variable      Value
d
I cant work out why, please help.
here's the script:
--author: daniel smith
--student number: 2235592
--date: 17/02/2005
--isql plus
--Application Development and Database (AD&D)
--Assessment 3
--drop existing tables
drop table expense;
drop table sess;
drop table assignment;
drop table task;
drop table stage;
drop table project;
drop table task_type;
drop table employee;
drop table grade;
--create new tables
create table grade
grade_no number(6) primary key,
description varchar2(50),
rate_per_hour number(5,2)
create table employee
employee_no number(6) primary key,
surname varchar2(50),
first_name varchar2(50),
grade_no number(6),
foreign key (grade_no) references grade(grade_no)
create table task_type
task_type_no number(6) primary key,
description varchar2(50),
grade_no number(6),
foreign key (grade_no) references grade(grade_no)
create table project
project_no number(6) primary key,
project_code varchar2(50),
client varchar2(50),
description varchar2(50),
manager number(6),
foreign key (manager) references employee(employee_no)
create table stage
project_no number(6),
stage_no number(6),
description varchar2(50),
Start_date date,
planned_Duration number(6,1),
fees_basis varchar2(2),
primary key (project_no,stage_no),
foreign key (project_no) references project(project_no),
constraint fees_basis_ck check(fees_basis IN ('fq','vs','vn','cs','cn'))
create table task
project_no number(6),
stage_no number(6),
task_no number(6),
description varchar2(50),
estimated_hours number(6,2),
planned_start_date date,
max_duration number(6,2),
task_type_no number(6),
primary key (project_no,stage_no,task_no),
foreign key (project_no,stage_no) references stage(project_no,stage_no),
foreign key (task_type_no) references task_type(task_type_no)
create table Assignment
project_no number(6),
stage_no number(6),
task_no number(6),
employee_no number(6),
estimated_hours number(6),
primary key (project_no,stage_no,task_no,employee_no)
create Table Sess
Session_no number(6),
Session_date date,
actual_Hours number(6),
chargeable char(1),
project_no number(6),
stage_no number(6),
task_no number(6),
employee_no number(6),
primary key (Session_no),
Foreign key (project_no, stage_no, task_no, employee_no)
references Assignment(project_no, stage_no, task_no, employee_no),
constraint chargeable_sess check(chargeable IN ('y','n'))
create table expense
expense_no number(6),
description varchar2(50),
quantity number(4),
unit_cost number(4,2),
chargeable char(1),
project_no number(6),
primary key(expense_no),
foreign key(project_no) references project(project_no),
constraint chargeable_exp check(chargeable IN ('y','n'))
**********************************************************

<< ..
<< --Application Development and Database (AD&D)
<< --
take the '&' off your script,
oracle thinks you want to define variable D,
and obviously you don't want that

Similar Messages

  • ISQL*Plus script parsing problem with the + operator

    Hi,
    You have most likely caught this one already.
    Select power(3,2) + power(3,2) from dual;
    Works from the iSQL*plus window but not when loaded from a script; the + operator is getting removed.
    Regards,
    Rob
    null

    Thanks for the report. The fix for this is indeed already in our 9.0 code (which will be the next release of iSQL*Plus)
    - CJ

  • Substitution variables in Sql*Plus

    Hi all,
    How to make Sql*Plus ask for the substitution variable value one time only for a substitution variable even if it appears multiple times inside a query ? Because so far each time I launched the query below then I have been asked two times by Sql*Plus for the variable value. For example : select ref_site from t_comsis where longitude_lamb + latitude_lamb < &distance + power(&distance,2).
    Thanks

    of course accept is more friendly, you can check for valid number, you can have a prompt or a hidden input.
    you can also undef your variable if you prefer the && solution
    SQL> select &&x+&&x from dual;
    Enter value for x: 1
    old   1: select &&x+&&x from dual
    new   1: select 1+1 from dual
           1+1
             2
    SQL> undef x
    SQL> r
      1* select &&x+&&x from dual
    Enter value for x: 2
    old   1: select &&x+&&x from dual
    new   1: select 2+2 from dual
           2+2
             4

  • ISql*Plus works well, but sqlplus throws ORA-12560. Why?

    I installed Oracle DB 10.2.0.1 on Windows XP. After the installation, everything works like clockwork. ... well, until I installed Oracle Application server 10.1.2.0.2.
    For the most part, it still works fine. But now, whenever I run sqlplus from command line, I get ORA-12560: TNS:protocol adapter error. I can still connect using the same login from iSql*Plus without any problem. Why?
    Now I'm supposed to cd into a directory, fire off sqlplus and run a sql script. How do I do this in iSql*Plus?
    Any help? Thanks,
    -M

    Thanks for the replies. I got the idea. I need to set
    those variables myself, although I personally think
    the installer should take care of that during
    installation.
    Now, out of curiosity, why did iSql*Plus never have
    the problem even though I didn't have any those
    variables set in my environment?No idea why those aren't set automatically, but they aren't, as you found out. :)
    iSQL*Plus is a web based service, and I believe it uses JDBC, not straight OCI calls.

  • SQL*Plus Substitution Variables Article

    I see questions on SQL*Plus substitution variables still pop up here. I've reposted the old SQL*Plus 10.1 Substitution Variables article that once was on OTN. Almost all the content and examples are still relevant.
    -- cj

    btw there is a double <tt>&lt;i></tt> tag in the line <i>"7.1 iSQL*Plus 9 and SQL*Plus Substitution Variable Compatibility"</i> causing the 2000 or so lines following it to be in italics.
    I think it's meant to be
    <i>i</i>SQL*Plus 9<i>i</i>and not
    <i>i</i>SQL*Plus 9<i><i></i>

  • Problems using substitution variable in Web Analysis

    Dear all,
    I have a Web Analysis report that I need to show a raking table with the current month.
    For that I create a variable in Essbase that is updated with that date (E.g.: varCurrentMonth).
    After that I use it as my substitution variable to filter my date dimension in a report data source (E.g.: Scr5, row: product, column: date dimension & measure):
    2008 (current month)
    Product $ qty.
    AAA 100 10
    BBB 90 7
    CCC 80 5
    The problem is that in our cube we need to use an alias in every dimension not to have duplicate members (E.g.: DT.Date, MS.Measure, PD.Product, etc). And when we use it we need to set up the variable in Essbase using that alias (E.g.: DT.Feb/05/08). And if we use that variable as a substitution variable in the report data source the label displayed is the DT.2008 and not 2008 as expected.
    Does anybody have an idea how to solve that?
    Many thanks,
    Thiago Gabriel

    You usually get this error message if you are trying to assign a value from a sub var to a member that does not exist.
    e.g. trying to put FY08 which is a year member against a period dimension
    or trying to use a sub var of FY09 which does not yet exist in the essbase, so say you added a new year in planning FY09 and used the sub var in the form but have not refreshed the database then it would fail because the year would not have been pushed down to essbase yet.
    or the value of the subvar does not match a member name exactly
    or using a sub var name that does not exist in essbase, e.g. using &nextYear but the sub var has not been created in essbase.
    You can definitely use subsitution variables in columns in the version you are using and prior version.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Problem in Variable Substitution (Receiver File Adapter)

    Hi,
    I am facing problem in the variable substitution in receiver file Communication channel. My expected file name is A_C.xml; but my actual output filename obtained is C_C.xml for the below example target file:
    <ProductionSch>
    <CustomField>
    <value>
    <ValueString>A</ValueString>
    </value>
    </CustomField>
    <CustomField>
    <value>
    <ValueString>B</ValueString>
    </value>
    </CustomField>
    <CustomField>
    <value>
    <ValueString>C</ValueString>
    </value>
    </CustomField>
    </ProductionSch>
    I have used the following parameters in the file communication channel:
    File Name Schema: %var1%_%var2%.xml
    Variable Substitution:
    Variable Name                     Reference
    var1                                     payload:ProductionSch,1,CustomField,1,value,1,ValueString,1
    var2                                     payload:ProductionSch,1,CustomField,3,value,1,ValueString,1
    When I try using either of the one in the file name schema and the corresponding variable reference in the variable substitution I am getting the correct output filename as A.xml or C.xml. However, when I give either of the one variable in file name schema and both the variable references in the variable substitution I am getting only C.xml as per the example file.
    Can any of you suggest me where I am wrong or any other suggestion which I can try?
    I cannot use dynamic configuration as I am using multimapping. Multiple file names cannot be generated using dynamic configuration.
    Regards
    Sowmya

    hi Sowmya,
    refer you to this [Note 1581988 - Variable Substitution option does not work properly|https://service.sap.com/sap/support/notes/1581988] (2011.05), as SAP says " when there is more than one variable using the same name as the last element, File Adapter does not select the correct one.... ".
    regards.
    Mickael

  • Peculiar problem with Essbase (Calc Script) - substitution variable / UDAs

    This is odd but I have a script like :
    VAR iloop=1,break=0;
    FIX(<required POV>)
    Loop (20,break)
    VAR Country_total1,Country_total2,Country_total3;
    FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop)))) // &Country1, &Country2 - are substitution variables with UDAs stored as strings
    Statements;
    /* +<statements for calculating total values.. for that country and stored against variables>+ */
    Country_total1=Country_total1+ +<Calculation>+
    ENDFIX
    /* Second part : Now again the calculations stored in the variables are to be stored against specific entities */
    FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop))))
    FIX(@ISUDA(Entity,<Check1>)
    ..... Assign to relevant account
    ENDFIX
    ENDFIX
    ENDLOOP
    ENDFIX
    Now the problem is that the first fix statement works just fine, but the FIX statement in the 'second part' throws an error
    Error: 1200354 Error parsing formula for [FIX STATEMENT] (line 66): expected type [STRING] found [EXTVAR] ([iloop]) in function [@CONCATENATE]
    If I hard code the 'second part' FIX statement to the substitution variable directly - it works just fine.
    How can the first statement work and not the second one ? They are exactly the same.

    Glenn, thanks - I hadn't thought of that :).
    But it still does not entirely solve my problem (please see my previous post depicting a requirement similar to ours )
    - We have lots of countries (50-60+ might be much more) and each country can have multiple entities (3-4 on an average - can go unto 7-8)
    - so good guess would be around 200 entities
    - So say I have to do it for 2 countries only (two entity types). Then I need 4 variables - 2 for each country ('country 1 ET1 total', 'Country 1 ET2 Total')
    When the list is 20 counties - variables become 40 :(.
    - Still leaving aside the 40 variables for a bit -
    There are subsequent steps of calculations which needs to be done based on these totals (which are exactly the same for all countries) - just that we need the correct totals to begin with and the rest is already stored in the DB
    So since I have a different variable for each country - I cannot write one single calculation block to use the variables sequentially one by one (can I ?)
    I might have to write a separate calculation block for each of these countries. (20 separate blocks)
    That's what I was trying to avoid and simplify with the substitution variable (but is not working)
    - Create substitution variables - which would store the alias of the required countries (2/10/20 as many required)
    - Loop through these substitution variables - using them one by one
    - So I just need one single block of calculation with all the variable in the calc script being reused after each country calculation is done
    - and the user need not go into the script, as the only thing that will change are the countries. And he can change it easily through the substitution variable.
    Edited by: Ankur on Jun 27, 2012 12:53 PM

  • Problem with my substitution variable.

    My substitution variables don't prompt properly now. It worked fine before, but I don't know what I did to it. Here is the test code:
    set define on;
    connect sys/&sysPassword @&instanceName as sysdba;
    execute dbms_output.put_line('this is a test');
    When I tried to execute above lines in sqlplus, it didn't prompt anything, but got following result instead:
    SQL> set define on;
    SQL> connect sys/&sysPassword@&instanceName as sysdba;
    Enter value for syspassword: execute dbms_output.put_line('this is a test');
    Enter value for instancename:
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SQL>
    I remember when I used substitution variables before in sqlplus worksheet, it popup a dialog for input, but it doesn't anymore.
    Any ideas about this issue? Or what setting could affect the behavior? Thanks in advance.

    It would work only if you put these set of statements in a .SQL file and run that file at SQL*Plus prompt:
    SQL> @the_sql_script_created_above.SQL

  • SQLPlus problem - user enters quote in substitution variable

    Hello,
    I have a SQL Plus script report, where user is prompted to enter "customer name".
    Some customer names contain single quotes/apostrophes.
    When user type such name, the script will error out with
    ORA-01756: quoted string not properly terminated
    I can't ask users to use '' instead of ' . I can't control what they enter. Is there a way to process single quote so the statement below will work:
    select * from sometable where customer_name = '&1'
    where &1 = Smith's
    I can't do replace, etc, because it's all error out with the same error. I need to replace ' on SQLPlus level somehow. One logical way to do it would be to redefine the string separation charachter somehow...
    SQL*Plus: Release 8.0.6.0.0
    Thanks,
    Vlad
    Message was edited by:
    user454392

    As it's a SQL*Plus substitution variable it is literally copied into the code just prior to compilation, so you can't stop it from breaking the compilation of the code. q quoted strings are the only solution I can think of but of course they are only available from 10g onwards.
    The other alternative is to capture the input in a shell/batch script which validates it first and then passes the value to the SQL to be executed.

  • Problem in taking correct Substitution variable in MDX Formula

    Hi,
    We have MDX Formula which takes Substitution Variable as input . Previously we used Hyperion Essbase 9.3.1.3 version and working fine currently we upgraded to 11.1.1.3 version After Upgrade this formula is not taking correct updated value. Its taking previously updated value . To Take the Correct value we are bouncing the Essbase Services then only new Formula is picking the latest Updated value. This is happening only for one formula and rest everything is working fine. Can you please tell us is there any bug or where is the problem is ?
    Thanks,
    Naresh.

    The Database Administrator's Guide and the Essbase Technical Reference are available through the documentation portal:
    http://download.oracle.com/docs/cd/E17236_01/nav/portal_3.htm
    Both the Database Administrator's Guide and the Technical Reference are searchable on an exact phrase, to find the source of the extract John provided.
    http://download.oracle.com/docs/cd/E17236_01/epm.1112/esb_dbag/dotcreat.html#dotcreat1053369
    See section "Setting Substition Variables".

  • Problems starting iSQL PLUS service on Windows XP

    Dear Forum,
    I installed oracle 10g for the first time on Win XP. The Installtion-Process was fine. Now I'm not able to iSQL Plus, beacause the iSQL service in the administration area does not start properly. The status always says that it is starting unfortunately with no success.
    Need help!
    Thanks in advance
    sportmeier

    hi
    i was wondering if and how you solved this error
    i have the same problem now
    thanks

  • ISQL*Plus problem..

    I am a newbie of Oracle, just installed Oracle in my own PC as well as iSQLPlus servies started.
    I have no problem in entering http://MYIP:5560/isqlplus, I failed to login by using sys account.
    It return an error 'ERROR - ORA-28009: connection to sys should be as sysdba or sysoper'
    I entered:
    username: sys
    password: [password for sys]
    Connect Identifier: eepmf (name of my DB)
    I have ever tried to leave Connection Identifier empty. But the problem persist.
    Did I miss the Oracle Net Connection string? (According to my study guide, but I am not sure what is it)... Could someone help me? Thank you so much

    I am trying to do the following but cannot proceed in step 2...
    To set up the iSQL*Plus DBA URL
    1) Create users for the iSQL*Plus DBA URL - I have created a new user named 'stanley'.
    2) Grant the webDba role to users. - When I tried to add the role to this user, I cannot find 'WebDBA', I just found a role named DBA but not WebDBA - are they the same or I missed some steps?
    3) Restart the iSQL*Plus server after making any changes to the JAZN authentication file, jazn-data.xml. The JAZN authentication file is changed when you use the JAZN admin tool to set up users for the iSQL*Plus DBA URL.

  • ISQL*Plus startup problem

    Having reviewed the recent thread on this subject but still unable to get iSQL*Plus - I need some help. Here are the details:
    Environment: Windows XP, Oracle 10g PE
    Started iSQL*Plus in CMD window with command: isqlplusctl start - and got message iSQL*Plus started
    Now I go to IE and try the URL for iSQL*Plus I got when I installed: http://192.168.1.100:5560/isqlplus - and get the message: The page can not be displayed.
    What am I doing wrong?
    Any help is appreciated - as I am new to Oracle...
    kavindra

    Kavindra
    i have installed oracle 9i release 1 on windows 2000 pro but iSQL Plus not working.
    I checked on installed products and it is there and also find isqlplus.conf file.
    what are the requirements of iSQL Plus and how can we chech them?
    I have not find 'isqlplus.ini' where it should be?
    isqlplusctl start is also not working.
    how can we check http server availability?
    I tried http://localhost but IIS is opening.
    Tried http://localhost:7776/isqlplus - getting same message: The page can not be displayed.
    Hope you can help on this issue as you solved your problem.

  • Problem with ISQL Plus

    Hi All,'
    here i am facing one problem with ISQL plus
    i am connecting ISQL plus from Oracle Enterprise manager(OEM) while connecting it throws an error
    "connection was refused when attempting to contact <servername>:5560"
    Please help me out

    After the port you are reporting on your thread, 5560, it looks like you are using a 10g release, however it is advisable to specify both, the os and db version at the start of your thread, isqlplus has had several architectural changes throughout the different oracle versions since it first appeared at 9iR1 going through 10gR2. There have been people who are even surprised to find out it is no longer installed with 11g and unnecessarily find a hard time trying to set it up.
    ~ Madrid

Maybe you are looking for