Меню

Состояние sql s1000 код ошибки 1000 ничего не выделено

Автор Dan, 24 февраля 2020, 19:47

0 Пользователи и 1 гость просматривают эту тему.

Всем добрый день!
Сразу же — я новичок, так что сильно не ругайте.
Изучаю SQL по книге Бена Форта Освой SQL за 10минут. К книге предлагается скачать тренировочную базу данных. Скачал для OpenOfficeBase. Пишу простейший запрос /*jhgkjhg*/. В ответ сообщение об ошибке
Состояние SQL: HY000
Код ошибки: 1000
Syntax error in SQL expression
и
Состояние SQL: HY000
Код ошибки: 1000
syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE
Такие сообщения об ошибках выскакивают очень часто. Регистр в названиях использую правильно. Пробовал указывать имена и с кавычками и без — ничего не помогает. Один запрос из примеров книги обрабатывает, другой — ошибка. Установил AccessDatabaseEngine.exe (как рекомендовано в https://forumooo.ru/index.php?topic=3620.0) — не помогло.
Что за ошибка, как исправить?



Нужно в панели инструментов конструктора запросов нажать на кнопку с надписью SQL (или на самую, правую, если это значки без надписей). Она отключит парсер-коверкатель SQL-запросов и все будет работать нормально.

Делать это надо в каждом запросе, создавамом с нуля. При этом все равно небольшая часть запросов «из книжек» — не заработает. Например те, которые используют интерактивный ввод параметров. Тогда нужно кнопку наоборот, отжать. И опять все заработает.

Руб. за сто, что Питоньяк
Любит водку и коньяк!
Потому что мне, без оных, —
Не понять его никак…


I have a problem trying to execute more than one query into my Java Application code.
I have a procedure that is called in main and is in the class «Fant»:

    public void XXX(){
     Connectivity con=new Connectivity(); // this class set up the data for the connection to db; if ( !con.connect() ) {
                    System.out.println("Error during connection.");
                    System.out.println( con.getError() );
                    System.exit(0);
                }
        ArrayList<User> blabla=new ArrayList<User>();
        blabla=this.getAllUsers(con);
        for (User u:blabla)
         {
           try {
                Connectivity coni=new Connectivity();//start a new connection each time that i perform a query
                Statement t;
                t = coni.getDb().createStatement();

               String query = "Select count(*) as rowcount from berebe.baraba";
               ResultSet rs = t.executeQuery(query);
               int numPrenotazioni=rs.getInt("rowcount");
                rs.close();                           //close  resultset
                t.close();                            //close statement
                coni.getDb().close();                  //close connection
                }
          }
            catch (SQLException e)
                 {

                  System.err.println("SQLState: " +
                  ((SQLException)e).getSQLState());
                  System.err.println("Error Code: " +
                  ((SQLException)e).getErrorCode());
                }
         }
            }

The called function is defined as:

ArrayList<User> getAllUsers(Connectivity con) {
 try{
            ArrayList<User> userArrayList=new ArrayList<User>();
            String query = "Select idUser,bubu,lala,sisi,gogo,gg  from berebe.sasasa";
            Statement t;
            t = con.getDb().createStatement();
            ResultSet rs = t.executeQuery(query);

            while (rs.next())
            {
                User utente=new User(....); //user fields got from query
                userArrayList.add(utente);
            }
              rs.close();
              t.close();
              con.disconnect(); //disconnect the connection
              return userArrayList;
            } catch (SQLException e) {

        }
        return null;

    }

The main is:

 public static void main(String[] argv) {
    ArrayList<User> users=new ArrayList<User>();
    System.out.println("-------- MySQL JDBC Connection Testing ------------");
    Fant style = new Fant();
    style.XXX();

}

The query performed into «getAllusers» is executed and into the arraylist «blabla» there are several users; the problem is that the second query that needs the count is never executed.
The MYSQlState given when running is= «S1000» and the SQLERROR is «0».
Probably i’m mistaking on connections issues but i’m not familiar with statements,connections,resultsets.
Thank you.

I am trying to execute the below BCP query in my TEST Server, where BCP has a connection string to the production DB, so my destination folder is in my Test Server and I am getting an error, I think it’s a permission related issue.

DECLARE @str NVARCHAR(2000), @path NVARCHAR(200)='Z:SQL' , @TableName NVARCHAR(100)='tblUsers' Set @str = 'BCP IDB.dbo.'+@TableName+ ' OUT '+@path +''+@TableName+'.csv -c -t^| -T -S ProductionServerNameSQL2012' Exec xp_cmdshell @str

Print (@str) = BCP IDB.dbo.tblUsers OUT Z:SQLtblUsers.csv -c -t^| -T -S ProductionServerNameSQL2012

ERROR: output SQLState = S1000, NativeError = 0 Error =
[Microsoft][SQL Server Native Client 10.0]Unable to open BCP host
data-file NULL

I shared my Test Server folder to the Production User account. Also I have mapped the shared folder drive as a network share in production and run the below SQL statements:

EXEC XP_CMDSHELL 'net use Z: \TestServevrNameTest'

EXEC XP_CMDSHELL 'Dir Z:'

Still I am facing the same Issue.

Please guide me what steps are required to fix this permissions issue.

Hi all,

I have an Windows XP OS with SP3.
I have installed the Oracle 11g server.

On trying to connect to the ODBC connection, i get the following error message:

Unable to connect SQL State=S1000 [Oracle][ODBC][Ora]ORA-12170: TNS: Connect timeout occured

On trying the tnsping,

TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 — Production on 09-OCT-2
011 13:11:05

Copyright (c) 1997, 2007, Oracle. All rights reserved.

Used parameter files:
E:appGautamproduct11.1.0db_1networkadminsqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.
5.207)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl))
)
TNS-12535: TNS:operation timed out

On trying to connect with SQL Developer, i get the following error:

Status: Failure — Test failed: Io Exception: The Network Adapter could not establish the connection

However i am able to connect to the same using SQL Plus

Another issue that occurs is that the Oracle Enterprise Manager shows the following error after a while:

Agent Connection to Instance

Status Failed

Details ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)

The following services are all up during this point of time:

OracleDBConsoleorcl
OracleOraDb11g_home1TNSListener
OracleServiceORCL

Any help in this regard will be very useful as this is hindering the progress of my work.

Thanks in advance for the help.

— Gautam

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Сочинение егэ про ошибки человека
  • Состояние sql s0022 код ошибки 28