Ionic SQLite get error: "Cannot read property 'executeSql' of undefined"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Ionic SQLite get error: "Cannot read property 'executeSql' of undefined"

Sebastien Capdeville
Hello,
I have an error with 'executeSql'  on a SQLite database within a ionic 4
application and I can't find any solution about it, I must do something
wrong and I would like to be helped about it.

*Context:*
My application is a CRM application (*Customer Relationship Management*).

*Database:*
My database is contained in the file : "CRMApp" which is a sqlite file with
only one table : 'client'.

*Problem:*
I'm trying to retrieve ADRESSE$RAISON_SOCIALE column from the table client
with the following service : "testdbservice" and then I would like to show
the data that is retrieved in a list on the page : "accueil.page.html".
And it keeps showing me the error message linked to this mail.

I have attached the app.module.ts for any informations about all the things
that I installed with npm.

I have been searching this for over two weeks now, I hope someone can help
me and sort it out as it is an important project for me.

Have a nice day,

Seb
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Ionic SQLite get error: "Cannot read property 'executeSql' of undefined"

wmertens
Attachments get removed, but this error means that the object you're
calling executeSql on is not defined. Maybe you're not loading some file?

Wout.

On Thu., Jul. 25, 2019, 3:05 p.m. Sebastien Capdeville <
[hidden email]> wrote:

> Hello,
> I have an error with 'executeSql'  on a SQLite database within a ionic 4
> application and I can't find any solution about it, I must do something
> wrong and I would like to be helped about it.
>
> *Context:*
> My application is a CRM application (*Customer Relationship Management*).
>
> *Database:*
> My database is contained in the file : "CRMApp" which is a sqlite file with
> only one table : 'client'.
>
> *Problem:*
> I'm trying to retrieve ADRESSE$RAISON_SOCIALE column from the table client
> with the following service : "testdbservice" and then I would like to show
> the data that is retrieved in a list on the page : "accueil.page.html".
> And it keeps showing me the error message linked to this mail.
>
> I have attached the app.module.ts for any informations about all the things
> that I installed with npm.
>
> I have been searching this for over two weeks now, I hope someone can help
> me and sort it out as it is an important project for me.
>
> Have a nice day,
>
> Seb
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Ionic SQLite get error: "Cannot read property 'executeSql' of undefined"

Stephen Chrzanowski
In reply to this post by Sebastien Capdeville
I don't know a single thing about Ionic other than how to spell it, but
what I do know is that there are two types of SQL calls that do different
things, and depending on the wrapper or interface, you might be looking at
a different command or implementation.

With SQL, one style of execution is is a command, where you go and tell the
database to do something, like, create a table, delete a table, delete a
row, etc.
Another is a Query, in which you expect to get an actual result back.

In Delphi/Pascal, these calls are PROCEDURES versus FUNCTIONS, or in
C/C++/C#, VOID versus INT (As an example)

The command executeSql (to me) sounds like the Command/Procedure where you
aren't looking for a result.  In my SQL wrapper, I have a procedure to call
that commands SQL to do something (ExecSQL) and another to return rows
(GetTable).  I cannot assign a variable with ExecSQL.

In this example ( https://ionicframework.com/docs/native/sqlite ) I see
that their example shows that of being a Procedure.

On Thu, Jul 25, 2019 at 9:05 AM Sebastien Capdeville <
[hidden email]> wrote:

> Hello,
> I have an error with 'executeSql'  on a SQLite database within a ionic 4
> application and I can't find any solution about it, I must do something
> wrong and I would like to be helped about it.
>
> *Context:*
> My application is a CRM application (*Customer Relationship Management*).
>
> *Database:*
> My database is contained in the file : "CRMApp" which is a sqlite file with
> only one table : 'client'.
>
> *Problem:*
> I'm trying to retrieve ADRESSE$RAISON_SOCIALE column from the table client
> with the following service : "testdbservice" and then I would like to show
> the data that is retrieved in a list on the page : "accueil.page.html".
> And it keeps showing me the error message linked to this mail.
>
> I have attached the app.module.ts for any informations about all the things
> that I installed with npm.
>
> I have been searching this for over two weeks now, I hope someone can help
> me and sort it out as it is an important project for me.
>
> Have a nice day,
>
> Seb
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users