Actually, you can seed the table. Normally, when inserting a row with an identity column, you specify the identity value as 0 and the next highest value will be automatically assigned and inserted. However, you can specify a non-zero value during the insert and it will be used (as long as it...
The 24-byte data record probably contains the block number, part number, and links information, but how that's exactly stored I can't really say. They could be two 8-byte unsigned integers followed by a 2-byte unsigned integer, all combined to make up the 18-byte key. I don't see anything...
If you're using Pervasive.SQL 9.5, you can use the new scalar function DATEDIFF. Check out the scalar function docs in the SQL Engine Reference at http://www.pervasive.com/library/docs/psql/950/sqlref/sqlref-06-4.html
DATEADD, DATENAME, and DATEPART are also new, as well as a new datatype...
Do you have security enabled on your database?
Is your client connecting to the server database or a local database? Use the PSQL monitor on the server to verify the client user is connected to the right database on the server.
Linda
Pervasive Software
Yes - the Btrieve API accesses the data file directly and works at a record level. Read a record, insert/update/delete records, etc. You still need to understand the schema so that you know how the record is constructed, but it's built into the application instead of external DDF files.
The...
A little more info...
There are many different access methods for manipulating data in a Pervasive.SQL environment. Most access methods require schema definitions, which are stored in the DDFs. However, the most basic access method called "Btrieve access" or "transactional access" does not...
You don't want to use Inner Join like that. You want to do something like:
UPDATE "TEST1" SET "TEST1"."DESCRIPTION" =
(SELECT "TEST2"."DESCRIPTION" FROM "TEST2"
WHERE "TEST2"."PARTNUM" = "TEST12"."PARTNUM")
Linda
Pervasive Software
...because you have the QuoteID column specified in both places. So, it won't need to create a temp table.
In your read-only example: SELECT * FROM Details WHERE (QuoteID =" & pQuoteID & ") ORDER BY Line
the engine was using the index on QuoteID+Line and using it to optimize the restriction...
The engine will optimize on either the Order By or the restrictions in the WHERE clause on a single table query like your examples. The choice depends on various factors the engine uses to decide which index will be more optimal for producing the result set. Using an index matching the Order...
If the engine builds a temp table to accomplish the ordering, the result set would be read-only. If it uses an existing index, it will be editable.
Linda
Pervasive Software
I'm guessing you might have a record with a blank SHIP_METHOD_ID that's joining with other blanks, and it's returning one row for each instance of such a join. You can do SELECT DISTINCT "OePo_Item.ITEM_ID from ...
That will get rid of all duplicates.
Linda
Pervasive Software
What kind of application are you using to generate this report? Are you developing a custom application or using some kind of SQL tool?
Linda
Pervasive Software
In your example, are n and r fields in the table?
You can't update within a select list, you can only construct an expression to return to the application issuing the select.
Sounds like maybe you need to work in the context of a stored procedure where you can loop and select records one at...
There is an IF-THEN-ELSE scalar funciton. Try something like:
SELECT IF(SUBSTR(COC,1,1) = 'N', 'Is N', 'Is Not N') as nr FROM tbl
...
Linda
Pervasive Software
Strange... What version of Pervasive are you using? I tried it via PCC on some little sample tables I made in v9.1 and it worked fine. When you tried it, did you get an error or incorrect results?
Linda
Pervasive Software
Try something like:
Select IF(UCASE(LEFT(COMCDE, 1)) IN ('A', 'B', 'C'), 'FG', 'RM') as cc, sum(QTY)
from TableName
group by cc
Linda
Pervasive Software
Just to close this out, I believe the following self-join will work:
SELECT * FROM ProductStructure PS1
WHERE PS1.EffectiveDate =
(SELECT MAX(PS2.EffectiveDate) from ProductStructure PS2
WHERE PS2.parent = PS1.parent
AND PS2.component = PS1.component)
Linda
Pervasive Software
...a UNION then the view must be the only item in the FROM clause, no other views or base tables and no joins). Examples:
create view v1 as select * from person
select * from v1 union select * from v1
create view v2 (vid, vsum) as select id, sum(id)
from person group by id
select...
What interface are you using in VB6? ADO/OLEDB? ActiveX? Btrieve API? The answer really depends on which one you're using.
Linda
Pervasive Software Support
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.