How do i create node directly from my own module with data of my tables I need create a node from one table of my Database of drupal with all rows that it have.

That is, I need to extract data from my table and insert them automatically and make it appear as a node. Everything from my own module (That is, when I turn on my module see my table data were converted to node).

I thought of 2 solutions for this. The first is to create the content type in my drupal site and from my module implement "form_submit". (Can you do this?).
The second (which I am trying to do) is to create my type of content and form from my module. And since I can do the integration and transformation node me on my table.

Does anyone can help me on how I can do this? A code example of how to extract data and insert them into my form and make a submit directly?

thanks
From the information you provided I would handle this the following way:


Create a custom content type via the GUI with all the fields that you need.
Create a custom module and register a path via hook_menu(). I would set 'page callback' =&gt; 'drupal_get_form', 'page arguments' =&gt; array('mymodule_create_content_form') and 'access callback' =&gt; 'mymodule_admin_restriction'. mymodule_admin_restriction would be a function to allow access to user 1 only. mymodule_create_content_form would be a custom form builder function with just a submit button.
In the form submit handler I would then write code to extract data from the database and create new nodes from it. The easiest way to get data out of your database would probably be with db_query().
For programmatically creating nodes you could use either node_save() or drupal_execute(). The first one is a quicker option while the second one more closely mimics normal node creation by invoking additional hooks. You should be able to find a solid amount of information about them on the web (for example here, here and here).


This approach should be fairly good to get started with. Once you get the whole thing working without errors (in your development environment) you could move the code to your module's install file's hook_install() and maybe even programmatically create the new content type there if needed.