Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 178329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:12:44+00:00 2026-05-11T14:12:44+00:00

I’m having an embedded device which keeps a list of inner tables. I would

  • 0

I’m having an embedded device which keeps a list of inner tables. I would like it to synchronize this table’s state with some outside database for debugging purposes. That is whenever I add an element to a certain struct array I wish the device to issue an ‘INSERT INTO …’ command.

However I’m sending the data over an RS232 serial cable, which makes the overhead of sending explicit SQL unacceptable.

Since there are only 3 types of SQL commands I use a lot, I can only serialize these few. Namely INSERT INTO,DELETE FROM, and UPDATE.

The general idea I had in mind is to send data with a ‘compressed/serializable’ SQL protocol. We won’t send commands directly to SQL server but to a custom serialized-SQL server I’ll write:

  1. We’ll assign a number to each database-changing simple action (ie INSERT, DELETE, UPDATE). The only available serializable-SQL commands are INSERT INTO x (), DELETE FROM x WHERE id=y. Where we can only change x and y.
  2. At first create all necessary tables on the server once. Keep a hash table on the server that maps each table to a number. This can be done in plain SQL as this is only done once.
  3. Then assign a number to each table, make sure the server knows about this number
  4. Finally whenever we wish to execute an SQL command, we’ll send command number, followed by table number, followed by data length followed by data. The server would figure out the layout of the actual data by table’s description.

For example

INSERT INTO temperature(temperature,location)      VALUES ((108,'chille'),(120,'usa')) 

Would be translated to

[INSERT INTO id][2 data to send]     [byte of 108][6 bytes string 'chille']     [byte of 120][3 bytes 'usa'] 

and

DELETE FROM people (id,'bob') WHERE id=1 or id=2 

Would be translated to

[DELETE id][2 data to send][byte of 1][byte 2] 

Since id is defined as a single byte integer.

Is there any known protocol/implementation in this spirit?

Does anyone have a better idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:12:45+00:00Added an answer on May 11, 2026 at 2:12 pm

    Most DBMS do this with prepared statements. You prepare a statement, such as an insert, and then execute it with just the relevant parameters. The server (or client) gives the prepared statement some sort of ID (typically, an integer, sometimes a string), and the client-side library can re-execute it on demand.

    Some of your ideas will need refinement – the OR in the DELETE is not obvious, in particular. Also, you’d need to define whether your ‘N data to send’ identifies a number of rows or a number of values, and if a number of rows, how do you identify how many values in the row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.