Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Linda84

    Can I use Pervasive to give me incrementng serial numbers?

    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...
  2. Linda84

    Issues creating DDF files for a btrieve 6.15 dat

    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...
  3. Linda84

    Comparing Date and Strings

    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...
  4. Linda84

    Cannot see newly created table on client

    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
  5. Linda84

    Database (or tables) missing from Pervasive Control Center

    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...
  6. Linda84

    Database (or tables) missing from Pervasive Control Center

    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...
  7. Linda84

    Currency not on a record -1603

    You're welcome - but don't cut and paste, there's a typo in my WHERE clause. It should be TEST1 not TEST12 after the =. Linda Pervasive Software
  8. Linda84

    Currency not on a record -1603

    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
  9. Linda84

    PSQL 9.1 Problem

    ...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...
  10. Linda84

    PSQL 9.1 Problem

    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...
  11. Linda84

    PSQL 9.1 Problem

    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
  12. Linda84

    Remove repition of records

    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
  13. Linda84

    Check for string and count

    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
  14. Linda84

    Check for string and count

    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...
  15. Linda84

    Check for string and count

    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
  16. Linda84

    Query Advice

    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
  17. Linda84

    Query Advice

    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
  18. Linda84

    Using LAST in PSQL

    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
  19. Linda84

    Trouble Creating a view

    ...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...
  20. Linda84

    Using Seek to find a range

    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

Part and Inventory Search

Back
Top