问:
Convert a string to list of list of dicts python
I am new to python. I have a string which is taken from my sqlite database. I want to convert the string to a list of list of dicts. I tried ast and json library but it fails.

Here's the string:

```<code>a = '"[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]"'
</code>```

Here the code i tried:

```<code>import ast
import json
a = '"[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]"'
a = a.replace("[[","[").replace("]]","]")
print(a)

# using json library- fails
# jdata = json.loads(a)
# for d in jdata:
#     for key, value in d.iteritems():
#         print (key, value)

#using ast library - it also fails
# res = [ast.literal_eval(x) for x in a]
</code>```

I tried this link convert string to dict and convert str to list of list

But in my case, I have a list of list of dicts which is in the form of string. How to make it possible.

I want the same as the output but it should be in list of list of dicts.

Required Output:

```<code>[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]
</code>```

答:
This should work.

```<code>import ast
a = '"[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]"'

print(ast.literal_eval(a.strip('"')))
</code>```

Output:

```<code>[[{'dbname': 'smackcoders',
   'host': 'localhost',
   'id': 'mysql1',
   'limit_count': 5,
   'password': 'root',
   'plugin': 'mysql',
   'plugin_type': 'input',
   'tbname': 'agg_csv',
   'user': 'root'},
  {'action': 'count',
   'field': 'state',
   'field_name': 'count_result',
   'id': 'metrics',
   'input_from': 'mysql1',
   'plugin': 'metrics',
   'plugin_type': 'filter',
   'send_data_immediately': True,
   'value': 'kerala'},
  {'doc_typ': 'sm23',
   'id': 'elastic_search',
   'ind': 'neww10',
   'input_from': 'metrics',
   'plugin': 'elastic',
   'plugin_type': 'output'}]]
</code>```

Body:
I am new to python. I have a string which is taken from my sqlite database. I want to convert the string to a list of list of dicts. I tried ast and json library but it fails.

Here's the string:

a = '"[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]"'

Here the code i tried:

import ast
import json
a = '"[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]"'
a = a.replace("[[","[").replace("]]","]")
print(a)

# using json library- fails
# jdata = json.loads(a)
# for d in jdata:
#     for key, value in d.iteritems():
#         print (key, value)

#using ast library - it also fails
# res = [ast.literal_eval(x) for x in a]

I tried this link convert string to dict and convert str to list of list

But in my case, I have a list of list of dicts which is in the form of string. How to make it possible.

I want the same as the output but it should be in list of list of dicts.

Required Output:

[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]

Body:
This should work.

import ast
a = '"[[{"plugin_type":"input","plugin":"mysql","dbname":"smackcoders","user":"root","password":"root","tbname":"agg_csv","host":"localhost","id":"mysql1","limit_count":5},{"plugin_type":"filter","plugin":"metrics","input_from":"mysql1","id":"metrics","field_name":"count_result", "field":"state","value":"kerala","action":"count","send_data_immediately":True},{"plugin_type":"output","plugin":"elastic","id":"elastic_search","input_from":"metrics","ind":"neww10","doc_typ":"sm23"}]]"'

print(ast.literal_eval(a.strip('"')))

Output:

[[{'dbname': 'smackcoders',
   'host': 'localhost',
   'id': 'mysql1',
   'limit_count': 5,
   'password': 'root',
   'plugin': 'mysql',
   'plugin_type': 'input',
   'tbname': 'agg_csv',
   'user': 'root'},
  {'action': 'count',
   'field': 'state',
   'field_name': 'count_result',
   'id': 'metrics',
   'input_from': 'mysql1',
   'plugin': 'metrics',
   'plugin_type': 'filter',
   'send_data_immediately': True,
   'value': 'kerala'},
  {'doc_typ': 'sm23',
   'id': 'elastic_search',
   'ind': 'neww10',
   'input_from': 'metrics',
   'plugin': 'elastic',
   'plugin_type': 'output'}]]


来源: stackexchange

问:
web component - accept no child elements
How can I define a web component that works like  in that it accepts no child elements?

  <template id="push-message">

    <message>

    </message>
  </template>

  <push-message
     badge="//google.com/favicon.ico"
      icon="//google.com/favicon.ico"
     image="//google.com/favicon.ico">

ok
```
</div>
</div>
</p>

<p><code>DOM</code> should be</p>

```<push-message></push-message>

```

<p>not</p>

```<push-message>

</push-message>
```

and ok should display in the result.

Is there a way to change customElements.define to avoid having to explicitly close <push-message></push-message> and just use <push-message> but have it implicitly self-close?

答:
Autonomous Custom Elements require a closing tag: Do custom elements require a close tag?

You can create a Customized Built-In Element extended from HTMLImageElement

to get a a self-closing IMG tag:

```<code><img is="push-message" badge="//google.com/favicon.ico">
<img is="push-message" icon="//google.com/favicon.ico">
<img is="push-message" image="//google.com/favicon.ico">
<p>ok</p>
</code>```

But an IMG can only have one src, so you might as well create 3 elements and use

```

ContentLicense: CC BY-SA 4.0

Body:
How can I define a web component that works like  in that it accepts no child elements?

  <template id="push-message">

    <message>

    </message>
  </template>

  <push-message
     badge="//google.com/favicon.ico"
      icon="//google.com/favicon.ico"
     image="//google.com/favicon.ico">

ok

DOM should be

<push-message></push-message>

not

<push-message>

</push-message>

and ok should display in the result.

Is there a way to change customElements.define to avoid having to explicitly close <push-message></push-message> and just use <push-message> but have it implicitly self-close?

Body:
Autonomous Custom Elements require a closing tag: Do custom elements require a close tag?

You can create a Customized Built-In Element extended from HTMLImageElement

to get a a self-closing IMG tag:

<img is="push-message" badge="//google.com/favicon.ico">
<img is="push-message" icon="//google.com/favicon.ico">
<img is="push-message" image="//google.com/favicon.ico">
<p>ok</p>

But an IMG can only have one src, so you might as well create 3 elements and use

<img is="message-badge">
<img is="message-icon">
<img is="message-image">


问:
DB2 equivalency for Teradata clustered tables
In Teradata the definition of a clustered table is very simple and exists in a single syntax (correct me if I'm wrong).

```<code>CREATE TABLE table_name (charcol1 varchar(10), idcol integer)
primary index (idcol);
</code>```

I am reading that there are a whole number of "clustered" table types in DB2 with respect to creating a share-nothing physical data layout for the object.

Defined primary index in TD will spread the table data across all nodes/virtual cpus available to the TD server.

What is the closest method (and syntax) to achieve the same within DB2?

答:
Tables are created in tablespaces, tablespaces are created in database partition groups (or sets of nodes, which you can create as you want) in Db2 for LUW.

You may use the following query to understand which tablespaces reside in which database partition groups.

```<code>SELECT
--  T.TBSPACEID, T.TBSPACETYPE
  CASE T.DATATYPE
  WHEN 'A' THEN 'REGULAR'
  WHEN 'L' THEN 'LARGE'
  WHEN 'T' THEN 'SYSTEMP'
  WHEN 'U' THEN 'USRTEMP'
  END DATATYPE
, T.DBPGNAME
--, T.PAGESIZE
, T.TBSPACE
--, B.BPNAME
--, G.MIN_NODENUM, G.MAX_NODENUM, G.NODE_COUNT
, G.NODES_LIST
FROM SYSCAT.TABLESPACES T
JOIN SYSCAT.BUFFERPOOLS B ON B.BUFFERPOOLID=T.BUFFERPOOLID
LEFT JOIN (
SELECT
  DBPGNAME
, COUNT(*) NODE_COUNT
, MIN(DBPARTITIONNUM) MIN_NODENUM
, MAX(DBPARTITIONNUM) MAX_NODENUM
, LISTAGG(DBPARTITIONNUM, ',') WITHIN GROUP (ORDER BY DBPARTITIONNUM) NODES_LIST
FROM SYSCAT.DBPARTITIONGROUPDEF
GROUP BY DBPGNAME
) G ON G.DBPGNAME=T.DBPGNAME
ORDER BY T.TBSPACEID;
</code>```

Let's say you get the following result:

```<code>DATATYPE  DBPGNAME        TBSPACE    NODES_LIST
--------  --------------- ---------- ----------
...
LARGE     IBMDEFAULTGROUP USERSPACE1 0,1,2,3
...
</code>```

This means that if you run the following statement, then the table is created in a tablespace USERSPACE1 which resides on database partitions (nodes) 0-3, and table data is distributed between these nodes based on a hash value computed on values of YEAR column.

```<code>CREATE TABLE SALES
(
  CUSTOMER   VARCHAR(80)
, REGION     CHAR(5)
, YEAR       INTEGER
)
IN USERSPACE1
DISTRIBUTE BY HASH (YEAR);
</code>```

It's always advisable to specify a tablespase explicitly, unless the rules of choosing such a tablespace which Db2 uses in case of absence of such a specification are applicable for your particular statement.

Body:
In Teradata the definition of a clustered table is very simple and exists in a single syntax (correct me if I'm wrong).

CREATE TABLE table_name (charcol1 varchar(10), idcol integer)
primary index (idcol);

I am reading that there are a whole number of "clustered" table types in DB2 with respect to creating a share-nothing physical data layout for the object.

Defined primary index in TD will spread the table data across all nodes/virtual cpus available to the TD server.

What is the closest method (and syntax) to achieve the same within DB2?

Body:
Tables are created in tablespaces, tablespaces are created in database partition groups (or sets of nodes, which you can create as you want) in Db2 for LUW.

You may use the following query to understand which tablespaces reside in which database partition groups.

SELECT
--  T.TBSPACEID, T.TBSPACETYPE
  CASE T.DATATYPE
  WHEN 'A' THEN 'REGULAR'
  WHEN 'L' THEN 'LARGE'
  WHEN 'T' THEN 'SYSTEMP'
  WHEN 'U' THEN 'USRTEMP'
  END DATATYPE
, T.DBPGNAME
--, T.PAGESIZE
, T.TBSPACE
--, B.BPNAME
--, G.MIN_NODENUM, G.MAX_NODENUM, G.NODE_COUNT
, G.NODES_LIST
FROM SYSCAT.TABLESPACES T
JOIN SYSCAT.BUFFERPOOLS B ON B.BUFFERPOOLID=T.BUFFERPOOLID
LEFT JOIN (
SELECT
  DBPGNAME
, COUNT(*) NODE_COUNT
, MIN(DBPARTITIONNUM) MIN_NODENUM
, MAX(DBPARTITIONNUM) MAX_NODENUM
, LISTAGG(DBPARTITIONNUM, ',') WITHIN GROUP (ORDER BY DBPARTITIONNUM) NODES_LIST
FROM SYSCAT.DBPARTITIONGROUPDEF
GROUP BY DBPGNAME
) G ON G.DBPGNAME=T.DBPGNAME
ORDER BY T.TBSPACEID;

Let's say you get the following result:

DATATYPE  DBPGNAME        TBSPACE    NODES_LIST
--------  --------------- ---------- ----------
...
LARGE     IBMDEFAULTGROUP USERSPACE1 0,1,2,3
...

This means that if you run the following statement, then the table is created in a tablespace USERSPACE1 which resides on database partitions (nodes) 0-3, and table data is distributed between these nodes based on a hash value computed on values of YEAR column.

CREATE TABLE SALES
(
  CUSTOMER   VARCHAR(80)
, REGION     CHAR(5)
, YEAR       INTEGER
)
IN USERSPACE1
DISTRIBUTE BY HASH (YEAR);

It's always advisable to specify a tablespase explicitly, unless the rules of choosing such a tablespace which Db2 uses in case of absence of such a specification are applicable for your particular statement.


问:
.app file appears in red (missing) in new projects with Xcode 4
Every time I create an Xcode 4 project (iPhone app, cocoa library...) the .app file or the .a file under Products group appears in red (is missing).

Even if I build the project the file stills in red.

All my settings are default.

答: Click on Product -> Clean Build Folder and then try again to build app for current selected device. Maybe not from first, but from second time it will build correctly.</p>


问:
How can one make a Docker Compose service build depend on another service?
Here's what I mean.  How can I write a docker-compose.yaml file so that when one of the services is "built", it first runs another service?

I'll try to be even more specific.  I'm trying to build a Java application using the database library JOOQ, which wants to connect to a database at build time in order to generate Java classes that correspond to database tables.  I would like some combination of Dockerfile(s) and docker-compose.yaml file, such that the following happens in roughly the following order.

A "database" service is started (in my case, using a postgres image).

The database is initialized with SQL scripts in my development repo.

The build phase of my "web" service runs, which uses a Dockerfile in the same repo, which invokes the Gradle build, which tells JOOQ to connect to the database service started in step 1.  This generates Java files, compiles them, and does everything else for building the container.

The "web" service is started, connecting to the database service started in step 1.

Here's the docker-compose.yaml file I'm working with

```<code>version: '3.7'
services:
  postgres:
    image: postgres:10.5-alpine
    restart: always
    ports:
      - "6432:5432"
    environment:
      POSTGRES_DB: flashtools
      POSTGRES_USER: flashtools
      POSTGRES_PASSWORD: flashtools
    volumes:
      - ./src/main/scripts/01_init.sql:/docker-entrypoint-
initdb.d/01_init.sql
  web:
    build: .
    network_mode: host
    depends_on:
      - postgres
    ports:
      - "8080:8080"
</code>```

I'll flesh this out with more details, but hopefully what I'm asking is pretty straightforward.

答:
I had the same issue and solved it in a hacky way...

In my case the web service is Haskell, which builds with the stack build command, then executes with the stack exec APP_NAME. There's also a shorthand like stack build --exec APP_NAME.

Also there is an option to build only the dependencies with stack build --only-dependencies, so the Docker build cache them.

So I changed my Dockerfile like this:

```<code>COPY ./package.yaml /app/package.yaml        # Copying the package file
RUN stack build --only-dependencies          # Build dependencies only

COPY . /app                                  # Copying the rest of the files

EXPOSE 3000

CMD ["stack", "build", "--exec", "APP_NAME"] # Build the application itself
</code>```

so the final build runs only when the service is started.

I don't know Java enough, but I guess there must be a similar option there too.

Also some hacking on the depends_on part is also needed:
https://docs.docker.com/compose/startup-order/

Body:
Here's what I mean.  How can I write a docker-compose.yaml file so that when one of the services is "built", it first runs another service?

I'll try to be even more specific.  I'm trying to build a Java application using the database library JOOQ, which wants to connect to a database at build time in order to generate Java classes that correspond to database tables.  I would like some combination of Dockerfile(s) and docker-compose.yaml file, such that the following happens in roughly the following order.

A "database" service is started (in my case, using a postgres image).

The database is initialized with SQL scripts in my development repo.

The build phase of my "web" service runs, which uses a Dockerfile in the same repo, which invokes the Gradle build, which tells JOOQ to connect to the database service started in step 1.  This generates Java files, compiles them, and does everything else for building the container.

The "web" service is started, connecting to the database service started in step 1.

Here's the docker-compose.yaml file I'm working with

version: '3.7'
services:
  postgres:
    image: postgres:10.5-alpine
    restart: always
    ports:
      - "6432:5432"
    environment:
      POSTGRES_DB: flashtools
      POSTGRES_USER: flashtools
      POSTGRES_PASSWORD: flashtools
    volumes:
      - ./src/main/scripts/01_init.sql:/docker-entrypoint-
initdb.d/01_init.sql
  web:
    build: .
    network_mode: host
    depends_on:
      - postgres
    ports:
      - "8080:8080"

I'll flesh this out with more details, but hopefully what I'm asking is pretty straightforward.

Body:
I had the same issue and solved it in a hacky way...

In my case the web service is Haskell, which builds with the stack build command, then executes with the stack exec APP_NAME. There's also a shorthand like stack build --exec APP_NAME.

Also there is an option to build only the dependencies with stack build --only-dependencies, so the Docker build cache them.

So I changed my Dockerfile like this:

COPY ./package.yaml /app/package.yaml        # Copying the package file
RUN stack build --only-dependencies          # Build dependencies only

COPY . /app                                  # Copying the rest of the files

EXPOSE 3000

CMD ["stack", "build", "--exec", "APP_NAME"] # Build the application itself

so the final build runs only when the service is started.

I don't know Java enough, but I guess there must be a similar option there too.

Also some hacking on the depends_on part is also needed:
https://docs.docker.com/compose/startup-order/


问:
Size-limited queue that holds last N elements in Java
A very simple & quick question on Java libraries: is there a ready-made class that implements a Queue with a fixed maximum size - i.e. it always allows addition of elements, but it will silently remove head elements to accomodate space for newly added elements.

Of course, it's trivial to implement it manually:

```<code>import java.util.LinkedList;

public class LimitedQueue<E> extends LinkedList<E> {
    private int limit;

    public LimitedQueue(int limit) {
        this.limit = limit;
    }

    @Override
    public boolean add(E o) {
        super.add(o);
        while (size() > limit) { super.remove(); }
        return true;
    }
}
</code>```

As far as I see, there's no standard implementation in Java stdlibs, but may be there's one in Apache Commons or something like that?

答:
The only thing I know that has limited space is the BlockingQueue interface (which is e.g. implemented by the ArrayBlockingQueue class) - but they do not remove the first element if filled, but instead block the put operation until space is free (removed by other thread).

To my knowledge your trivial implementation is the easiest way to get such an behaviour.

ContentLicense: CC BY-SA 3.0

Body:
A very simple & quick question on Java libraries: is there a ready-made class that implements a Queue with a fixed maximum size - i.e. it always allows addition of elements, but it will silently remove head elements to accomodate space for newly added elements.

Of course, it's trivial to implement it manually:

import java.util.LinkedList;

public class LimitedQueue<E> extends LinkedList<E> {
    private int limit;

    public LimitedQueue(int limit) {
        this.limit = limit;
    }

    @Override
    public boolean add(E o) {
        super.add(o);
        while (size() > limit) { super.remove(); }
        return true;
    }
}

As far as I see, there's no standard implementation in Java stdlibs, but may be there's one in Apache Commons or something like that?


答:
You can use ast.literal_eval. You just have to make sure the string you feed it can be parsed. In this case it suffices to remove the initial and final quotes:

```<code>from ast import literal_eval
literal_eval(a[1:-1]) # or strip('"') as in rakesh' answer

[[{'dbname': 'smackcoders',
   'host': 'localhost',
   'id': 'mysql1',
   'limit_count': 5,
   'password': 'root',
   'plugin': 'mysql',
   'plugin_type': 'input',
   'tbname': 'agg_csv',
   'user': 'root'},
  {'action': 'count',
   'field': 'state',
   'field_name': 'count_result',
  ...
</code>```

Title: Convert a string to list of list of dicts python

Body:
You can use ast.literal_eval. You just have to make sure the string you feed it can be parsed. In this case it suffices to remove the initial and final quotes:

from ast import literal_eval
literal_eval(a[1:-1]) # or strip('"') as in rakesh' answer

[[{'dbname': 'smackcoders',
   'host': 'localhost',
   'id': 'mysql1',
   'limit_count': 5,
   'password': 'root',
   'plugin': 'mysql',
   'plugin_type': 'input',
   'tbname': 'agg_csv',
   'user': 'root'},
  {'action': 'count',
   'field': 'state',
   'field_name': 'count_result',
  ...


问:
Navigation inside TabHost
I have a problem with the navigation: I created a tabbed application using MvxTabsFragmentActivity and all worked great until I start navigating inside the tabs; If I navigate one level inside one tab and then I change the tab, on the second tab I am presented with the content from the first tab. Have anyone encountered this problem?

I created the tabs using TabHost.

```<code><?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:local="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/actualtabcontent"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:layout_above="@+id/tabContainer"/>

    <LinearLayout android:id="@+id/tabContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">

    <TabHost android:id="@android:id/tabhost"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white">

        <LinearLayout android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="7dp"
                android:background="@drawable/gradient_border_top"
                android:orientation="horizontal" />

                <TabWidget android:id="@android:id/tabs"
                     android:orientation="horizontal"
                     android:layout_width="match_parent"
                     android:layout_height="56dp"
                     android:layout_weight="0"
                     android:background="@color/white" />

                <FrameLayout android:id="@android:id/tabcontent"
                     android:layout_width="0dp"
                     android:layout_height="0dp"
                     android:layout_weight="0" />
              </LinearLayout>
        </TabHost>
    </LinearLayout>
</RelativeLayout>
</code>```

Each time I am navigating inside the tabs the content of actualtabcontent is replaced.

Expected navigation:

Tab A: A1 -> A2.

Tab B: B1 -> B2.

Switching between tabs should display the content for the selected tab

答:
'You need to clear the cache while moving to the next tab.
if you are getting data from server using volley then use'

```<code>stringRequest.setShouldCache(false);
</code>```

'before passing your stringrequest to requestqueu.'

'if you are using something else then find a way to clear cache before loading new data.'

'hope you get the answer if not please explain your question.'

Title: Navigation inside TabHost

Body:
I have a problem with the navigation: I created a tabbed application using MvxTabsFragmentActivity and all worked great until I start navigating inside the tabs; If I navigate one level inside one tab and then I change the tab, on the second tab I am presented with the content from the first tab. Have anyone encountered this problem?

I created the tabs using TabHost.

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:local="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/actualtabcontent"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:layout_above="@+id/tabContainer"/>

    <LinearLayout android:id="@+id/tabContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">

    <TabHost android:id="@android:id/tabhost"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white">

        <LinearLayout android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="7dp"
                android:background="@drawable/gradient_border_top"
                android:orientation="horizontal" />

                <TabWidget android:id="@android:id/tabs"
                     android:orientation="horizontal"
                     android:layout_width="match_parent"
                     android:layout_height="56dp"
                     android:layout_weight="0"
                     android:background="@color/white" />

                <FrameLayout android:id="@android:id/tabcontent"
                     android:layout_width="0dp"
                     android:layout_height="0dp"
                     android:layout_weight="0" />
              </LinearLayout>
        </TabHost>
    </LinearLayout>
</RelativeLayout>

Each time I am navigating inside the tabs the content of actualtabcontent is replaced.

Expected navigation:

Tab A: A1 -> A2.

Tab B: B1 -> B2.

Switching between tabs should display the content for the selected tab

Body:
'You need to clear the cache while moving to the next tab.
if you are getting data from server using volley then use'

stringRequest.setShouldCache(false);

'before passing your stringrequest to requestqueu.'

'if you are using something else then find a way to clear cache before loading new data.'

'hope you get the answer if not please explain your question.'


问:
How to fetch the post according to custom taxonomy, start date and end date with search input in wordpress?
Custom post type --- Event

custom taxonomy----- myevents

Using jQuery Datepicker for Start date and End date

Search field for searching event name

I want to fetch the custom post type events by using the simple form search. In which I fetched custom taxonomy in select option, then I added start and end date using jQuery Datepicker at last Search field.

My search URL looks like this:

http://localhost/customthemedev/?categoryfilter=Techfest&Start=01-May-2019&End=10-May-2019&search=smoke+event+
```

<pre class="lang-html prettyprint-override"><code><form class="select-event-date" method="GET" action="<?php bloginfo('home'); ?>" autocomplete="off" id="filter">
  <div class="form-group eventfunction">
    <label>Categories</label>
    <select class="form-control" name="categoryfilter">
    <?php
       $tax_terms = get_terms('myevents', array('hide_empty' => '0'));
       foreach ( $tax_terms as $tax_term ):
          echo '<option value="'.$tax_term->name.'">'.$tax_term->name.'</option>';
       endforeach;
    ?>
    </select>
  </div>
  <div class="form-group selectDate">
    <input type="text" class="form-control" placeholder="Start Date" name="Start" id="txtFrom">
  </div>
  <div class="form-group endDate">
    <input type="text" class="form-control" placeholder="End Date" name="End"  id="txtTo">
  </div>
  <div class="form-group searchEvent">
    <label>
      <img src="<?php echo get_template_directory_uri();; ?>/assets/images/search-22.png" alt="Icon">
    </label>
    <input type="text" placeholder="Search.." name="search">
  </div>
  <button type="submit" class="btn btn-default">FIND EVENTS</button>
</form>
</code>```

答:
```<code>Try this :
</code>```

<p>//Get all terms in array format</p>

```<code>    $termSlug = array();
    $tax_terms = get_terms('myevents', array('hide_empty' => '0'));
    foreach ( $tax_terms as $tax_term ):
      $termSlug[] = $tax_term->slug;
    endforeach;

//Assign the date into variable

    $start_date = '01-May-2019';
    $end_date ='10-May-2019';

//use the date format acccording to SQL format

    $start_date_new = date("YOUR DATE FORMAT", strtotime($start_date));
    $end_date_new = date("YOUR DATE FORMAT", strtotime($end_date));
    $event_args = array(
        'post_type' => 'Event',  //Post type event
        'orderby' => 'date',
        'order' => 'DESC',
        'posts_per_page' => -1,
        'meta_query'=>array(    //Meta Query search
            'relation'=>'AND',
             array(
                'key' => 'start_date',
                'value' => $start_date_new, //start date here
                'compare' => '>=',
                'type' => 'NUMERIC'
             ),
             array(
                'key' => 'end_date',
                'value' => $end_date_new, //end date here
                'compare' => '<=',
                'type' => 'NUMERIC'
             )
         ),
        'tax_query' => array(
            array (
                'taxonomy' => 'myevents', //Taxonomy search
                'field' => 'slug',
                'terms' => $termSlug,  //terms in array
            )
        ),
    );
    $all_events = new WP_Query($event_args);

    echo '```';print_r($all_events);echo '```';
</code>```

Body:
Custom post type --- Event

custom taxonomy----- myevents

Using jQuery Datepicker for Start date and End date

Search field for searching event name

I want to fetch the custom post type events by using the simple form search. In which I fetched custom taxonomy in select option, then I added start and end date using jQuery Datepicker at last Search field.

My search URL looks like this:

http://localhost/customthemedev/?categoryfilter=Techfest&Start=01-May-2019&End=10-May-2019&search=smoke+event+

<form class="select-event-date" method="GET" action="<?php bloginfo('home'); ?>" autocomplete="off" id="filter">

    Categories
    <select class="form-control" name="categoryfilter">
    <?php
       $tax_terms = get_terms('myevents', array('hide_empty' => '0'));
       foreach ( $tax_terms as $tax_term ):
          echo '<option value="'.$tax_term->name.'">'.$tax_term->name.'</option>';
       endforeach;
    ?>
    </select>

    <input type="text" class="form-control" placeholder="Start Date" name="Start" id="txtFrom">

    <input type="text" class="form-control" placeholder="End Date" name="End"  id="txtTo">

      <img src="<?php echo get_template_directory_uri();; ?>/assets/images/search-22.png" alt="Icon">

    <input type="text" placeholder="Search.." name="search">

  <button type="submit" class="btn btn-default">FIND EVENTS</button>
</form>

Body:
Try this :

//Get all terms in array format

    $termSlug = array();
    $tax_terms = get_terms('myevents', array('hide_empty' => '0'));
    foreach ( $tax_terms as $tax_term ):
      $termSlug[] = $tax_term->slug;
    endforeach;

//Assign the date into variable

    $start_date = '01-May-2019';
    $end_date ='10-May-2019';

//use the date format acccording to SQL format

    $start_date_new = date("YOUR DATE FORMAT", strtotime($start_date));
    $end_date_new = date("YOUR DATE FORMAT", strtotime($end_date));
    $event_args = array(
        'post_type' => 'Event',  //Post type event
        'orderby' => 'date',
        'order' => 'DESC',
        'posts_per_page' => -1,
        'meta_query'=>array(    //Meta Query search
            'relation'=>'AND',
             array(
                'key' => 'start_date',
                'value' => $start_date_new, //start date here
                'compare' => '>=',
                'type' => 'NUMERIC'
             ),
             array(
                'key' => 'end_date',
                'value' => $end_date_new, //end date here
                'compare' => '<=',
                'type' => 'NUMERIC'
             )
         ),
        'tax_query' => array(
            array (
                'taxonomy' => 'myevents', //Taxonomy search
                'field' => 'slug',
                'terms' => $termSlug,  //terms in array
            )
        ),
    );
    $all_events = new WP_Query($event_args);

    echo '<pre>';print_r($all_events);echo '</pre>';


问:
How to correctly get the errors at the end of the Oracle function?
This is the code that I have at the end of my procedure. It's supposed to show the errors if something went wrong:

```<code>IF return_status = 'E' OR return_status = 'U'
  THEN
     MESSAGE := MESSAGE || 'return status: ' || return_status || ' msg: ';
     IF (FND_MSG_PUB.Count_Msg > 0)
     THEN
        FOR i IN 1 .. FND_MSG_PUB.Count_Msg
        LOOP
           FND_MSG_PUB.Get (p_msg_index       => i,
                            p_encoded         => 'F',
                            p_data            => out_message,
                            p_msg_index_OUT   => l_msg_index_OUT);
           MESSAGE := MESSAGE || ' ' || out_message;
        END LOOP;
     END IF;
  END IF;

  RETURN (MESSAGE);
</code>```

MESSAGE is VARCHAR2(4000) variable;

I execute the procedure multiple times and quite quickly I get the following error: [Error] ORA-06502: PL/SQL: numeric or value error: character string buffer too small

This is the output (the number is lead_id, the rest is concatenated error message):

```192774
192930
192966
193714
193714
193714
193848
193848
193848
193848
194096
194096
194109
194109
194593
194593
194124
195055
194875
195451
195451
195451
195451
195451 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database.
191239 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database.
191239
187351
192237
195868 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
195939 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
196827 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
196977
196977
196977 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197024
197060 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197158 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197280
197280
197420
197420
197420
197502
197502
197502
197502 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197502
197761
189846
189846
198500
198500
198500
174335
174335
174335
207133
```

You can easily see that the message contains the errors from the previous call. How can I rewrite it, so it only contains the correct message? I thought about getting the last message only instead all < FND_MSG_PUB.Count_Msg, but I am not sure if that's correct. I am a .NET developer and this is our legacy code. I also found this on the Internet: http://orclpps.blogspot.com/2007/06/fndmsgpub-for-error-logging-in-oracle.html which also makes use of all the messages. Is it possible to clear the FND_MSG_PUB somehow or find only the errors resulting from the current call?

答:
Let's see an example with Item Category assignment to Items.

Here, you can see the parameter "p_init_msg_list" is set to false, which means the message API won't be initialised and concatenate all the errors stored.

```<code>inv_item_category_pub.create_category_assignment (
    p_api_version         => 1.0
    , p_init_msg_list       => fnd_api.g_false
    , p_commit              => fnd_api.g_false
    , x_return_status       => l_return_status
    , x_errorcode           => l_errorcode
    , x_msg_count           => l_msg_count
    , x_msg_data            => l_msg_data
    , p_category_id         => l_category_id
    , p_category_set_id     => l_category_set_id
    , p_inventory_item_id   => l_inventory_item_id
    , p_organization_id     => l_organization_id
);
            FOR k IN 1..fnd_msg_pub.count_msg LOOP
                fnd_msg_pub.get (
                    p_msg_index       => k
                    , p_encoded         => 'F'
                    , p_data            => l_msg_data
                    , p_msg_index_out   => l_msg_index_out
                );
                dbms_output.put_line ('l_msg_data:= ' || l_msg_data);
                IF l_msg_data IS NOT NULL THEN
                    l_error_message := l_error_message
                                       || '-'
                                       || l_msg_data;
                END IF;
            END LOOP;
</code>```

If you want to check the error respective to the transaction, set the parameter "p_init_msg_list" to true or manually initialise the message in the loop.

```<code>FND_MSG_PUB.initialize;
</code>```

Body:
This is the code that I have at the end of my procedure. It's supposed to show the errors if something went wrong:

IF return_status = 'E' OR return_status = 'U'
  THEN
     MESSAGE := MESSAGE || 'return status: ' || return_status || ' msg: ';
     IF (FND_MSG_PUB.Count_Msg > 0)
     THEN
        FOR i IN 1 .. FND_MSG_PUB.Count_Msg
        LOOP
           FND_MSG_PUB.Get (p_msg_index       => i,
                            p_encoded         => 'F',
                            p_data            => out_message,
                            p_msg_index_OUT   => l_msg_index_OUT);
           MESSAGE := MESSAGE || ' ' || out_message;
        END LOOP;
     END IF;
  END IF;

  RETURN (MESSAGE);

MESSAGE is VARCHAR2(4000) variable;

I execute the procedure multiple times and quite quickly I get the following error: [Error] ORA-06502: PL/SQL: numeric or value error: character string buffer too small

This is the output (the number is lead_id, the rest is concatenated error message):

192774
192930
192966
193714
193714
193714
193848
193848
193848
193848
194096
194096
194109
194109
194593
194593
194124
195055
194875
195451
195451
195451
195451
195451 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database.
191239 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database.
191239
187351
192237
195868 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
195939 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
196827 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
196977
196977
196977 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197024
197060 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197158 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197280
197280
197420
197420
197420
197502
197502
197502
197502 return status: E msg:  Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 616.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 493.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 11682.  Please ensure that the entered identifier or combination of identifiers exist in the database. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. Cannot read value for profile option USER_ID. The column(s), PRODUCT_CATEGORY, has an invalid value(s), 583.  Please ensure that the entered identifier or combination of identifiers exist in the database.
197502
197761
189846
189846
198500
198500
198500
174335
174335
174335
207133

You can easily see that the message contains the errors from the previous call. How can I rewrite it, so it only contains the correct message? I thought about getting the last message only instead all < FND_MSG_PUB.Count_Msg, but I am not sure if that's correct. I am a .NET developer and this is our legacy code. I also found this on the Internet: http://orclpps.blogspot.com/2007/06/fndmsgpub-for-error-logging-in-oracle.html which also makes use of all the messages. Is it possible to clear the FND_MSG_PUB somehow or find only the errors resulting from the current call?

Body:
Let's see an example with Item Category assignment to Items.

Here, you can see the parameter "p_init_msg_list" is set to false, which means the message API won't be initialised and concatenate all the errors stored.

inv_item_category_pub.create_category_assignment (
    p_api_version         => 1.0
    , p_init_msg_list       => fnd_api.g_false
    , p_commit              => fnd_api.g_false
    , x_return_status       => l_return_status
    , x_errorcode           => l_errorcode
    , x_msg_count           => l_msg_count
    , x_msg_data            => l_msg_data
    , p_category_id         => l_category_id
    , p_category_set_id     => l_category_set_id
    , p_inventory_item_id   => l_inventory_item_id
    , p_organization_id     => l_organization_id
);
            FOR k IN 1..fnd_msg_pub.count_msg LOOP
                fnd_msg_pub.get (
                    p_msg_index       => k
                    , p_encoded         => 'F'
                    , p_data            => l_msg_data
                    , p_msg_index_out   => l_msg_index_out
                );
                dbms_output.put_line ('l_msg_data:= ' || l_msg_data);
                IF l_msg_data IS NOT NULL THEN
                    l_error_message := l_error_message
                                       || '-'
                                       || l_msg_data;
                END IF;
            END LOOP;

If you want to check the error respective to the transaction, set the parameter "p_init_msg_list" to true or manually initialise the message in the loop.

FND_MSG_PUB.initialize;


问:
Cant getting SMS code from facebook account kit
I Implemented facebook account kit to verify mobile number and it is working properly in my phone but when i submit app to app store they saying "your app did not respond when we requested an OTP code."

"The steps to reproduce are:
Launch the app > create a new account > select the country (we selected US) > enter a phone number > the indicator spun indefinitely"

i dont know what is the issue. is there any account kit issue or something else.

did any one face this type of issue with apple?

答:
I think that this guy had the same problem

Sending an SMS with your code infinite loading screen Account kit IOS

Facebook answer (https://developers.facebook.com/docs/accountkit/faq) to the question:  I am experiencing delays in SMS delivery. What should I do?

In majority of the cases, SMS delivery will arrive within a few seconds. In some other cases, an SMS could be delayed due to routing issues or regional issues in the end users' locale.

Maybe you should ask directly to facebook about possible issues.


问:
Excel - conditionally transpose rows to columns
I've got an extract of an online spreadsheet where it's laid out :

```<code>1   date   author   modified   comment
1   date   author   modified   comment2
1   date   author   modified   comment3
1   date   author   modified   commentn
2   date   author   modified   comment
2   date   author   modified   comment2
2   date   author   modified   comment3
2   date   author   modified   commentn
3   date   author   modified   comment
3   date   author   modified   comment2
3   date   author   modified   comment3
3   date   author   modified   commentn
....
3000 date   author modified   comment60
</code>```

The number of comments associated with each index varies, and we have a few thousand lines.
For the life of me, I can't work out how to transpose these with a formula

Any thoughts on how I can achieve this in Excel?

I'd like to get it laid out as:

```<code>1 author concat(date, comment)  concat(date, comment)  concat(date, comment)
2 author concat(date, comment)  concat(date, comment)  concat(date, comment)
</code>```

...

答:
You could try:

```<code>Option Explicit

Sub test()

    Dim LastRowA As Long, i As Long, Count As Long, j As Long, k As Long, LastRowG As Long, LastColumn As Long, StartingPoint As Long
    Dim arr As Variant
    Dim strAuthor As String, strNextAuthor As String, strFullRecord As String

    With ThisWorkbook.Worksheets("Sheet1")

        LastRowA = .Cells(.Rows.Count, "A").End(xlUp).Row

        arr = .Range("A1:E" & LastRowA)

        StartingPoint = 1

        For i = LBound(arr) To UBound(arr)

            If StartingPoint = i Then

                j = i + 1

                strAuthor = arr(i, 1)
                strNextAuthor = arr(j, 1)

                    Do Until strAuthor <> strNextAuthor

                        j = j + 1

                        If j > LastRowA Then
                            Exit Do
                        Else
                            strNextAuthor = arr(j, 1)
                        End If

                    Loop

                LastRowG = .Cells(.Rows.Count, "G").End(xlUp).Row

                If LastRowG = 1 And .Range("G1").Value = "" Then
                    LastRowG = 1
                Else
                    LastRowG = LastRowG + 1
                End If

                For k = i To j - 1

                    LastColumn = .Cells(LastRowG, .Columns.Count).End(xlToLeft).Column

                    If .Range("G" & LastRowG).Value = "" Then
                        .Range("G" & LastRowG).Value = arr(k, 1)
                        .Range("H" & LastRowG).Value = arr(k, 3)
                        .Range("I" & LastRowG).Value = "(" & arr(k, 2) & ", " & arr(k, 5) & ")"
                    Else
                        .Cells(LastRowG, LastColumn + 1) = "(" & arr(k, 2) & ", " & arr(k, 5) & ")"
                    End If

                Next k

                StartingPoint = j

            End If

        Next i

    End With

End Sub
</code>```

Results:

Body:
I've got an extract of an online spreadsheet where it's laid out :

1   date   author   modified   comment
1   date   author   modified   comment2
1   date   author   modified   comment3
1   date   author   modified   commentn
2   date   author   modified   comment
2   date   author   modified   comment2
2   date   author   modified   comment3
2   date   author   modified   commentn
3   date   author   modified   comment
3   date   author   modified   comment2
3   date   author   modified   comment3
3   date   author   modified   commentn
....
3000 date   author modified   comment60

The number of comments associated with each index varies, and we have a few thousand lines.
For the life of me, I can't work out how to transpose these with a formula

Any thoughts on how I can achieve this in Excel?

I'd like to get it laid out as:

1 author concat(date, comment)  concat(date, comment)  concat(date, comment)
2 author concat(date, comment)  concat(date, comment)  concat(date, comment)

...

Body:
You could try:

Option Explicit

Sub test()

    Dim LastRowA As Long, i As Long, Count As Long, j As Long, k As Long, LastRowG As Long, LastColumn As Long, StartingPoint As Long
    Dim arr As Variant
    Dim strAuthor As String, strNextAuthor As String, strFullRecord As String

    With ThisWorkbook.Worksheets("Sheet1")

        LastRowA = .Cells(.Rows.Count, "A").End(xlUp).Row

        arr = .Range("A1:E" & LastRowA)

        StartingPoint = 1

        For i = LBound(arr) To UBound(arr)

            If StartingPoint = i Then

                j = i + 1

                strAuthor = arr(i, 1)
                strNextAuthor = arr(j, 1)

                    Do Until strAuthor <> strNextAuthor

                        j = j + 1

                        If j > LastRowA Then
                            Exit Do
                        Else
                            strNextAuthor = arr(j, 1)
                        End If

                    Loop

                LastRowG = .Cells(.Rows.Count, "G").End(xlUp).Row

                If LastRowG = 1 And .Range("G1").Value = "" Then
                    LastRowG = 1
                Else
                    LastRowG = LastRowG + 1
                End If

                For k = i To j - 1

                    LastColumn = .Cells(LastRowG, .Columns.Count).End(xlToLeft).Column

                    If .Range("G" & LastRowG).Value = "" Then
                        .Range("G" & LastRowG).Value = arr(k, 1)
                        .Range("H" & LastRowG).Value = arr(k, 3)
                        .Range("I" & LastRowG).Value = "(" & arr(k, 2) & ", " & arr(k, 5) & ")"
                    Else
                        .Cells(LastRowG, LastColumn + 1) = "(" & arr(k, 2) & ", " & arr(k, 5) & ")"
                    End If

                Next k

                StartingPoint = j

            End If

        Next i

    End With

End Sub

Results:


问:
Unable to get focus on Textbox when bootstrap modal popup opens
Hii I want to get focus on input textbox when the bootstrap modal popup opens

```<code><div class="modal fade nopading" id="myModalpop" role="dialog">
    <div class="model-area">

        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-head">
                <a class="navbar-brand" href="index.html"><img src="~/Content/images/logo.png" alt="Ova" style="float: left; padding-top: 10px;"></a>
                <form class="form-inline md-form form-sm mt-0" style="text-align: center;" method="get" action="@Url.Action("Review", "Product")">
                    <a href"#"><i class="fa fa-search" aria-hidden="true"></i></a>
                    <input name="id" class="form-contro form-control-sm ml-3 w-75 wow fadeInRight animated" id="txtsearch"  type="text" placeholder="Search" aria-label="Search">
                </form>
                <button type="button" class="close" data-dismiss="modal">×</button>

            </div>
            <div class="modal-body" style="padding: 0px;">
                @*<p class="links_p wow fadeInRight animated">QUICK LINKS</p>*@

            </div>

        </div>
    </div>

</div><!-- end navbar-cell -->
</code>```

I have applied javascript

```<code><script type="text/javascript">
$(document).ready(function () {

    $('#myModalpop').on('show.bs.modal', function () {

        $('#txtsearch').focus;
        //$(this).find('#txtsearch').focus();
     });
});
</script>
</code>```

Focus on textbox

答:
Edit:

```<code><div class="model-area">

'show.bs.modal'
</code>```

change to

```<code><div class="modal-dialog">

'shown.bs.modal'
</code>```

Notice model and modal

Did you missed the bracket?

```<code>$('#txtsearch').focus();
</code>```

Body:
Hii I want to get focus on input textbox when the bootstrap modal popup opens

                <form class="form-inline md-form form-sm mt-0" style="text-align: center;" method="get" action="@Url.Action("Review", "Product")">

                    <input name="id" class="form-contro form-control-sm ml-3 w-75 wow fadeInRight animated" id="txtsearch"  type="text" placeholder="Search" aria-label="Search">
                </form>
                <button type="button" class="close" data-dismiss="modal">×</button>

                @*
QUICK LINKS
*@

I have applied javascript

Focus on textbox

Body:
Edit:

<div class="model-area">

'show.bs.modal'

change to

<div class="modal-dialog">

'shown.bs.modal'

Notice model and modal

Did you missed the bracket?

$('#txtsearch').focus();


问:
error in method-override installation
i am having this error below

```<code>Error: Cannot find module 'method-override'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/html/web/admin_and_store_panel/server.js:4:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
</code>```

even though i have install

npm install method-override

答:
The error is probably because either it's not installed properly or it's not present in the node-modules folder. You could reinstall it by following the below steps:

Delete the package-lock.json folder.

Execute this command on terminal or windows command line npm install --save method-override

Title: error in method-override installation

Body:
i am having this error below

Error: Cannot find module 'method-override'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/html/web/admin_and_store_panel/server.js:4:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

even though i have install

npm install method-override