SQLCMD T-SQL Problem

I have sql server 2012 installed on my windows 8 (64bit) machine which is running fine. Now when I am trying to use sqlcmd command line tool it is giving me problem. When I run sqlcmd -? it is working as given below
C:\Users\Admin>sqlcmd -?
Microsoft (R) SQL Server Command Line Tool
Version 9.00.1399.06 NT INTEL X86
Copyright (c) Microsoft Corporation.  All rights reserved.
usage: Sqlcmd            [-U login id]          [-P password]
  [-S server]            [-H hostname]          [-E trusted connection]
  [-d use database name] [-l login timeout]     [-t query timeout]
but if I try to run sqlcmd -S server\instance it is showing a dialog box saying
T-SQL execution command line utility has stopped working.
I already executed the command EXEC sp_configure 'xp_cmdshell', 1 as mentioned in many forums but off no use. Please help me what is the problem or what I am doing wrong.

Try to run with reconfigure option
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1;
GO
-- To update the currently configured value for advanced options.
RECONFIGURE;
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1;
GO
-- To update the currently configured value for this feature.
RECONFIGURE;
GO
Try to open the command prompt as administrator
Are you able execute the SQL from SQLCMD mode SSMS?
SSMS->Query->SQLCMD Mode
--Prashanth

Similar Messages

  • Problems with SQLCMD prompt SQL Express 2008

    "When attempting to run this installer (SQLCMD T-SQL execution command line utility), I get the DOS screen but not the 1> command prompt. If I leave the screen alone, the DOD command window closes after about 5 seconds.
    "C:\Program Files\Microsoft SQL Server\90\Tools\binn\SQLCMD" -S "machine-name\SqlExpress""
    nuno vieira
    Hi All
    Can someone help me please?
    ive just got a new machine and not had this problem before, at one point the error which appeared briefly before the command prompt window disappeared said it was the namepipe, so i enabled this, that didnt work so i uninstalled, and reinstalled SQL Server 2005.
    The next error message i received when the command prompt was closing was (in brief)
    HRESULT 0xFFFFFFF Level 16, State 1
    an error occurred whilst establishing a connection to the server
    Sqlcmd: Error: Microsoft Native Client : Login timeout expired.
    I have just updated to sql server 2008 and the same thing happened. I cant paste into the SQLCMD window and I havent got a 1> command prompt.
    I tried to drop down into dos prompt and it wouldn't accept it said "the filename, directory name or volume syntax is incorrect".
    I turned on iis, ive tried everything I can think of, i have come to the conclusion it must be something to do with the version of Windows Vista Home Premium I am running, I haven't had any problems on any other machines XP or Vista.
    Any help would be gratefully accepted.
    Cheers
    sgblank

    You haven't supplied an authentication context for your connection so you can't connect and it times out. Try the following at a command prompt:
    Code SnippetSqlCML -S "machine-name\SQLEXPRESS" -E
    This will log in using Windows Authentication.
    Regards,
    Mike

  • Two SQL problems

    First problem...
    SQL root will not access all databases...
    If I try to access al databases using SQL Administrator the connection is refused even if I use root.
    all databases are accessable va individual username and password..
    Tried changing root password with GUI but makes no difference...
    Second SQL problem...
    10.4.11 server failed all raid volumes so corrupted no rescue was possible on any volume reinstall failed as well...
    Have rebuilt the server using 10.5.6 I will have to manually import the SQL databases from the old server... what do I do ??? I cannot boot the old server so cannot do an SQL export or anything...
    Thanks...

    Hi Jun,
    Can i contribute a little for ur 2nd problem.
    This error is coz, If u are using a filter against a File "data store" u can't test it, only against RDBMS query will be tested at data store level.
    Well, for using that filter and make sure its working, drag and drop the source file in the interface (u can get the filter) and make it to execute on STAGING.
    Thanks,
    Guru

  • Small SQL problem

    Hello,
    I have a small SQL problem...
    I am designing an online bank using servlets for a university project and it allows customers to view their statements. They select which of their account numbers they want to view the statement for and the start and end date of the statement.
    The problem lies with the dates. Here is the SQL:
    SELECT date, details, amount, balance
    FROM HISTORY
    WHERE bankaccnumber=13494925 And date>=1/1/01 And date<=31/1/01;
    All of the books I have looked at show dates in '1/1/01' format but whenever I try it this way I get a 'Data type mismatch in criteria expression' error (the 'date' field in the Database IS a Date type).
    Although, whenever I run the query in Access and prompt the user to enter the start and end date, it works fine.
    I have spoken to a few people and no-one seems to know why it is not working.
    Any ideas???
    Thanks

    If your database is MS Access and you don't expect to switch to something else, then write this:
    SELECT date, details, amount, balance
    FROM HISTORY
    WHERE bankaccnumber=13494925 And [date]>=#1/1/01# And [date]<=#1/31/01#
    Note that you MUST format your dates as MM/DD/YY and not as DD/MM/YY, that's an Access rule, and that you will probably have to "quote" your column name "date", which I think is a reserved word in SQL and hence a bad choice for column name.
    Personally I always use PreparedStatements. That way my SQL would look like this:
    SELECT date, details, amount, balance
    FROM HISTORY
    WHERE bankaccnumber=13494925 And date>=? And date<=?
    and I would use the setDate() method to fill in the parameters. Since this method uses a Date as a parameter, I don't need to fight with date formats, the JDBC driver handles that for me.

  • Sql problem, pivot question?

    Hi guys,
    I have an interesting problem and do not manage to find a sollution.
    I need to create a report, and we call it variance/trending report. let me explain.
    I have a table that holds all employess with their salaries, every month.
    currenly my selects gets all employess with their salaries from current and previous month. and the result looks like:
    Employee_iD| Salary| month
    1          |500   |   C
    2          |100   |   P
    1          |650   |   P
    3          |100   |   p
    3           |180   |   C
    how can I do my select so I can see the result, in different columns, in a manner in which I can compare the salaries between them (from current and previous month):
    Employe_iD| current_month| previous_month | variance
    1        |500                 | 650                 | -150
    2        |                      | 100                 |
    3        |180                 |100                   |80you can see that C, measn current month, and P measn previous month.
    I think I will have data in my select for both, previous and current. If not, I will treat it as zero.
    I gave a simple exemple . My select is a little more complex.
    any help is appreciated.
    Thanks

    May be..
    SQL> WITH tbl AS (SELECT 1 empid,500 sal,'C' mon FROM DUAL UNION ALL
      2               SELECT 2 empid,100 sal,'P' mon FROM DUAL UNION ALL
      3               SELECT 1 empid,650 sal,'P' mon FROM DUAL UNION ALL
      4               SELECT 3 empid,100 sal,'P' mon FROM DUAL UNION ALL
      5               SELECT 3 empid,180 sal,'C' mon FROM DUAL
      6               )
      7  SELECT empid,NVL(MAX(DECODE(mon,'P',sal)),0) previous_sal
      8              ,NVL(MAX(DECODE(mon,'C',sal)),0) current_sal
      9              ,NVL(MAX(DECODE(mon,'P',sal)),0)- NVL(MAX(DECODE(mon,'C',sal)),0)
    10                var
    11  FROM tbl
    12  GROUP BY empid          
    13               ;
         EMPID PREVIOUS_SAL CURRENT_SAL        VAR
             1          650         500        150
             2          100           0        100
             3          100         180        -80

  • PL/SQL problem in portal

    hello all,
    PROBLEM :
    I followed this thread Copying data from one field to another on a form
    but unfortunately..encountered with d following error...
    Any PL/SQL coding is throwing such errors on my portal..
    I have to install any additional tools or configure something..( I done executed the provsyns.sql for myschema)
    Someone please suggest me..
    ERROR :
    Internal error (WWC-00006)
    An unexpected error occurred: ORA-01001: invalid cursor (WWV-16016)
    Error displaying form : ORA-01001: invalid cursor (WWV-16408)
    Error running user PL/SQL code: ORA-01001: invalid cursor (WWV-16403)
    ORA-06550: line 5, column 7:
    PLS-00201: identifier 'P_SESSION.GET_VALUE_AS_VARCHAR2' must be declared
    ORA-06550: line 5, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 8, column 9:
    PLS-00201: identifier 'P_SESSION.GET_VALUE_AS_VARCHAR2' must be declared
    ORA-06550: line 8, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 11, column 1:
    PLS-00201: identifier 'P_SESSION.SET_VALUE' must be declared
    ORA-06550: line 11, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 15, column 1:
    PLS-00201: identifi (WWV-11230)
    Failed to parse as PORTAL_PUBLIC - BEGIN declare
    id varchar2(20);
    name varchar2(20);
    begin
    id := p_session.get_value_as_VARCHAR2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'EMP_ID');
    name := p_session.get_value_as_VARCHAR2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'EMP_NAME');
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'ID',
    p_value => id);
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'NAME',
    p_value => name);
    end; END; (WWV-08300)
    The preference path does not exist: ORACLE.WEBVIEW.PARAMETERS.1668713167 (WWC-51000)
    Many Thanks In Advance :-)

    hi Pappu
    if you have used the same exact code as given in the message you have mentioned, then please correct one variable's name. the reply I gave in that thread has a typo. in suggesting a solution to that question, I had tried it with a different set of variables on my system and in replying back, i mistakenly left one such variable in that thread.
    try it and see if you still get errors.
    AMN
    declare
    v_address1 varchar2(20);
    begin
    v_address1 := p_session.get_value_as_VARCHAR2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_ADDRESS1');
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_LOCATION1',
    p_value => v_address1);
    end;

  • PL/SQL- Problem in creating a partitioned fact table using select as syntax

    Hi All,
    I am trying to create a clone(mdccma.fact_pax_bkng_t) of existing fact table (mdccma.fact_pax_bkng) using dynamic pl/sql. However, pl/sql anonymous block errors out with following error:
    SQL> Connected.
    SQL> SQL> DECLARE
    ERROR at line 1:
    ORA-00911: invalid character
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1608
    ORA-06512: at "SYS.DBMS_SQL", line 33
    ORA-06512: at line 50
    Here is pl/sql block:
    -- CREATING FPB_T
    DECLARE
    v_owner VARCHAR2(32) := 'MDCCMA';
    v_table_original VARCHAR2(32) := 'FACT_PAX_BKNG';
    v_table VARCHAR2(32) := 'FACT_PAX_BKNG_T';
    v_tblspc VARCHAR2(32) := v_owner||'_DATA';
    CURSOR c_parts IS SELECT TABLESPACE_NAME, PARTITION_NAME,HIGH_VALUE, ROW_NUMBER() OVER (ORDER BY PARTITION_NAME) AS ROWNUMBER
    FROM USER_TAB_PARTITIONS
    WHERE TABLE_NAME = v_table_original
    ORDER BY PARTITION_NAME;
    v_cmd CLOB := EMPTY_CLOB();
    v_cmd3 varchar2(300) := 'CREATE TABLE ' ||v_owner||'.'||v_table||' TABLESPACE '||v_tblspc
    ||' NOLOGGING PARTITION BY RANGE'||'(' ||'SNAPSHOT_DTM '||')' ||'(';
    v_part VARCHAR2(32);
    v_tblspc_name VARCHAR2(32);
    v_row number;
    v_value LONG;
    v_tmp varchar2(20000);
    v_cur INTEGER;
    v_ret NUMBER;
    v_sql DBMS_SQL.VARCHAR2S;
    v_upperbound NUMBER;
    BEGIN
    v_cmd := v_cmd3;
    OPEN c_parts;
    FETCH c_parts INTO v_tblspc_name, v_part,v_value, v_row;
    WHILE c_parts%FOUND
    LOOP
    IF (v_row = 1) THEN
    v_tmp := ' PARTITION '||v_part||' VALUES LESS THAN ' ||'('|| v_value||')'||' NOLOGGING TABLESPACE '||v_tblspc_name;
    ELSE
    v_tmp := ', PARTITION '||v_part||' VALUES LESS THAN ' ||'('|| v_value||')'||' NOLOGGING TABLESPACE '||v_tblspc_name;
    END IF;
    v_cmd := v_cmd || v_tmp;
    -- DBMS_OUTPUT.PUT_LINE(v_cmd);
    FETCH c_parts INTO v_tblspc_name, v_part,v_value, v_row;
    END LOOP;
    -- DBMS_OUTPUT.PUT_LINE('Length:'||DBMS_LOB.GETLENGTH(v_cmd));
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2'||';';
    v_upperbound := CEIL(DBMS_LOB.GETLENGTH(v_cmd)/256);
    FOR i IN 1..v_upperbound
    LOOP
    v_sql(i) := DBMS_LOB.SUBSTR(v_cmd
    ,256 -- amount
    ,((i-1)*256)+1 -- offset
    END LOOP;
    v_cur := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(v_cur, v_sql, 1, v_upperbound, FALSE, DBMS_SQL.NATIVE);
    v_ret := DBMS_SQL.EXECUTE(v_cur);
    CLOSE c_parts;
    DBMS_OUTPUT.PUT_LINE(v_cmd);
    -- EXECUTE IMMEDIATE v_cmd ;
    END;
    The above pl/sql creates a DDL for partitioned fact table(new) based on an existing fact table and get executes through CLOB.
    Please look into the issue and let me know any changes or modifications/suggestions that are required to fix the issue. Any help is appreciated.
    Thank You,
    Sudheer

    Think this is your problem:
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2'||';';Remove the SQL terminator ';' ... dynamic SQL doesn't require it, try this instead:
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2';Thanks
    Paul

  • SQL problem

    I've got a problem with a servlet I'm writing. Here's a code snippet:
    if(operation.equals("Lookup details"))
              {     //get customer details
                   String Hnum = req.getParameter("HouseNum");
                   String Pcode = req.getParameter("PostCode");
                  String sql = "SELECT * FROM Customer WHERE house_num = " Hnum " AND postcode = '" Pcode "'";
                  String url = "jdbc:pointbase:server://localhost:9092/projectdb";
                  Connection con;
                  Statement stmt;
                  ResultSet rs;
                   try {
                        Class.forName("com.pointbase.jdbc.jdbcUniversalDriver");
                   catch(ClassNotFoundException ex) {
                        out.println("Failed to find driver");
                   try {
                        con = DriverManager.getConnection(url, "PBPUBLIC", "PBPUBLIC");
                        stmt = con.createStatement();
                        //execute query
                        rs = stmt.executeQuery(sql);
                   catch(SQLException ex) {
                        out.println("SQL Exception");
                        out.println("" + ex);
              }When it comes to actually executing the sql command I get the following error:
    SQL Exception
    java.sql.SQLException: Expected to find "end of SQL command" instead found "POSTCODE" at position 46.
    I can't quite see whats wrong with my SQL string, its probably something simple tho. Any ideas?

    For sure (200%) your request does not contain HouseNum parameter.
    You should check presence of HouseNum parameter for instance like:
    String hnum=req.getParameter("HouseNum");
    if(hnum==null || hnum.trim().length()==0)
       //do something here - for instance put default HouseNum value like:
       hnum="1"
    }

  • Sql Problems, Same Field Names In Multiple Mysql Tables?

    I have a keyword search that searches multiple DB tables for thumbnail images using UNION ALL. I have two pages, results.php, and view.php.  My goal is to able to click a thumbnail image on results.php and be directed to a larger version of that same image on view.php. The problem is each image in all my tables uses the field name "id" so when I click a thumbnail on results.php I get two different images with the same id from different tables.  I tried changing the id's to different names, but when it was time to pass url parameters I can only choose 1 value. (if you can choose more than 1 I don't know how).  So my question is why are my id's from different tables being grouped together, and how can I change this?
    Image Results Page (which works perfect):
    SELECT *
    FROM table1
    WHERE keyword LIKE %colname% OR id  LIKE %colname% 
    UNION ALL
    SELECT *
    FROM table2
    WHERE keyword LIKE %colname% OR id  LIKE %colname% 
    View Image Page (having problems here):
    SELECT *
    FROM table1
    WHERE id = colname
    UNION ALL
    FROM table2
    WHERE id = colname

    Yes, that is going to be a problem - and it's just the beginning of your problems when you do not normalize your data. Your data model is not correct. You should not be storing similar data in 15 tables - it's a really big mistake.
    To solve your current problem you would need to include a table identifier in the query results in the Image results page, and pass that to the view page and then use PHP to dynamically create the SQL with the correct table....ugh!

  • Java.sql problem

    Hi,
    I have a problem with "import java.sql.*".
    When a try to compile i get the error:
    "package java.sql does not exist"
    I've tried everything, classpath, add JAR/Libraries, install CDC tools, looked into hundred forums and can't solve the problem.
    I'm using NetBeans 5.5 with Mobility Pack.
    If anybody have any idea about what can I do, I'll appreciate it a lot.
    Thank You!
    If you need me to be more specific, please let me know

    I just start the application with
    import java.sql
    an then the rest of the applicationIf you want to import all the classes from the java.sql package, the correct import statement is:import java.sql.*;� {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Oracle-PHP PL/SQL Problem

    Dear,
    I have this situation:
    Inside PHP I call this statement:
    $usr_stmt = oci_parse($conn, "begin PKG_USERBEHEER_TEST.user_insert(PKG_USERBEHEER_TEST.user_create_type(:usr_id,:usr_naam,:usr_vnaam,:usr_email,:usr_pass,SYSDATE,NULL),:p_exusr_id); end;");
    binding the variables
    oci_bind_by_name($usr_stmt, ':usr_id', $USR_ID);
    oci_bind_by_name($usr_stmt, ':usr_naam', $USR_NAAM);
    oci_bind_by_name($usr_stmt, ':usr_vnaam', $USR_VNAAM);
    oci_bind_by_name($usr_stmt, ':usr_pass', $USR_PASS);
    oci_bind_by_name($usr_stmt, ':usr_email', $USR_EMAIL);
    oci_bind_by_name($usr_stmt, ':p_exusr_id', $EXEC);
    INSIDE MY PACKAGE:
    FUNCTION user_create_type(usr_id users.usr_id%TYPE, usr_naam users.usr_naam%TYPE, usr_vnaam users.usr_vnaam%TYPE, usr_email users.usr_email%TYPE, usr_pass users.usr_pass%TYPE, usr_start_datum users.usr_pass%TYPE, usr_eind_datum users.usr_eind_datum%TYPE) return user_rec is
    v_rec user_rec;
    Begin
    v_rec.usr_id := usr_id;
    v_rec.usr_naam := usr_naam ;
    v_rec.usr_vnaam:=usr_vnaam;
    v_rec.usr_email:=usr_email;
    v_rec.usr_pass :=usr_pass;
    v_rec.usr_start_datum := usr_start_datum;
    v_rec.usr_eind_datum := usr_eind_datum;
    return v_rec;
    end user_create_type;
    PROCEDURE user_insert(r IN OUT user_rec, p_exusr_id IN users.usr_id%TYPE) IS
    BEGIN
    --check if allowed
    IF(NOT checkallowedactions(p_exusr_id, 117)) THEN
    raise_application_error(-20999, 'User is not allowed executing this action');
    END IF;
    --end check if allowed
    SELECT seq_users.nextval
    INTO r.usr_id
    FROM dual;
    SELECT sysdate
    INTO r.usr_start_datum
    FROM dual;
    INSERT
    INTO users(usr_id, usr_naam, usr_vnaam, usr_email, usr_pass, usr_start_datum)
    VALUES(r.usr_id, r.usr_naam, r.usr_vnaam, r.usr_email, cryptit.encrypt(r.usr_pass), r.usr_start_datum);
    END user_insert;
    When I excecute my statement I get this error:
    Warning: oci_execute() [function.oci-execute]: ORA-06550: line 1, column 39: PLS-00363: expression 'PKG_USERBEHEER_TEST.USER_CREATE_TYPE' cannot be used as an assignment target ORA-06550: line 1, column 7: PL/SQL: Statement ignored in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\add_user.php on line 22
    But I need the out parameter, because I need my generated ID (Sequence) for futher use in my script.
    I'm not able to edit the pl/sql script because an other application is using it.
    Somebody can help me?
    Thx
    Davy

    The call to PKG_USERBEHEER_TEST.user_insert needs to pass a single PL/SQL variable as the first argument so that user_insert can return an update record. The OUT declaration of 'r' in user_insert is throwing the error. To that point, the problem is not due to PHP. You would get the same error in SQL*Plus.
    But, because you can't bind a record in PHP, you need to create a new PL/SQL function that calls PKG_USERBEHEER_TEST.user_create_type putting the returned record into a PL/SQL variable, and then calls user_insert. PHP would call the wrapper PL/SQL function.
    -- cj

  • Report SQL problem

    hi all,
    need some help in oracle report 6i, I have a SQL statement like
    SQL> select p.person_id, p.person_name, p.birth_date,max(cg.effective_start_date) "Last Concession",
    add_months(max(effective_start_date),24) "Next Concession"
    from person p, conc_given cg
    where p.person_id = cg.person_id
    group by p.person_id, p.person_name, p.birth_date
    p.person_id p.person_name p.birth_date Last Concession Next concession
    1234 peter scott 01/06/1967 05/07/00 05/07/02
    1489 smith bratt 09/04/1958 07/10/01 07/10/03
    The p.person_id I am selecting in my SQL statement do have some relationship
    with some other non-clients. Its all in relationship table...and person_id is a foreign key in that table..
    I want the results like as follows:
    p.person_id p.person_name p.birth_date relationship.person_id related person_name Last Concession Next concession
    1234 peter scott 01/06/1967 05/07/00 05/07/02
    1584 anita scott 07/09/01 07/09/03
    1897 david scott NULL NULL
    1489 smith bratt 09/04/1958 07/10/01 07/10/03
    1354 sonia bratt 09/06/1998 09/06/2000
    I can attach the related person_ID and his name with the p.person_id but the problem I am having
    I don't know how the relationship_ID and name can appear in the next line and their conc_dates as well...
    pls help
    Thanks

    Hi,
    Please run this sql statement in the SQL session. This way you will get the line number where the problem is happening.
    The error seems to be because the column in the select is not in the group by clause.
    Thanks,
    Sharmila

  • SQL problem with JSP

    In sql statements with JSP. Heres the deal:
    Access database:
    Tablename: EVENT
    FieldName: event_id
    DataType: Number
    I want to compare the event_id to an integer variable called "var" in a WHERE clause in an SQL statement through a JSP.
    String query = "SELECT * FROM EVENT WHERE EVENT.event_id = 'var' ";
    It says "Data type mismatch in criteria expression."
    Any Suggestions? I thought this should be straight forward! am i missing something?

    if i am reading correctly "var" is an int variable correct? If this is the case then the following will work;
    String query = "SELECT * FROM EVENT WHERE EVENT.event_id = " + Interger.toString(var) ;
    Hope that helps ( and i hope i read your problem correctly)

  • Reports Printing Dupes but not a SQL Problem

    I have a query that is not linked to any other query or group in my Data Model view. I ran the same query in TOAD and the correct results printed, however, when, I put the same query in the Data Model view it prints dupes. I have a repeating frame around the columns so that the entire recordset will print. Has anyone ever seen this before? I do not know what to look at because the SQL is running fine agains the database and there are no links that could cause the data output to have problems. There are multiple frames with separate queries, but they are not above and under this particular group. This group is the only one that is printing dupes. The frames are not overlapping or anything like that.

    Every group can have 3 lines only;
    Length(Detail01:A000001)<=16
    indicate:
    select Length('Detail01:'||'A000001') into d_len_1 from dual;
    d_len_1 must <=16
    Length(Detail02:A0002 A00003)<=22
    indicate:
    select Length('Detail02:'||'A0002'||' '||'A00003') into d_len_2 from dual;
    d_len_2 must <=22
    Length(Detail03:A00004 A00005)<=22
    indicate:
    select Length('Detail03:'||'A00004'||' '||'A00005')<=22 into d_len_3 from dual;
    d_len_3 must <=22
    Every record in this table can be used for one times;

  • Strange SQL problem (order by fieldname@text)

    Hi all,
    I 'm taking a strange problem in Oracle 9i.
    Why does this query work correctly? (look the order by clause)
    SELECT foo1,
    FROM vw_prat_vend1
    WHERE 1=1
    AND (ce_vcod = '30888.03P34')
    AND (TRIM (ce_piva) = '01931450363')
    AND ( ce_dofl IN ('VAR') )
    ORDER BY cd_prat@text
    It seems that Oracle ignores it.
    In the 11g version the same query goes wrong.
    Thank you.

    Indeed, very strange.
    I cannot come up with an explanation
    SQL> Select distinct object_type from user_objects Order by object_type@foofoo desc
    OBJECT_TYPE       
    VIEW              
    TYPE BODY         
    TYPE              
    TRIGGER           
    TABLE             
    SYNONYM           
    SEQUENCE          
    SCHEDULE          
    RULE SET          
    RULE              
    QUEUE             
    PROCEDURE         
    PACKAGE BODY      
    PACKAGE           
    LOB               
    JOB               
    JAVA SOURCE       
    JAVA CLASS        
    INDEX             
    FUNCTION          
    EVALUATION CONTEXT
    DATABASE LINK     
    22 rows selected.
    BANNER                                                                         
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production   
    1 row selected.

Maybe you are looking for