:: Visual Foxpro, Foxpro for DOS
Re: VFP 9 beta доступна для скачивания.
piva

Сообщений: 18655
Откуда: Курган
Дата регистрации: 24.03.2004
Для любителей работать с другиги кодировками

CREATE TABLE Sales CODEPAGE=1251 (OrderID I, CustID I, OrderAmt Y(4))
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
Пока только так www.hot.ee, а вот с таблицей что-то не хочет.
А вот где он хранит MRU? для такого случая?



[i][small][color=Gray]Отредактировано (04.06.04 12:04)


------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
WiRuc

Сообщений: 1012
Дата регистрации: 09.04.2002
Привет, сообщество!
Вы только гляньте, что они с SQL сделали T-SQL практически отдыхает
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
piva

Сообщений: 18655
Откуда: Курган
Дата регистрации: 24.03.2004
Блин все равно AutoComplete не работает. Может только под XP а то у меня win2ksp4

Поробовал - точно только на XP работает



[i][small][color=Gray]Отредактировано (04.06.04 12:24)


------------------
Часто бывает так, что есть над чем задуматься, а нечем.
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
Вечером попробую, а сейчас увы со временем туговато. Во время обеда погоняю.Надо разбираться с чужой программой на Sybase. (Дешевый, кстати сервер - как выяснилось)




------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
Ага, нужно просто указать таблицу и поле в которую все это будет писаться. Таблица формируется автоматически
и далее все что вводится заносится в эту таблицу. Причем таблица явно не открыта и фокс с ней работает как то
по другому.

Structure for table: C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\MY DOCUMENTS\VISUAL FOXPRO PROJECTS\AUTO.DBF
Number of data records: 7
Date of last update: 06/04/04
Memo file block size: 64
Code Page: 1251
Field Field Name Type Width Dec Index Collate Nulls Next Step
1 SOURCE Character 20 No
2 DATA Character 254 No
3 COUNT Integer 4 No
4 WEIGHT Integer 4 No
5 CREATED DateTime 8 No
6 UPDATED DateTime 8 No
7 USER Memo 4 No
** Total ** 303




------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
Андрей Давыдов
Автор

Сообщений: 1411
Дата регистрации: 08.02.2003
2 piva

Цитата:
Блин все равно AutoComplete не работает. Может только под XP а то у меня win2ksp4

Win2k3 AutoComplite без AutoCompTable работает.

http://alansoft.hotbox.ru/AutoComp.jpg




------------------
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
po2

Сообщений: 2864
Откуда: Иркутск
Дата регистрации: 22.12.2001
М.б. зависит от системной установки Автозаполнение.
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
Vladimir_Knyr

Сообщений: 1711
Откуда: г. Енисейск
Дата регистрации: 15.12.2003
Я может только завра к вечеру попробую - пока только 30% залил.




------------------
хороший код работать будет и обязан, а плохой не жалко.
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
piva

Сообщений: 18655
Откуда: Курган
Дата регистрации: 24.03.2004
Столкнуля с объектом которого пока нет в хелпе

o=CREATEOBJECT("ReportListener")

а вот как его к report'у прикрутить пока не понял
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
Надо запустить файл vfp9Relnotes, далее выбрать VFP9 Beta Release Notes.htm и там перейти по ссылке

VFP 9 Reporting System
Object-Assisted Mode




------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
Тест вставки картинки в форум, прошу извинить, а то все гружу на свой сайт
www.hot.ee




------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
2Андрей Давыдов. А как вставить картинку сюда? Что-то не получилось...




------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
WiRuc

Сообщений: 1012
Дата регистрации: 09.04.2002
А что тут понимать
Сделали как в .NET, там то же есть Listener, которые определяют как будет производится вывод. Т.е. именно в Listenere ты можешь в Runtime определить как будет выглядеть твой отчет.
Делай вот так:

Создаешь класс customlistener На базе ReportListener
Переопределяешь метод EvaluateContents, допустим так

oObjProperties.penRed = 255
oObjProperties.Reload = .T.

Вызываешь отчет
oListener = createobject("customlistener")
report form c:\temp\temp.frx preview object oListener

Ну и конечно, там еще много всяких вкусностей Например, есть ссылка на объект GDI+, который занимается выводом отчета. В принципе это дает возможность глубоко вмешаться в работу ядра репорта по выводу отчета.
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
NSF
Hi All...
Киньте сюда кто-нибудь выдержку из HELPa (как это сделал JS) по поводу SELECT SQL (WiRuc заинтриговал) ... + INSERT SQL поддерживает теперь внутренний подзапрос?
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
Андрей Давыдов
Автор

Сообщений: 1411
Дата регистрации: 08.02.2003
2 JS писал(а):
Цитата:
2Андрей Давыдов. А как вставить картинку сюда? Что-то не получилось...

(img)ссылка до картинки (/img) - в квадратных скобках




------------------
Ratings: 0 negative/0 positive
VarChar
Владимир Максимов

Сообщений: 14097
Откуда: Москва
Дата регистрации: 02.09.2000
Если интересно, оказывается VarChar хранится также, как и CHAR, т.е. физически занимает столько байт, сколько указано в его размерности + один скрытый байт, содержащий реально заполненное количество символов.

Т.е. без серъезных оснований использовать VarChar - не нужно. Выигрыша в объеме таблицы - не получишь. Скорее проигрыш на дополнительный служебный байт.




------------------
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
Retrieves data from one or more tables. When you use SQL SELECT to create a query, Visual FoxPro parses the query and retrieves the specified data from the tables. You can create a SQL SELECT query from the Command window, in a Visual FoxPro program, or using the Query Designer.

The full syntax for the SQL SELECT command appears as follows:

SELECT [ALL | DISTINCT] [TOP nExpr [PERCENT]] Select_List_Item [, ...]
FROM [FORCE] Table_List_Item [, ...]
[[JoinType] JOIN DatabaseName!]Table[[AS] Local_Alias]
[ON JoinCondition [AND | OR [JoinCondition | FilterCondition] ...]
[WITH (BUFFERING = lExpr)]
[WHERE JoinCondition | FilterCondition [AND | OR JoinCondition | FilterCondition] ...]
[GROUP BY Column_List_Item [, ...]] [HAVING FilterCondition [AND | OR ...]]
[UNION [ALL] SELECTCommand]
[ORDER BY Order_Item [ASC | DESC] [, ...]]
[INTO StorageDestination | TO DisplayDestination]
[PREFERENCE PreferenceName] [NOCONSOLE] [PLAIN] [NOWAIT]


Remarks
The following code shows a summary of the main clauses:

Copy Code
SELECT Select_List
FROM Table_List
[WITH (BUFFERING = lExpr)]
[WHERE Conditions]
[GROUP BY Column_List]
[UNION Clause]
[HAVING Conditions]
[ORDER BY Column_List]
[INTO Clause | TO Clause ]
[Additional_Display_Options]


The following sections describe the detailed syntax and parameters for each clause of the SQL SELECT command:

SELECT - SQL Command - SELECT Clause
SELECT - SQL Command - FROM Clause
SELECT - SQL Command - WITH Clause
SELECT - SQL Command - WHERE Clause
SELECT - SQL Command - GROUP BY Clause
SELECT - SQL Command - HAVING Clause
SELECT - SQL Command - UNION Clause
SELECT - SQL Command - ORDER BY Clause
SELECT - SQL Command - INTO or TO Clause
SELECT - SQL Command - Additional Display Options
When you issue SET TALK ON and SET NOTIFY ON before executing SELECT, Visual FoxPro displays the length of time the query took to execute and the number of records in the results. _TALLY contains the number of records in the query results. For more information, see SET TALK Command, SET NOTIFY Command, and _TALLY System Variable.

Note:
The length of time might not display if the query execution time is very short.


SELECT does not respect the current filter condition specified with SET FILTER. For more information, see SET FILTER Command.

Examples
The following code examples show many ways of retrieving data with the SQL SELECT command and use the sample TestData.dbc database included in Visual FoxPro.

Example 1
The following example displays data from field in a table using the FROM clause. The example displays all the company names in the Company field from the Customer table:

Copy Code
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\TestData')
SELECT customer.company ;
FROM customer


Example 2
The following example displays all records from a query in a specified column using the AS Column_Name clause. The example displays all names in the City field from the Customer table in uppercase using the UPPER( ) function and in column called CityList.

Copy Code
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\TestData')
SELECT UPPER(city) AS CityList FROM customer


Example 3
The following example displays unique data from a query using the DISTINCT option with a join condition in the WHERE clause. The example displays the Company, Order_Date, and Shipped_On fields for only those records with unique data in the Customer and Orders tables. The SELECT statement specifies local aliases for the tables to distinguish the same field name, Cust_ID, in both tables.

Copy Code
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\TestData')
SELECT DISTINCT TAlias1.company, TAlias2.order_date, ;
TAlias2.shipped_on ;
FROM customer TAlias1, orders TAlias2 ;
WHERE TAlias1.cust_id = TAlias2.cust_id


Example 4
The following example displays three fields from two tables, but only those records meeting join and filter conditions in the WHERE clause. The example joins the Customer and Orders table on the Cust_ID field and displays the Company, Order_Date, and Shipped_On fields for only those records that have an order date earlier than 02/16/1994. The SELECT statement specifies local aliases for the tables to distinguish the same field name, Cust_ID, in both tables.

Copy Code
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\TestData')
SELECT TAlias1.company, TAlias2.order_date, TAlias2.shipped_on ;
FROM customer TAlias1, orders TAlias2 ;
WHERE TAlias1.cust_id = TAlias2.cust_id ;
AND TAlias2.order_date < {^1994-02-16}


Example 5
The following example organizes results of a query using the ORDER BY Order_Item clause. The example displays the Country, PostalCode, and Company fields for those records in the Customer table in ascending order, by default.

Copy Code
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\TestData')
SELECT country, postalcode, company ;
FROM customer ;
ORDER BY country, postalcode, company


Example 6
The following example stores the contents of a query into a table using INTO TABLE TableName clause. The example stores the contents of the Company, Order_Date, and Shipped_On fields from the Customer and Order tables, which are joined on the Cust_ID field, in a third table called CustShip. The example then opens a Browse window for the new table. The SELECT statement specifies local aliases for the tables to distinguish the same field name, Cust_ID, in both tables.

Copy Code
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\TestData')
SELECT TAlias1.company, TAlias2.order_date, TAlias2.shipped_on ;
FROM customer TAlias1, orders TAlias2 ;
WHERE TAlias1.cust_id = TAlias2.cust_id ;
INTO TABLE custship.dbf
BROWSE




------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
piva

Сообщений: 18655
Откуда: Курган
Дата регистрации: 24.03.2004
Насчет AutoComplete - это я сам перемудрил. Взял какой-то tweakui и влючил инетрфейс win4.0 - система рабоатет веселее а фот фича потерялсаь. Вернул все на место и заработало.
Про Listener - я просто этот экзешник не тянул. Сейчас и почитаю
Ratings: 0 negative/0 positive
Re: VFP 9 beta доступна для скачивания.
JS

Сообщений: 12264
Откуда: Эстония
Дата регистрации: 04.09.2000
INSERT-SQL

Appends a new record to the end of a table that contains the specified field values. The INSERT SQL command has three syntaxes:

Use the first syntax to insert specified values into specified fields in a table.
Use the second syntax to insert the contents of elements from an array, memory variable, or property of an object that match the field names in the table.
Use the third syntax to insert rows from an SQL SELECT command into the specified fields in the table.

INSERT INTO dbf_name [(FieldName1 [, FieldName2, ...])]
VALUES (eExpression1 [, eExpression2, ...])


INSERT INTO dbf_name FROM ARRAY ArrayName | FROM MEMVAR | FROM NAME ObjectName


INSERT INTO dbf_name [(FieldName1 [, FieldName2, ...])]
SELECT SELECTClauses [UNION UnionClause SELECT SELECTClauses ...]


Parameters
INSERT INTO dbf_Name


Specifies the name of the table for appending a new record. dbf_Name can include a path and can be a name expression.
[( FieldName1[, FieldName2[, ...]])]


Specifies the names of the fields in the new record into which the values are inserted.
VALUES (eExpression1[, eExpression2[, ...]])


Specifies the field values to be inserted into the new record. If you omit the field names, you must specify the field values in the order defined by the table structure. If eExpression is a field name, it must include the table alias. If SET NULL is ON, INSERT attempts to insert null values into any fields not specified in the VALUES clause.
FROM Source


Specifies to insert data from an array, memory variable, or Visual FoxPro object. The following list describes valid items for Source:
ARRAY ArrayName ArrayName specifies the array whose data is inserted into the new record. Starting with the first element, the contents of the elements of the array are inserted into the corresponding fields of the record. The contents of the first array element are inserted into the first field of the new record; the contents of the second array element are inserted into the second field, and so on. When you include the FROM ARRAY clause, Visual FoxPro disregards any default values for fields.
MEMVAR MEMVAR specifies that the contents of memory variables are inserted into fields with the same names as the variables. If a variable does not exist with the same name as the field, the field is left empty.
NAME ObjectName ObjectName specifies a valid Visual FoxPro object, whose property names match the field names in the table for which you want to insert a new record containing the object's property values. You can specify any valid Visual FoxPro object, which you would typically create using the SCATTER...NAME command. For more information, see SCATTER Command. If the table has a field that does match an object property, Visual FoxPro disregards the field and leaves it blank as if calling the APPEND BLANK command. If the type of an object's property does not match the field type in the table, Visual FoxPro generates a data type mismatch message.
Note:
Use caution when specifying objects derived from Visual FoxPro classes because many native properties have types that might differ from the fields you are working with and cannot be changed.


If an autoincrementing field exists in the table, you cannot have an object property that matches the autoincrementing field unless you set the SET AUTOINCERROR command to OFF for the data session. Otherwise, Visual FoxPro generates an error. If you use SCATTER...NAME to create the object while SET AUTOINCERROR is set to ON, you can use the REMOVEPROPERTY( ) function to remove any autoincrementing properties to avoid generating an error. For more information, see SET AUTOINCERROR Command and REMOVEPROPERTY( ) Function.
SELECT SELECTClauses[UNION UnionClauseSELECT SELECTClauses...]


Retrieves data from specified fields in a table or cursor, using one or more SQL SELECT statements, for insertion into another table or cursor. However, the SELECT statement cannot contain any non-SQL clauses such as the following: INTO, TO, and PREFERENCE clauses; NOFILTER, READWRITE, NOCONSOLE, PLAIN, and NOWAIT options. To combine additional SQL SELECT statements with the first SQL SELECT statement, use the UNION clause. For syntax of the SQL SELECT command, which contains the UNION clause, see SELECT - SQL Command.
Note:
When you use SQL INSERT with a SELECT statement, make sure that the data you insert is compatible with the data types in the table into which you are inserting. Visual FoxPro attempts to convert the data types in the cursor created by SQL SELECT into the data types in the corresponding table or cursor column into which the data is inserted. If the inserted data is not compatible, precision might be lost, Date data types are converted to Character data types, and so on.


Back to top

Remarks
If the table you specify is open, SQL INSERT appends the new record to the table. If the table is open in a work area other than the current work area, it is not selected after the record is appended; the current work area remains selected.

If the table you specify is not open, Visual FoxPro opens it in a new work area, and the new record is appended to the table. The new work area is not selected; the current work area remains selected.

While the SQL INSERT command is executing, the current work area becomes the area into which the new record is inserted. In other words, when the SQL INSERT command is executed, it is in the context of the table being inserted into regardless of the current work area before the command was issued.

After executing the INSERT command, Visual FoxPro positions the record pointer on the new record.

Visual FoxPro updates the _TALLY system variable with the number of rows inserted. For more information, see _TALLY System Variable.

Back to top

Examples
Example 1

The following example opens the Employee table and adds one record.

Copy Code
USE employee
INSERT INTO employee (emp_no, fname, lname, officeno) ;
VALUES (3022, "John", "Smith", 2101)


Example 2

The following example uses the USE command to open the Customer table in the TestData.dbc database and the SCATTER command to copy the contents of the current record into variables. COPY STRUCTURE copies the table structure to a new table named Cust2.

INSERT inserts a new record into the Cust2 table from memory variables. SELECT retrieves the data from Cust2, and BROWSE displays the new record.

To clean up, the USE command with no table specified closes the table in the current work area, and DELETE removes Cust2.

Copy Code
CLOSE DATABASES
CLEAR
OPEN DATABASE (HOME(2) + 'Data\TestData')
USE Customer
SCATTER MEMVAR
COPY STRUCTURE TO Cust2
INSERT INTO Cust2 FROM MEMVAR
SELECT CUST2
BROWSE
USE
DELETE FILE cust2.dbf


Example 3

The following example inserts data from the OrdersArchive table from a SELECT statement performed on the Orders table.

Copy Code
INSERT INTO OrdersArchive (order_id, order_date, ship_name) ;
SELECT order_id, order_date, ship_date FROM Orders ;
WHERE order_date >= (DATE()-30)


Back to top




------------------
Knowledge is better than ignorance!
Website: juri.foxhelp.eu
Ratings: 0 negative/0 positive


Извините, только зарегистрированные пользователи могут оставлять сообщения в этом форуме.

On-line: 18 (Гостей: 18)

© 2000-2024 Fox Club 
Яндекс.Метрика