1. Gaurav Joshi
  2. Valentina Database ADK
  3. Thursday, December 29 2022, 07:25 AM
  4.  Subscribe via email
Hello Everyone,
I am new to using Valentina DB and Xojo.
I would like to know how to create a simple query for the following :
"SELECT * FROM partlist ORDER BY ID DESC LIMIT 1";

What is the format of Valentina DB ADK to be used in Xojo for the above.

Similarly, I would like to know the format for
"INSERT INTO partlist (ID,CUSTOMER,PARTNUMBER,PARTNAME,PARTSTATUS) VALUES(:1, :2, :3, :4, :5)
where 1, 2, 3, 4, 5 are placeholders for string variables.

Till date I have used MYSQL for this work and used MBS plugins for the same.

But now I want to use Valentina DB & need support for the same. Couldn't get this data from the documentation easily.

Hence put it here on the forum.

Regards,
Gaurav
Comment
There are no comments made yet.
Ruslan Zasukhin Accepted Answer
Hi Gaurav,

Please notice that the V4RB installer has installed the folder "Paradigma Software/V4RB" to your computer.
It contains folder Examples, and there presents the SQL folder with examples related to SQL-way.

Below you can find a few WIKI links on
- entry page about V4RB docs. Here you can find descriptions of Examples and Tutorial examples also.
- Some Videos about V4RB which should help to Get Started
- API Reference, also for V4RB exists a PDF docs.
- Valentina SQL Reference

Please notice that V4RB allows development as SQL-oriented design, so kind of non-SQL, which we named Valentina API.
In the Example folder: they present in folders SQL_way and API_way.
'Common' examples are suitable for both ways.


PS. about SQL binding see Examples/SQL/Bind
References
  1. https://valentina-db.com/docs/dokuwiki/v12/doku.php?id=valentina:products:adk:v4rb:v4rb
  2. https://valentina-db.com/docs/dokuwiki/v12/doku.php?id=valentina:video:v4rb:v4rb
  3. https://valentina-db.com/docs/dokuwiki/v12/doku.php?id=valentina:products:adk:api:api
  4. https://valentina-db.com/docs/dokuwiki/v12/doku.php?id=valentina:vcomponents:vsql:reference:reference
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Gaurav Joshi Accepted Answer
Thanks Ruslan for the updates. I shall follow your advice & get back in the event of any queries.

Furthermore, can you please guide me as to how to do AutoIncrement ID fields in Valentina DB using the Valentina Studio.

In MYSQL, I have always created tables using the mysql queries, but here in Valentina Studio, I have created using the GUI & in the GUI I didnt happen to find any option to set ID to Auto Increment.

Regards,
Gaurav
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Ruslan Zasukhin Accepted Answer
Hi Gaurav,

Well, exists 3 ways in Valentina about this.
Please check the wiki page below about RecID field in Valentina DB and alternatives if you think RecID will not ok for your task.

BTW, RecID is tied with the ObjectPtr field. Entry point about the special unique feature of Valentina DB "Links" you can read here:
http://valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vkernel:vlink:vlink

If you will want a kind of auto-increment, I think the most correct feature is to use sequences (as in Postgre) or fields Serial32 / Serial64.
References
  1. https://valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vkernel:vfield:recid
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
Gaurav Joshi Accepted Answer
Thanks for the input.
So like the Serial64 automatically increments or do we need to write a method or something for it.
Can we constraint it as the Primary Key
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 4
Ruslan Zasukhin Accepted Answer
Hi Gaurav,

A NOT NULL constraint is applied to ensure that a null value cannot be inserted. (In most cases you would also want to attach a UNIQUE or PRIMARY KEY constraint to prevent duplicate values from being inserted by accident, but this is not automatic).

To create Foreign Key pointing to a SERIAL32 field, you should use the LONG type. For SERIAL64, use the LLONG type.
References
  1. https://valentina-db.com/docs/dokuwiki/v12/doku.php?id=valentina:vcomponents:vkernel:vfield:serial_types
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories